$value) { if ($value == $needle) { unset($array[$key]); return; } } } /** * Checks if all expected annotations and only these are set * * @param string[] $expectedAnnotations * @param ezcReflectionAnnotation[] $annotations * @param ezcTestCase $test */ static public function expectedAnnotations($expectedAnnotations, $annotations, $test) { foreach ($annotations as $annotation) { $test->assertInstanceOf('ezcReflectionAnnotation', $annotation); $test->assertContains($annotation->getName(), $expectedAnnotations); self::deleteFromArray($annotation->getName(), $expectedAnnotations); } $test->assertEquals(0, count($expectedAnnotations)); } /** * Checks if all expected parameters and only these are set * * @param string[] $expectedAnnotations * @param ezcReflectionAnnotation[] $annotations * @param ezcTestCase $test */ static public function expectedParams($expectedParams, $params, $test) { foreach ($params as $param) { $test->assertInstanceOf('ezcReflectionParameter', $param); $test->assertContains($param->getName(), $expectedParams); self::deleteFromArray($param->getName(), $expectedParams); } $test->assertEquals(0, count($expectedParams)); } } ?>