Add WebsocketServer command

This commit is contained in:
Romain Neutron
2014-02-11 18:17:42 +01:00
parent 0fe18a2494
commit 811be51b3d
4 changed files with 73 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace Alchemy\Tests\Phrasea\Command;
use Alchemy\Phrasea\Command\WebsocketServer;
class WebsocketServerTest extends \PhraseanetTestCase
{
public function testRunWithoutProblems()
{
$input = $this->getMock('Symfony\Component\Console\Input\InputInterface');
$output = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
$sessionType = self::$DI['cli']['conf']->get(['main', 'session', 'type'], 'file');
self::$DI['cli']['conf']->set(['main', 'session', 'type'], 'memcached');
self::$DI['cli']['ws.server'] = $this->getMockBuilder('Ratchet\App')
->disableOriginalConstructor()
->getMock();
self::$DI['cli']['ws.server']->expects($this->once())
->method('run');
$command = new WebsocketServer('websocketserver');
$command->setContainer(self::$DI['cli']);
$command->execute($input, $output);
self::$DI['cli']['conf']->set(['main', 'session', 'type'], $sessionType);
}
}