mirror of
https://github.com/xPaw/PHP-Source-Query.git
synced 2026-05-18 14:53:33 +02:00
Add timeout and not connected test
This commit is contained in:
@@ -71,6 +71,53 @@
|
|||||||
public function tearDown()
|
public function tearDown()
|
||||||
{
|
{
|
||||||
$this->SourceQuery->Disconnect();
|
$this->SourceQuery->Disconnect();
|
||||||
|
|
||||||
|
unset( $this->SourceQuery );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException xPaw\SourceQuery\Exception\InvalidArgumentException
|
||||||
|
*/
|
||||||
|
public function testInvalidTimeout()
|
||||||
|
{
|
||||||
|
$SourceQuery = new SourceQuery( );
|
||||||
|
$SourceQuery->Connect( 1, 2, -1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException xPaw\SourceQuery\Exception\SocketException
|
||||||
|
*/
|
||||||
|
public function testNotConnectedGetInfo()
|
||||||
|
{
|
||||||
|
$this->SourceQuery->Disconnect();
|
||||||
|
$this->SourceQuery->GetInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException xPaw\SourceQuery\Exception\SocketException
|
||||||
|
*/
|
||||||
|
public function testNotConnectedPing()
|
||||||
|
{
|
||||||
|
$this->SourceQuery->Disconnect();
|
||||||
|
$this->SourceQuery->Ping();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException xPaw\SourceQuery\Exception\SocketException
|
||||||
|
*/
|
||||||
|
public function testNotConnectedGetPlayers()
|
||||||
|
{
|
||||||
|
$this->SourceQuery->Disconnect();
|
||||||
|
$this->SourceQuery->GetPlayers();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException xPaw\SourceQuery\Exception\SocketException
|
||||||
|
*/
|
||||||
|
public function testNotConnectedGetRules()
|
||||||
|
{
|
||||||
|
$this->SourceQuery->Disconnect();
|
||||||
|
$this->SourceQuery->GetRules();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user