Example #1
0
 public function testItReturnsCommandInstanceWhenCallingShortcut()
 {
     $connection = $this->getMock('Rvdv\\Nntp\\Connection\\ConnectionInterface', ['connect', 'disconnect', 'sendCommand', 'sendArticle']);
     $connection->expects($this->any())->method('sendCommand')->will($this->returnArgument(0));
     $client = new Client($connection);
     $this->assertInstanceOf('Rvdv\\Nntp\\Command\\AuthInfoCommand', $client->authInfo('USER', 'user'));
     $this->assertInstanceOf('Rvdv\\Nntp\\Command\\GroupCommand', $client->group('php.doc'));
     $this->assertInstanceOf('Rvdv\\Nntp\\Command\\HelpCommand', $client->help());
     $this->assertInstanceOf('Rvdv\\Nntp\\Command\\OverviewFormatCommand', $client->overviewFormat());
     $this->assertInstanceOf('Rvdv\\Nntp\\Command\\QuitCommand', $client->quit());
     $this->assertInstanceOf('Rvdv\\Nntp\\Command\\XfeatureCommand', $client->xfeature('COMPRESS GZIP'));
     $this->assertInstanceOf('Rvdv\\Nntp\\Command\\XoverCommand', $client->xover(1, 1, []));
     $this->assertInstanceOf('Rvdv\\Nntp\\Command\\XzverCommand', $client->xzver(1, 1, []));
 }