protected function assertArrayHasObjectWithValue($expected, $array, $key)
{
$found = false;
foreach ($array as $value) {
if ($value->{$key} === $expected) {
$found = true;
}
}
$this->assertTrue($found, sprintf("Array did not have an object whose property %s had value %s", $key, $expected));
}