|
|
@ -82,28 +82,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
public function testInvalidTimeout() : void
|
|
|
|
public function testInvalidTimeout() : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\InvalidArgumentException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\InvalidArgumentException::class );
|
|
|
|
$SourceQuery = new SourceQuery( );
|
|
|
|
$SourceQuery = new SourceQuery( );
|
|
|
|
$SourceQuery->Connect( '', 2, -1 );
|
|
|
|
$SourceQuery->Connect( '', 2, -1 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testNotConnectedGetInfo() : void
|
|
|
|
public function testNotConnectedGetInfo() : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\SocketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\SocketException::class );
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->GetInfo();
|
|
|
|
$this->SourceQuery->GetInfo();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testNotConnectedPing() : void
|
|
|
|
public function testNotConnectedPing() : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\SocketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\SocketException::class );
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->Ping();
|
|
|
|
$this->SourceQuery->Ping();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testNotConnectedGetPlayers() : void
|
|
|
|
public function testNotConnectedGetPlayers() : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\SocketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\SocketException::class );
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->GetPlayers();
|
|
|
|
$this->SourceQuery->GetPlayers();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -113,28 +113,28 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function testNotConnectedGetRules() : void
|
|
|
|
public function testNotConnectedGetRules() : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\SocketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\SocketException::class );
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->GetRules();
|
|
|
|
$this->SourceQuery->GetRules();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testNotConnectedSetRconPassword() : void
|
|
|
|
public function testNotConnectedSetRconPassword() : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\SocketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\SocketException::class );
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->SetRconPassword('a');
|
|
|
|
$this->SourceQuery->SetRconPassword('a');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testNotConnectedRcon() : void
|
|
|
|
public function testNotConnectedRcon() : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\SocketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\SocketException::class );
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->Disconnect();
|
|
|
|
$this->SourceQuery->Rcon('a');
|
|
|
|
$this->SourceQuery->Rcon('a');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testRconWithoutPassword() : void
|
|
|
|
public function testRconWithoutPassword() : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\SocketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\SocketException::class );
|
|
|
|
$this->SourceQuery->Rcon('a');
|
|
|
|
$this->SourceQuery->Rcon('a');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -178,7 +178,7 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function testBadGetInfo( string $Data ) : void
|
|
|
|
public function testBadGetInfo( string $Data ) : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\InvalidPacketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\InvalidPacketException::class );
|
|
|
|
$this->Socket->Queue( $Data );
|
|
|
|
$this->Socket->Queue( $Data );
|
|
|
|
|
|
|
|
|
|
|
|
$this->SourceQuery->GetInfo();
|
|
|
|
$this->SourceQuery->GetInfo();
|
|
|
@ -189,7 +189,7 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function testBadGetChallengeViaPlayers( string $Data ) : void
|
|
|
|
public function testBadGetChallengeViaPlayers( string $Data ) : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\InvalidPacketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\InvalidPacketException::class );
|
|
|
|
$this->Socket->Queue( $Data );
|
|
|
|
$this->Socket->Queue( $Data );
|
|
|
|
|
|
|
|
|
|
|
|
$this->SourceQuery->GetPlayers();
|
|
|
|
$this->SourceQuery->GetPlayers();
|
|
|
@ -200,7 +200,7 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function testBadGetPlayersAfterCorrectChallenge( string $Data ) : void
|
|
|
|
public function testBadGetPlayersAfterCorrectChallenge( string $Data ) : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\InvalidPacketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\InvalidPacketException::class );
|
|
|
|
$this->Socket->Queue( "\xFF\xFF\xFF\xFF\x41\x11\x11\x11\x11" );
|
|
|
|
$this->Socket->Queue( "\xFF\xFF\xFF\xFF\x41\x11\x11\x11\x11" );
|
|
|
|
$this->Socket->Queue( $Data );
|
|
|
|
$this->Socket->Queue( $Data );
|
|
|
|
|
|
|
|
|
|
|
@ -212,7 +212,7 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function testBadGetRulesAfterCorrectChallenge( string $Data ) : void
|
|
|
|
public function testBadGetRulesAfterCorrectChallenge( string $Data ) : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->expectException( 'xPaw\SourceQuery\Exception\InvalidPacketException' );
|
|
|
|
$this->expectException( xPaw\SourceQuery\Exception\InvalidPacketException::class );
|
|
|
|
$this->Socket->Queue( "\xFF\xFF\xFF\xFF\x41\x11\x11\x11\x11" );
|
|
|
|
$this->Socket->Queue( "\xFF\xFF\xFF\xFF\x41\x11\x11\x11\x11" );
|
|
|
|
$this->Socket->Queue( $Data );
|
|
|
|
$this->Socket->Queue( $Data );
|
|
|
|
|
|
|
|
|
|
|
|