test if array contains value using PHPUnit March 10, 2023 by Tarik Try the assertContains method: $this->assertContains( $randad, $adUnitArr );