Пример #1
0
 public function testGetRightParams()
 {
     $pushStream = new PushStream();
     $pushStream->setUri('rtpm://test.co');
     $pushStream->setTcUrl(2);
     $pushStream->setLocalStreamName('test stream name');
     $pushStream->setKeepAlive(5);
     $params = $pushStream->getParams();
     $this->assertEquals(4, count($params));
 }
Пример #2
0
 public function testPushStreamCommandRetursFail()
 {
     $pushStreamConfig = new PushStream();
     $pushStreamConfig->setUri('http://test.com');
     $pushStreamConfig->setLocalStreamName('testname');
     $dummyProtocol = new DummyProtocol();
     $dummyProtocol->addResponse(array('data' => array('a' => 'b', 'c' => 'd'), 'description' => 'test description', 'status' => 'FAIL'));
     $evostream = new Evostream($dummyProtocol);
     $result = $evostream->addServer('127.0.0.1:1234')->pushStream($pushStreamConfig);
     $this->assertEquals(false, $result->allOk());
     $this->assertEquals(1, count($result->getResponses()));
     $this->assertEquals(1, $dummyProtocol->getCallsCount());
     $this->assertEquals('127.0.0.1:1234', $dummyProtocol->getLastServerAddress());
     $this->assertEquals('pushStream', $dummyProtocol->getLastFunctionName());
     $this->assertTrue($dummyProtocol->containsLastParam('uri', 'http://test.com'));
     $this->assertTrue($dummyProtocol->containsLastParam('localStreamName', 'testname'));
 }