selective-php / test-traits

Test Traits
MIT License
13 stars 2 forks source link

assertTableRow requires a specifiq array order #17

Open jfradj opened 6 months ago

jfradj commented 6 months ago

In trait DatabaseTableTestTrait function protected function assertTableRow() Instead of $this->assertSame I would use $this->assertEqualsCanonicalizing So the array order doesn't matter, preventing this kind of error:

Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
 Array &0 [
+    'first_purchase_time' => '2024-04-27 22:22:41',
     'last_purchase_time' => '2024-04-27 22:22:41',
-    'first_purchase_time' => '2024-04-27 22:22:41',
 ]
odan commented 6 months ago

Can you please create a PR?