1
0
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:
Pavel Djundik
2015-10-22 00:31:45 +03:00
parent 4a73f14902
commit 8b475d2649
+47
View File
@@ -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();
} }
/** /**