From bbb894a9cfa67a597bda5eae1f0a90b18c43a6b7 Mon Sep 17 00:00:00 2001 From: Eranio Date: Sun, 28 Aug 2022 17:30:44 +0200 Subject: [PATCH] Fix#3 --- src/GameQ/Protocols/Blackmesa.php | 7 ------ src/GameQ/Protocols/Citadel.php | 7 ------ tests/Protocols/Barotrauma.php | 39 ++++++++++++++++--------------- tests/Protocols/Blackmesa.php | 39 ++++++++++++++++--------------- tests/Protocols/Citadel.php | 39 ++++++++++++++++--------------- tests/Protocols/Fof.php | 4 ---- tests/Protocols/Hl1.php | 4 ---- tests/Protocols/Modiverse.php | 4 ---- tests/Protocols/Nmrih.php | 4 ---- tests/Protocols/Of.php | 4 ---- tests/Protocols/Sco.php | 4 ---- tests/Protocols/Stormworks.php | 4 ---- 12 files changed, 60 insertions(+), 99 deletions(-) diff --git a/src/GameQ/Protocols/Blackmesa.php b/src/GameQ/Protocols/Blackmesa.php index d03ef9df..efaafdfb 100644 --- a/src/GameQ/Protocols/Blackmesa.php +++ b/src/GameQ/Protocols/Blackmesa.php @@ -39,11 +39,4 @@ class Blackmesa extends Source * @type string */ protected $name_long = "Black Mesa"; - - /** - * query_port = client_port + 1 - * - * @type int - * protected $port_diff = 1; - */ } diff --git a/src/GameQ/Protocols/Citadel.php b/src/GameQ/Protocols/Citadel.php index 5b4694f4..3d1074b1 100644 --- a/src/GameQ/Protocols/Citadel.php +++ b/src/GameQ/Protocols/Citadel.php @@ -39,11 +39,4 @@ class Citadel extends Source * @type string */ protected $name_long = "Citadel"; - - /** - * query_port = client_port + 1 - * - * @type int - * protected $port_diff = 1; - */ } diff --git a/tests/Protocols/Barotrauma.php b/tests/Protocols/Barotrauma.php index 7bb1b8f4..3a4b8488 100644 --- a/tests/Protocols/Barotrauma.php +++ b/tests/Protocols/Barotrauma.php @@ -16,33 +16,34 @@ * along with this program. If not, see . */ -namespace GameQ\Protocols; +namespace GameQ\Tests\Protocols; /** - * Barotrauma Protocol Class + * Test Class for Barotrauma * - * @package GameQ\Protocols + * @package GameQ\Tests\Protocols */ -class Barotrauma extends Source +class Barotrauma extends Base { /** - * String name of this protocol class + * Test responses for Barotrauma * - * @type string - */ - protected $name = 'barotrauma'; - - /** - * Longer string name of this protocol class + * @dataProvider loadData * - * @type string + * @param $responses + * @param $result */ - protected $name_long = "Barotrauma"; + public function testResponses($responses, $result) + { + // Pull the first key off the array this is the server ip:port + $server = key($result); - /** - * query_port = client_port + 1 - * - * @type int - */ - protected $port_diff = 1; + $testResult = $this->queryTest( + $server, + 'barotrauma', + $responses + ); + + $this->assertEquals($result[$server], $testResult); + } } diff --git a/tests/Protocols/Blackmesa.php b/tests/Protocols/Blackmesa.php index 710e1e05..3d9cb29d 100644 --- a/tests/Protocols/Blackmesa.php +++ b/tests/Protocols/Blackmesa.php @@ -16,33 +16,34 @@ * along with this program. If not, see . */ -namespace GameQ\Protocols; +namespace GameQ\Tests\Protocols; /** - * Blackmesa Protocol Class + * Test Class for Blackmesa * - * @package GameQ\Protocols + * @package GameQ\Tests\Protocols */ -class Blackmesa extends Source +class Blackmesa extends Base { /** - * String name of this protocol class + * Test responses for Blackmesa * - * @type string - */ - protected $name = 'blackmesa'; - - /** - * Longer string name of this protocol class + * @dataProvider loadData * - * @type string + * @param $responses + * @param $result */ - protected $name_long = "Black Mesa"; + public function testResponses($responses, $result) + { + // Pull the first key off the array this is the server ip:port + $server = key($result); - /** - * query_port = client_port + 1 - * - * @type int - * protected $port_diff = 1; - */ + $testResult = $this->queryTest( + $server, + 'blackmesa', + $responses + ); + + $this->assertEquals($result[$server], $testResult); + } } diff --git a/tests/Protocols/Citadel.php b/tests/Protocols/Citadel.php index c2557d96..6303d1ec 100644 --- a/tests/Protocols/Citadel.php +++ b/tests/Protocols/Citadel.php @@ -16,33 +16,34 @@ * along with this program. If not, see . */ -namespace GameQ\Protocols; +namespace GameQ\Tests\Protocols; /** - * Citadel Protocol Class + * Test Class for Citadel * - * @package GameQ\Protocols + * @package GameQ\Tests\Protocols */ -class Citadel extends Source +class Citadel extends Base { /** - * String name of this protocol class + * Test responses for Citadel * - * @type string - */ - protected $name = 'citadel'; - - /** - * Longer string name of this protocol class + * @dataProvider loadData * - * @type string + * @param $responses + * @param $result */ - protected $name_long = "Citadel"; + public function testResponses($responses, $result) + { + // Pull the first key off the array this is the server ip:port + $server = key($result); - /** - * query_port = client_port + 1 - * - * @type int - * protected $port_diff = 1; - */ + $testResult = $this->queryTest( + $server, + 'citadel', + $responses + ); + + $this->assertEquals($result[$server], $testResult); + } } diff --git a/tests/Protocols/Fof.php b/tests/Protocols/Fof.php index e05a891c..82c0620f 100644 --- a/tests/Protocols/Fof.php +++ b/tests/Protocols/Fof.php @@ -35,10 +35,6 @@ class Fof extends Base */ public function testResponses($responses, $result) { - \GameQ\Tests\MockDNS::mockHosts([ - 'g-one.org' => '164.132.202.2:27024' - ]); - // Pull the first key off the array this is the server ip:port $server = key($result); diff --git a/tests/Protocols/Hl1.php b/tests/Protocols/Hl1.php index f805a269..da5448a7 100644 --- a/tests/Protocols/Hl1.php +++ b/tests/Protocols/Hl1.php @@ -35,10 +35,6 @@ class Hl1 extends Base */ public function testResponses($responses, $result) { - \GameQ\Tests\MockDNS::mockHosts([ - 'g-one.org' => '46.174.52.4:27222' - ]); - // Pull the first key off the array this is the server ip:port $server = key($result); diff --git a/tests/Protocols/Modiverse.php b/tests/Protocols/Modiverse.php index ea8377be..76dd943a 100644 --- a/tests/Protocols/Modiverse.php +++ b/tests/Protocols/Modiverse.php @@ -35,10 +35,6 @@ class Modiverse extends Base */ public function testResponses($responses, $result) { - \GameQ\Tests\MockDNS::mockHosts([ - 'g-one.org' => '23.88.96.146:27016' - ]); - // Pull the first key off the array this is the server ip:port $server = key($result); diff --git a/tests/Protocols/Nmrih.php b/tests/Protocols/Nmrih.php index 3102799f..53bed481 100644 --- a/tests/Protocols/Nmrih.php +++ b/tests/Protocols/Nmrih.php @@ -35,10 +35,6 @@ class Nmrih extends Base */ public function testResponses($responses, $result) { - \GameQ\Tests\MockDNS::mockHosts([ - 'g-one.org' => '176.9.10.34:27055' - ]); - // Pull the first key off the array this is the server ip:port $server = key($result); diff --git a/tests/Protocols/Of.php b/tests/Protocols/Of.php index 1bbcb7c7..77897360 100644 --- a/tests/Protocols/Of.php +++ b/tests/Protocols/Of.php @@ -35,10 +35,6 @@ class Of extends Base */ public function testResponses($responses, $result) { - \GameQ\Tests\MockDNS::mockHosts([ - 'g-one.org' => '74.91.127.161:27015' - ]); - // Pull the first key off the array this is the server ip:port $server = key($result); diff --git a/tests/Protocols/Sco.php b/tests/Protocols/Sco.php index 56e78ed5..da44c874 100644 --- a/tests/Protocols/Sco.php +++ b/tests/Protocols/Sco.php @@ -35,10 +35,6 @@ class Sco extends Base */ public function testResponses($responses, $result) { - \GameQ\Tests\MockDNS::mockHosts([ - 'g-one.org' => '176.9.61.5:27027' - ]); - // Pull the first key off the array this is the server ip:port $server = key($result); diff --git a/tests/Protocols/Stormworks.php b/tests/Protocols/Stormworks.php index 3ee186f2..25e1eae6 100644 --- a/tests/Protocols/Stormworks.php +++ b/tests/Protocols/Stormworks.php @@ -35,10 +35,6 @@ class Stormworks extends Base */ public function testResponses($responses, $result) { - \GameQ\Tests\MockDNS::mockHosts([ - 'g-one.org' => '23.88.96.146:28015' - ]); - // Pull the first key off the array this is the server ip:port $server = key($result);