From 85a712e1c9288a398de03e374a8a3bb980486d82 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 5 Jun 2018 11:34:27 +1200 Subject: [PATCH] Fix postgres test --- tests/model/DataObjectDuplicationTest.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/model/DataObjectDuplicationTest.php b/tests/model/DataObjectDuplicationTest.php index 2fcab1c4d..d058fafbb 100644 --- a/tests/model/DataObjectDuplicationTest.php +++ b/tests/model/DataObjectDuplicationTest.php @@ -111,13 +111,21 @@ class DataObjectDuplicationTest extends SapphireTest { "Match between relation of copy and the original"); $this->assertEquals(0, $oneCopy->twos()->Count(), "Many-to-one relation not copied (has_many)"); - $this->assertEquals($three->ID, $oneCopy->threes()->First()->ID, - "Match between relation of copy and the original"); - $this->assertEquals($one->ID, $threeCopy->ones()->First()->ID, - "Match between relation of copy and the original"); - - $this->assertEquals('three', $oneCopy->threes()->First()->TestExtra, - "Match between extra field of copy and the original"); + $this->assertContains( + $three->ID, + $oneCopy->threes()->column('ID'), + "Match between relation of copy and the original" + ); + $this->assertContains( + $one->ID, + $threeCopy->ones()->column('ID'), + "Match between relation of copy and the original" + ); + $this->assertContains( + 'three', + $oneCopy->threes()->column('TestExtra'), + "Match between extra field of copy and the original" + ); } }