implement close on mock
This commit is contained in:
parent
17109ec8db
commit
9fc7747b1d
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue