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:
32
phpmon-tests/Concord/ShellTest.swift
Normal file
32
phpmon-tests/Concord/ShellTest.swift
Normal 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"))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user