Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Modified expectedHeaders from TableNode to be in format expected by asse... #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/Knp/FriendlyContexts/Context/ApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,18 @@ public function theResponseShouldContainsHeaders(TableNode $headerTable)
}

$expectedHeaders = $headerTable->getRowsHash();
/*
* Prepare the array for the format expected by assertArrayContains
*/
foreach($expectedHeaders as $key=>$value){
if(!is_array($value)){
$data = array($value);
$expectedHeaders[$key] = $data;
}
}
$this->getAsserter()->assertArrayContains(
$expectedHeaders,
$this->response->getHeaders()
$this->response->getHeaders()->toArray()
);
}

Expand Down