diff options
author | marvin-borner@live.com | 2018-04-16 21:09:05 +0200 |
---|---|---|
committer | marvin-borner@live.com | 2018-04-16 21:09:05 +0200 |
commit | cf14306c2b3f82a81f8d56669a71633b4d4b5fce (patch) | |
tree | 86700651aa180026e89a66064b0364b1e4346f3f /assets/php/vendor/react/socket/tests/SecureConnectorTest.php | |
parent | 619b01b3615458c4ed78bfaeabb6b1a47cc8ad8b (diff) |
Main merge to user management system - files are now at /main/public/
Diffstat (limited to 'assets/php/vendor/react/socket/tests/SecureConnectorTest.php')
-rwxr-xr-x | assets/php/vendor/react/socket/tests/SecureConnectorTest.php | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/assets/php/vendor/react/socket/tests/SecureConnectorTest.php b/assets/php/vendor/react/socket/tests/SecureConnectorTest.php deleted file mode 100755 index 0b3a702..0000000 --- a/assets/php/vendor/react/socket/tests/SecureConnectorTest.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -namespace React\Tests\Socket; - -use React\Promise; -use React\Socket\SecureConnector; - -class SecureConnectorTest extends TestCase -{ - private $loop; - private $tcp; - private $connector; - - public function setUp() - { - if (!function_exists('stream_socket_enable_crypto')) { - $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); - } - - $this->loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); - $this->tcp = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); - $this->connector = new SecureConnector($this->tcp, $this->loop); - } - - public function testConnectionWillWaitForTcpConnection() - { - $pending = new Promise\Promise(function () { }); - $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('example.com:80'))->will($this->returnValue($pending)); - - $promise = $this->connector->connect('example.com:80'); - - $this->assertInstanceOf('React\Promise\PromiseInterface', $promise); - } - - public function testConnectionWithCompleteUriWillBePassedThroughExpectForScheme() - { - $pending = new Promise\Promise(function () { }); - $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('example.com:80/path?query#fragment'))->will($this->returnValue($pending)); - - $this->connector->connect('tls://example.com:80/path?query#fragment'); - } - - public function testConnectionToInvalidSchemeWillReject() - { - $this->tcp->expects($this->never())->method('connect'); - - $promise = $this->connector->connect('tcp://example.com:80'); - - $promise->then(null, $this->expectCallableOnce()); - } - - public function testCancelDuringTcpConnectionCancelsTcpConnection() - { - $pending = new Promise\Promise(function () { }, function () { throw new \Exception(); }); - $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('example.com:80'))->will($this->returnValue($pending)); - - $promise = $this->connector->connect('example.com:80'); - $promise->cancel(); - - $promise->then($this->expectCallableNever(), $this->expectCallableOnce()); - } - - public function testConnectionWillBeClosedAndRejectedIfConnectioIsNoStream() - { - $connection = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); - $connection->expects($this->once())->method('close'); - - $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('example.com:80'))->willReturn(Promise\resolve($connection)); - - $promise = $this->connector->connect('example.com:80'); - - $promise->then($this->expectCallableNever(), $this->expectCallableOnce()); - } -} |