M
M
My joy2017-09-05 22:32:40
PHPUnit
My joy, 2017-09-05 22:32:40

How to check with equalsTo with any array element?

Good evening comrade friends.
There is a code:

$mock
            ->expects($this->once())
            ->method('orderBy')
            ->with(
                  $this->equalTo('string1')
             )
            ->willReturn($mock);

How do I rewrite `$this->equalTo('string1')` to check if it's any string in the array ['string1', 'string2', 'string3'] ?
those. the test is successful if the argument is equal to string1 or string2 or string3 .

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question