From cca72df7fa035e7c064c3ace27a8982d0d1af9af Mon Sep 17 00:00:00 2001 From: Eduardo Humberto Date: Tue, 23 Oct 2018 18:31:40 -0300 Subject: [PATCH] tainacan csv importer - improve csv multiple test --- tests/test-importer.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test-importer.php b/tests/test-importer.php index 8dd31f7ca..c13bcfb0a 100644 --- a/tests/test-importer.php +++ b/tests/test-importer.php @@ -385,11 +385,10 @@ class ImporterTests extends TAINACAN_UnitTestCase { foreach ( $items as $index => $item ) { $singleItemMetadata = new Entities\Item_Metadata_Entity( $item, $metadata_taxonomy ); + $term = $singleItemMetadata->get_value(); - if( in_array( $item->get_title(),[ 'Data 11','Data 51', 'Data 12','Data 52'] ) ){ - - $term = $singleItemMetadata->get_value(); - $this->assertTrue(in_array( $term->get_name(),['DATA 151','DATA551'] )); + if( in_array( $item->get_title(),[ 'Data 11','Data 51', 'Data 12','Data 52'] ) && $term ){ + $this->assertTrue(in_array( strtoupper($term->get_name()),['DATA 151','DATA551'] )); } }