public function testRconAuthSuccessful() { $socket = $this->getMockBuilder('UDPSocket')->setMethods(array('rconExec'))->disableOriginalConstructor()->getMock(); $socket->expects($this->once())->method('rconExec')->with('password', '')->will($this->returnValue('')); $server = new TestableGoldSrcServer('127.0.0.1'); $server->socket = $socket; $this->assertTrue($server->rconAuth('password')); $this->assertEquals('password', $server->rconPassword); }
public function testRconAuth() { $server = new TestableGoldSrcServer('127.0.0.1'); $this->assertTrue($server->rconAuth('password')); $this->assertEquals('password', $server->rconPassword); }