Skip to content
Prev Previous commit
Next Next commit
Filter the changelog room from the list
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Apr 1, 2019
commit 820243278753db487ca58ed151c98ea3404bf7f8
10 changes: 9 additions & 1 deletion tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ public function userIsParticipantOfRooms($user, TableNode $formData = null) {
$this->assertStatusCode($this->response, 200);

$rooms = $this->getDataFromResponse($this->response);

$rooms = array_filter($rooms, function($room) {
return $room['type'] !== 4;
});

if ($formData === null) {
PHPUnit_Framework_Assert::assertEmpty($rooms);
return;
}


PHPUnit_Framework_Assert::assertCount(count($formData->getHash()), $rooms, 'Room count does not match');
PHPUnit_Framework_Assert::assertEquals($formData->getHash(), array_map(function($room, $expectedRoom) {
$participantNames = array_map(function($participant) {
Expand Down Expand Up @@ -166,6 +170,10 @@ public function userIsParticipantOfRoom($user, $isParticipant, $identifier) {

$rooms = $this->getDataFromResponse($this->response);

$rooms = array_filter($rooms, function($room) {
return $room['type'] !== 4;
});

if ($isParticipant) {
PHPUnit_Framework_Assert::assertNotEmpty($rooms);
}
Expand Down