php - How can I assert two possible values for a key in an array using Phpunit? -


this question has answer here:

$array = [a => '1',  b => '2'] 

for example, want check if either 1 or 3. thought using work.

$this->assertthat(     $this->assertcontains('1',$array),     $this->logicalor(         $this->assertcontains('3',$array) )); 

pass assertions arguments logicalor

$this->assertthat($array, $this->logicalor(     $this->assertcontains('3',$array),     $this->assertcontains('1',$array) )); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -