1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 20:10:08 +02:00

Added linting

This commit is contained in:
2022-05-03 18:16:26 +02:00
parent 790f63e8c9
commit 4d04275c57
111 changed files with 1774 additions and 1642 deletions

View File

@ -9,23 +9,23 @@
import XCTest
class NginxConfigurationTest: XCTestCase {
static var regularUrl: URL {
return Bundle(for: Self.self).url(forResource: "nginx-site", withExtension: "test")!
}
static var isolatedUrl: URL {
return Bundle(for: Self.self).url(forResource: "nginx-site-isolated", withExtension: "test")!
}
static var proxyUrl: URL {
return Bundle(for: Self.self).url(forResource: "nginx-proxy", withExtension: "test")!
}
static var secureProxyUrl: URL {
return Bundle(for: Self.self).url(forResource: "nginx-secure-proxy", withExtension: "test")!
}
func testCanDetermineSiteNameAndTld() throws {
XCTAssertEqual(
"nginx-site",
@ -36,32 +36,32 @@ class NginxConfigurationTest: XCTestCase {
NginxConfiguration(filePath: NginxConfigurationTest.regularUrl.path).tld
)
}
func testCanDetermineIsolation() throws {
XCTAssertNil(
NginxConfiguration(filePath: NginxConfigurationTest.regularUrl.path).isolatedVersion
)
XCTAssertEqual(
"8.1",
NginxConfiguration(filePath: NginxConfigurationTest.isolatedUrl.path).isolatedVersion
)
}
func testCanDetermineProxy() throws {
let proxied = NginxConfiguration(filePath: NginxConfigurationTest.proxyUrl.path)
XCTAssertTrue(proxied.contents.contains("# valet stub: proxy.valet.conf"))
XCTAssertEqual("http://127.0.0.1:90", proxied.proxy)
let normal = NginxConfiguration(filePath: NginxConfigurationTest.regularUrl.path)
XCTAssertFalse(normal.contents.contains("# valet stub: proxy.valet.conf"))
XCTAssertEqual(nil, normal.proxy)
}
func testCanDetermineSecuredProxy() throws {
let proxied = NginxConfiguration(filePath: NginxConfigurationTest.secureProxyUrl.path)
XCTAssertTrue(proxied.contents.contains("# valet stub: secure.proxy.valet.conf"))
XCTAssertEqual("http://127.0.0.1:90", proxied.proxy)
}
}