phpunit을 사용하여 단위 테스트를 작성하고 있는데 배열에 특정 값이 포함되어 있다고 주장하려고합니다.하지만 찾을 수있는 함수는 assertArrayHasKey()뿐입니다. 어떤 assertArrayHasValue도 없습니다.PHP : 배열에 특정 값이 있다고 주장하는 방법?
$a = [5, 8, 16];
assertArrayHasValue(8, $a);
모든 팁 환영합니다 :
그래서 나는 이런 식으로 뭔가를 원하는 분명합니다! 이 시도
http://ouzo.readthedocs.org/en/latest/documentation/tests.html#array-assertions뿐만 아니라 주장의 목록을 참조하십시오. http://stackoverflow.com/questions/569369/list-of-all-phpunit-assertions –
[PHPUnit을 사용하여 값이 배열에 포함되어 있는지 테스트] 가능한 복제본 (https://stackoverflow.com/questions/31638220/test) -if-array-value-using-phpunit) – Tiger