From ea95b515e5bfa6ef67a49892849f59649c5ab7c8 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 24 Oct 2015 22:19:25 +0300 Subject: [PATCH] Test players and rules for bad packets --- Tests/Tests.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Tests/Tests.php b/Tests/Tests.php index 78bdbe1..d0a932d 100644 --- a/Tests/Tests.php +++ b/Tests/Tests.php @@ -188,7 +188,7 @@ /** * @expectedException xPaw\SourceQuery\Exception\InvalidPacketException - * @dataProvider BadInfoProvider + * @dataProvider BadPacketProvider */ public function testBadGetInfo( $Data ) { @@ -197,7 +197,29 @@ $this->SourceQuery->GetInfo(); } - public function BadInfoProvider( ) + /** + * @expectedException xPaw\SourceQuery\Exception\InvalidPacketException + * @dataProvider BadPacketProvider + */ + public function testBadGetPlayers( $Data ) + { + $this->Socket->Queue( $Data ); + + $this->SourceQuery->GetPlayers(); + } + + /** + * @expectedException xPaw\SourceQuery\Exception\InvalidPacketException + * @dataProvider BadPacketProvider + */ + public function testBadGetRules( $Data ) + { + $this->Socket->Queue( $Data ); + + $this->SourceQuery->GetRules(); + } + + public function BadPacketProvider( ) { return [