-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from SimonFrings/tests
Update PHPUnit configuration schema for PHPUnit 9.3 and use Number Codes if Error Constants are undefined
- Loading branch information
Showing
8 changed files
with
66 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="vendor/autoload.php" colors="true"> | ||
<!-- PHPUnit configuration file with new format for PHPUnit 9.3+ --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
cacheResult="false"> | ||
<testsuites> | ||
<testsuite name="Socks Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<coverage> | ||
<include> | ||
<directory>./src/</directory> | ||
</whitelist> | ||
</filter> | ||
</include> | ||
</coverage> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- PHPUnit configuration file with old format for PHPUnit 9.2 or older --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true"> | ||
<testsuites> | ||
<testsuite name="Socks Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory>./src/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,7 +327,7 @@ public function testConnectionInvalidNoAuthentication() | |
|
||
$this->client = new Client('socks5://127.0.0.1:' . $this->port, $this->connector); | ||
|
||
$this->assertRejectPromise($this->client->connect('www.google.com:80'), null, SOCKET_EACCES); | ||
$this->assertRejectPromise($this->client->connect('www.google.com:80'), null, defined('SOCKET_EACCES') ? SOCKET_EACCES : 13); | ||
} | ||
|
||
public function testConnectionInvalidAuthenticationMismatch() | ||
|
@@ -340,7 +340,7 @@ public function testConnectionInvalidAuthenticationMismatch() | |
|
||
$this->client = new Client('user:[email protected]:' . $this->port, $this->connector); | ||
|
||
$this->assertRejectPromise($this->client->connect('www.google.com:80'), null, SOCKET_EACCES); | ||
$this->assertRejectPromise($this->client->connect('www.google.com:80'), null, defined('SOCKET_EACCES') ? SOCKET_EACCES : 13); | ||
} | ||
|
||
public function testConnectionInvalidAuthenticatorReturnsFalse() | ||
|
@@ -355,7 +355,7 @@ public function testConnectionInvalidAuthenticatorReturnsFalse() | |
|
||
$this->client = new Client('user:[email protected]:' . $this->port, $this->connector); | ||
|
||
$this->assertRejectPromise($this->client->connect('www.google.com:80'), null, SOCKET_EACCES); | ||
$this->assertRejectPromise($this->client->connect('www.google.com:80'), null, defined('SOCKET_EACCES') ? SOCKET_EACCES : 13); | ||
} | ||
|
||
public function testConnectionInvalidAuthenticatorReturnsPromiseFulfilledWithFalse() | ||
|
@@ -370,7 +370,7 @@ public function testConnectionInvalidAuthenticatorReturnsPromiseFulfilledWithFal | |
|
||
$this->client = new Client('user:[email protected]:' . $this->port, $this->connector); | ||
|
||
$this->assertRejectPromise($this->client->connect('www.google.com:80'), null, SOCKET_EACCES); | ||
$this->assertRejectPromise($this->client->connect('www.google.com:80'), null, defined('SOCKET_EACCES') ? SOCKET_EACCES : 13); | ||
} | ||
|
||
public function testConnectionInvalidAuthenticatorReturnsPromiseRejected() | ||
|
@@ -385,7 +385,7 @@ public function testConnectionInvalidAuthenticatorReturnsPromiseRejected() | |
|
||
$this->client = new Client('user:[email protected]:' . $this->port, $this->connector); | ||
|
||
$this->assertRejectPromise($this->client->connect('www.google.com:80'), null, SOCKET_EACCES); | ||
$this->assertRejectPromise($this->client->connect('www.google.com:80'), null, defined('SOCKET_EACCES') ? SOCKET_EACCES : 13); | ||
} | ||
|
||
/** @group internet */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters