mirror of
https://github.com/xPaw/PHP-Source-Query.git
synced 2026-06-08 01:46:00 +02:00
Add RCON non connected tests
This commit is contained in:
@@ -549,6 +549,11 @@
|
|||||||
throw new SocketException( 'Not connected.', SocketException::NOT_CONNECTED );
|
throw new SocketException( 'Not connected.', SocketException::NOT_CONNECTED );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( $this->Rcon === null )
|
||||||
|
{
|
||||||
|
throw new SocketException( 'You must set a RCON password before trying to execute a RCON command.', SocketException::NOT_CONNECTED );
|
||||||
|
}
|
||||||
|
|
||||||
return $this->Rcon->Command( $Command );
|
return $this->Rcon->Command( $Command );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,6 +125,32 @@
|
|||||||
$this->SourceQuery->GetRules();
|
$this->SourceQuery->GetRules();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException xPaw\SourceQuery\Exception\SocketException
|
||||||
|
*/
|
||||||
|
public function testNotConnectedSetRconPassword()
|
||||||
|
{
|
||||||
|
$this->SourceQuery->Disconnect();
|
||||||
|
$this->SourceQuery->SetRconPassword('a');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException xPaw\SourceQuery\Exception\SocketException
|
||||||
|
*/
|
||||||
|
public function testNotConnectedRcon()
|
||||||
|
{
|
||||||
|
$this->SourceQuery->Disconnect();
|
||||||
|
$this->SourceQuery->Rcon('a');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException xPaw\SourceQuery\Exception\SocketException
|
||||||
|
*/
|
||||||
|
public function testRconWithoutPassword()
|
||||||
|
{
|
||||||
|
$this->SourceQuery->Rcon('a');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider InfoProvider
|
* @dataProvider InfoProvider
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user