Issue #3131474 by jungle, mondrake: Replace assertions involving calls to array_search() with assertContains()/assertNotContains() (cherry picked from commit 6cf25ba2)