Skip to content

Commit

Permalink
Fix PHP warning that ControlClientTest::getMock() must match PHPUnit_…
Browse files Browse the repository at this point in the history
…Framework_TestCase::getMock(...)

This method was not supposed to extend any PHPUnit method and the name clash was our mistake.
  • Loading branch information
dapphp committed Apr 30, 2020
1 parent cfb92c0 commit 5ff0b3a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/ControlClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class ControlClientTest extends PHPUnit_Framework_TestCase
{
protected function getMock($data = null)
protected function getMockControlClient($data = null)
{
$tc = new ControlClientMock();

Expand All @@ -18,7 +18,7 @@ protected function getMock($data = null)
public function testSingleLinePositiveReply()
{
$response = array("250 OK\r\n");
$tc = $this->getMock($response);
$tc = $this->getMockControlClient($response);
$reply = $tc->readReply();

$this->assertEquals(250, $reply->getStatusCode());
Expand All @@ -36,7 +36,7 @@ public function testReadMultiReply()
"250 OK\r\n",
);

$tc = $this->getMock($response);
$tc = $this->getMockControlClient($response);
$reply = $tc->readReply($cmd);

$this->assertEquals(250, $reply->getStatusCode());
Expand All @@ -53,7 +53,7 @@ public function testReadMultiReply2()
"250 OK\r\n",
);

$tc = $this->getMock($response);
$tc = $this->getMockControlClient($response);
$reply = $tc->readReply($cmd);

$this->assertEquals(250, $reply->getStatusCode());
Expand All @@ -75,7 +75,7 @@ public function testReadLongMultiReply()
$response[] = ".\r\n";
$response[] = "250 OK\r\n";

$tc = $this->getMock($response);
$tc = $this->getMockControlClient($response);
$reply = $tc->readReply($cmd);

$this->assertEquals(250, $reply->getStatusCode());
Expand All @@ -95,7 +95,7 @@ public function testParseReplyWithAsyncEvent()
$GLOBALS['async_event'] = '';
$GLOBALS['async_data'] = '';

$tc = $this->getMock($response);
$tc = $this->getMockControlClient($response);

$tc->setAsyncEventHandler(function($event, $data) {
$GLOBALS['async_event'] = $event;
Expand Down Expand Up @@ -130,7 +130,7 @@ public function testAuthentication()
"250 OK\r\n", // authenticate reply
);

$tc = $this->getMock($response);
$tc = $this->getMockControlClient($response);

$tc->authenticate("password");

Expand All @@ -151,7 +151,7 @@ public function testFailedAuthentication()
$this->expectExceptionCode(515);
$this->expectExceptionMessage('Authentication failed: Password did not match HashedControlPassword *or* authentication cookie.');

$tc = $this->getMock($response);
$tc = $this->getMockControlClient($response);
$tc->authenticate("this is most definitely the wrong password ;)");
}
}
Expand Down

0 comments on commit 5ff0b3a

Please sign in to comment.