Skip to content

Commit

Permalink
Fix#3
Browse files Browse the repository at this point in the history
  • Loading branch information
Erani0 committed Aug 28, 2022
1 parent 3e6eb00 commit bbb894a
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 99 deletions.
7 changes: 0 additions & 7 deletions src/GameQ/Protocols/Blackmesa.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
*/
}
7 changes: 0 additions & 7 deletions src/GameQ/Protocols/Citadel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
*/
}
39 changes: 20 additions & 19 deletions tests/Protocols/Barotrauma.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,34 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

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);
}
}
39 changes: 20 additions & 19 deletions tests/Protocols/Blackmesa.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,34 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

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);
}
}
39 changes: 20 additions & 19 deletions tests/Protocols/Citadel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,34 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

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);
}
}
4 changes: 0 additions & 4 deletions tests/Protocols/Fof.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions tests/Protocols/Hl1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions tests/Protocols/Modiverse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions tests/Protocols/Nmrih.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions tests/Protocols/Of.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions tests/Protocols/Sco.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions tests/Protocols/Stormworks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit bbb894a

Please sign in to comment.