diff --git a/tests/DMSDocumentTest.php b/tests/DMSDocumentTest.php index 7da8b2c..289d34b 100644 --- a/tests/DMSDocumentTest.php +++ b/tests/DMSDocumentTest.php @@ -26,12 +26,12 @@ class DMSDocumentTest extends SapphireTest { $pages = $d1->Pages(); $pagesArray = $pages->toArray(); - $this->assertEquals($pagesArray[0], $s1, "Page 1 associated correctly"); - $this->assertEquals($pagesArray[1], $s2, "Page 2 associated correctly"); - $this->assertEquals($pagesArray[2], $s3, "Page 3 associated correctly"); - $this->assertEquals($pagesArray[3], $s4, "Page 4 associated correctly"); - $this->assertEquals($pagesArray[4], $s5, "Page 5 associated correctly"); - $this->assertEquals($pagesArray[5], $s6, "Page 6 associated correctly"); + $this->assertEquals($pagesArray[0]->ID, $s1->ID, "Page 1 associated correctly"); + $this->assertEquals($pagesArray[1]->ID, $s2->ID, "Page 2 associated correctly"); + $this->assertEquals($pagesArray[2]->ID, $s3->ID, "Page 3 associated correctly"); + $this->assertEquals($pagesArray[3]->ID, $s4->ID, "Page 4 associated correctly"); + $this->assertEquals($pagesArray[4]->ID, $s5->ID, "Page 5 associated correctly"); + $this->assertEquals($pagesArray[5]->ID, $s6->ID, "Page 6 associated correctly"); } function testAddPageRelation() { @@ -50,15 +50,15 @@ class DMSDocumentTest extends SapphireTest { $pages = $doc->Pages(); $pagesArray = $pages->toArray(); - $this->assertEquals($pagesArray[0], $s1, "Page 1 associated correctly"); - $this->assertEquals($pagesArray[1], $s2, "Page 2 associated correctly"); - $this->assertEquals($pagesArray[2], $s3, "Page 3 associated correctly"); + $this->assertEquals($pagesArray[0]->ID, $s1->ID, "Page 1 associated correctly"); + $this->assertEquals($pagesArray[1]->ID, $s2->ID, "Page 2 associated correctly"); + $this->assertEquals($pagesArray[2]->ID, $s3->ID, "Page 3 associated correctly"); $doc->removePage($s1); $pages = $doc->Pages(); $pagesArray = $pages->toArray(); //page 1 is missing - $this->assertEquals($pagesArray[0], $s2, "Page 2 still associated correctly"); - $this->assertEquals($pagesArray[1], $s3, "Page 3 still associated correctly"); + $this->assertEquals($pagesArray[0]->ID, $s2->ID, "Page 2 still associated correctly"); + $this->assertEquals($pagesArray[1]->ID, $s3->ID, "Page 3 still associated correctly"); $documents = $s2->Documents(); $documentsArray = $documents->toArray();