$array = [a => '1',
b => '2']
例如,我想检查a是1还是3。我认为使用它会起作用。
$this->assertThat(
$this->assertContains('1',$array),
$this->logicalOr(
$this->assertContains('3',$array)
));
答案 0 :(得分:1)
将您的断言作为参数传递给logicalOr
$this->assertThat($array, $this->logicalOr(
$this->assertContains('3',$array),
$this->assertContains('1',$array)
));