Skip to content

Commit

Permalink
adds a test for empty json rpc response collections
Browse files Browse the repository at this point in the history
  • Loading branch information
oqq committed Dec 5, 2017
1 parent b208d99 commit a02994a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/JsonRpc/ResponseCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,20 @@ public function it_iterates_and_accesses_correctly()

$this->assertNull($responseCollection->getResponse('unknown id'));
}

/**
* @test
*/
public function it_iterates_and_accesses_correctly_without_results()
{
$responseCollection = new JsonRpcResponseCollection();

$this->assertCount(0, $responseCollection);
$this->assertFalse($responseCollection->hasResponse('unknown id'));
$this->assertNull($responseCollection->getResponse('unknown id'));

foreach ($responseCollection as $response) {
$this->assertFalse(true);
}
}
}

0 comments on commit a02994a

Please sign in to comment.