comparison core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 7a779792577d
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
173 $actual = $row->getSource(); 173 $actual = $row->getSource();
174 174
175 foreach ($expected as $key => $value) { 175 foreach ($expected as $key => $value) {
176 $this->assertArrayHasKey($key, $actual); 176 $this->assertArrayHasKey($key, $actual);
177 177
178 $msg = sprintf("Value at 'array[%s][%s]' is not correct.", $i - 1, $key);
178 if (is_array($value)) { 179 if (is_array($value)) {
179 ksort($value); 180 ksort($value);
180 ksort($actual[$key]); 181 ksort($actual[$key]);
181 $this->assertEquals($value, $actual[$key]); 182 $this->assertEquals($value, $actual[$key], $msg);
182 } 183 }
183 else { 184 else {
184 $this->assertSame((string) $value, (string) $actual[$key]); 185 $this->assertEquals((string) $value, (string) $actual[$key], $msg);
185 } 186 }
186 } 187 }
187 } 188 }
188 // False positives occur if the foreach is not entered. So, confirm the 189 // False positives occur if the foreach is not entered. So, confirm the
189 // foreach loop was entered if the expected count is greater than 0. 190 // foreach loop was entered if the expected count is greater than 0.