Ejemplo n.º 1
0
 public function testPullStreamCommandRetursFail()
 {
     $pullStreamConfig = new PullStream();
     $pullStreamConfig->setUri('http://test.com');
     $pullStreamConfig->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')->pullStream($pullStreamConfig);
     $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('pullStream', $dummyProtocol->getLastFunctionName());
     $this->assertTrue($dummyProtocol->containsLastParam('uri', 'http://test.com'));
     $this->assertTrue($dummyProtocol->containsLastParam('localStreamName', 'testname'));
 }
Ejemplo n.º 2
0
 public function testGetRightParams()
 {
     $pullStream = new PullStream();
     $pullStream->setUri('rtpm://test.co');
     $pullStream->setTcUrl(2);
     $pullStream->setLocalStreamName('test stream name');
     $pullStream->setKeepAlive(5);
     $params = $pullStream->getParams();
     $this->assertEquals(4, count($params));
 }