From faf6e67456e6c2c4289ad4939371e51b2e58068e Mon Sep 17 00:00:00 2001 From: qadan Date: Wed, 22 Jan 2014 18:36:20 +0000 Subject: [PATCH] general array_diff_key messiness --- tests/islandora_web_test_case.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/islandora_web_test_case.inc b/tests/islandora_web_test_case.inc index b77e5b12..d417ff37 100644 --- a/tests/islandora_web_test_case.inc +++ b/tests/islandora_web_test_case.inc @@ -190,14 +190,14 @@ class IslandoraWebTestCase extends DrupalWebTestCase { $this->fail("Failed. Object passed in is invalid.", 'Islandora'); } else { - $missing_datastreams = array_diff($datastreams, array_keys($this->admin->repository->api->a->listDatastreams($object->id))); + $missing_datastreams = array_diff_key(array_flip($datastreams), $this->admin->repository->api->a->listDatastreams($object->id)); if (!empty($missing_datastreams)) { - $this->fail("Failed to find datastreams " . implode(', ', $missing_datastreams) . " in object {$object->id}."); + $this->fail("Failed to find datastream(s) " . implode(', ', array_flip($missing_datastreams)) . " in object {$object->id}."); return FALSE; } - $this->pass("Found all required datastreams in object {$object->id}"); + $this->pass("Found required datastream(s) in object {$object->id}"); return TRUE; } }