given( $id = 'foobar', $socket = fopen(__FILE__, 'r'), $this->mockGenerator->orphanize('__construct'), $connection = new \Mock\Hoa\Socket\Connection() ) ->when($result = new SUT($id, $socket, $connection)) ->then ->object($result) ->string($result->getId()) ->isEqualTo($id) ->resource($result->getSocket()) ->isIdenticalTo($socket) ->object($result->getConnection()) ->isIdenticalTo($connection); } public function case_set_encryption_type() { $this ->given( $this->mockGenerator->orphanize('__construct'), $node = new \Mock\Hoa\Socket\Node() ) ->when($result = $node->setEncryptionType(LUT\Server::ENCRYPTION_SSLv23)) ->then ->variable($result) ->isNull() ->when($result = $node->setEncryptionType(LUT\Server::ENCRYPTION_TLS)) ->then ->integer($result) ->isEqualTo(LUT\Server::ENCRYPTION_SSLv23); } public function case_get_encryption_type() { $this ->given( $encryption = LUT\Server::ENCRYPTION_TLS, $this->mockGenerator->orphanize('__construct'), $node = new \Mock\Hoa\Socket\Node(), $node->setEncryptionType($encryption) ) ->when($result = $node->getEncryptionType()) ->then ->integer($result) ->isEqualTo($encryption); } }