Skip to content

Instantly share code, notes, and snippets.

@DCzajkowski
Created January 4, 2017 22:29
Show Gist options
  • Save DCzajkowski/855859a40c11590f2073eca52b039e13 to your computer and use it in GitHub Desktop.
Save DCzajkowski/855859a40c11590f2073eca52b039e13 to your computer and use it in GitHub Desktop.
Foreach in a test. Ugh :/
<?php
/*
$response->headers->all() = [
'test' => ['test-value'],
'Content-Type' => ['application/json'],
];
*/
$found = false;
foreach ($response->headers->all() as $key => $value) {
if ($key === 'test' && $value[0] === 'test-value') {
$found = true;
}
}
$this->assertTrue($found);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment