implement close on mock

This commit is contained in:
freek 2018-11-27 00:00:26 +01:00
parent 17109ec8db
commit 9fc7747b1d
1 changed files with 8 additions and 1 deletions

View File

@ -13,6 +13,8 @@ class Connection implements ConnectionInterface
public $sentData = [];
public $closed = false;
function send($data)
{
$this->sentData[] = json_decode($data, true);
@ -20,7 +22,7 @@ class Connection implements ConnectionInterface
function close()
{
// TODO: Implement close() method.
$this->closed = true;
}
public function assertSentEvent(string $name, array $additionalParameters = [])
@ -35,4 +37,9 @@ class Connection implements ConnectionInterface
PHPUnit::assertSame($event[$parameter], $value);
}
}
public function assertClosed()
{
PHPUnit::assertTrue($this->closed);
}
}