Lemon\RestBundle\Tests\Controller\ResourceControllerTest::assertArrayHasObjectWithValue PHP Method

assertArrayHasObjectWithValue() protected method

protected assertArrayHasObjectWithValue ( $expected, $array, $key )
    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));
    }