test if array contains value using PHPUnit

后端 未结 1 729
走了就别回头了
走了就别回头了 2021-02-04 23:16

I created this array of objects:

$ad_1 = new AdUnit(array(\'id\' => \'1\', \'name\' => \'Ad_1\', \'description\' => \'great ad\', \'code\' => \'alpha         


        
1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 00:05

    Try the assertContains method:

    $this->assertContains( $randad, $adUnitArr );
    

    0 讨论(0)
提交回复
热议问题