1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-13 14:30:06 +02:00

🏗 Fix SwiftLint, WIP shell rework

This commit is contained in:
2022-09-20 20:49:29 +02:00
parent 4494a0555f
commit 3f25759d4f
3 changed files with 100 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
//
// ShellTest.swift
// phpmon-tests
//
// Created by Nico Verbruggen on 20/09/2022.
// Copyright © 2022 Nico Verbruggen. All rights reserved.
//
import XCTest
class ShellTest: XCTestCase {
func test_default_shell_is_system_shell() {
XCTAssertTrue(NewShell.shared is SystemShell)
XCTAssertTrue(NewShell.shared.syncPipe("php -v")
.contains("Copyright (c) The PHP Group"))
let expectedPhpOutput = """
PHP 8.1.10 (cli) (built: Sep 3 2022 12:09:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.10, Copyright (c) Zend Technologies
with Zend OPcache v8.1.10, Copyright (c), by Zend Technologies
with Xdebug v3.1.4, Copyright (c) 2002-2022, by Derick Rethans
"""
NewShell.useTestable([
"php -v": expectedPhpOutput
])
XCTAssertEqual(expectedPhpOutput, NewShell.shared.syncPipe("php -v"))
}
}