Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Websocket/PhraseanetWampServerTest.php
2014-02-15 11:38:51 +01:00

35 lines
984 B
PHP

<?php
namespace Alchemy\Tests\Phrasea\Websocket;
use Alchemy\Phrasea\Websocket\PhraseanetWampServer;
class PhraseanetWampServerTest extends \PhraseanetTestCase
{
public function testOpenConnectionConnected()
{
$topicsManager = $this->createTopicsManagerMock();
$conn = $this->getMock('Ratchet\ConnectionInterface');
$topicsManager->expects($this->once())
->method('openConnection')
->with($conn);
$server = new PhraseanetWampServer($topicsManager, $this->createLoggerMock());
$server->onOpen($conn);
}
private function createTopicsManagerMock()
{
return $this->getMockBuilder('Alchemy\Phrasea\Websocket\Topics\TopicsManager')
->disableOriginalConstructor()
->getMock();
}
private function createLoggerMock()
{
return $this->getMockBuilder('Psr\Log\LoggerInterface')
->disableOriginalConstructor()
->getMock();
}
}