BUG ID comparisons in test assertions

More solid than object comparisons, which was broken
by introduction of the "DocumentSort" flag,
which doesn't seem to be consistently added to the
object value map.
This commit is contained in:
Ingo Schommer 2012-08-27 13:29:30 +02:00
parent 76f307c01e
commit 75d9e06d7f

View File

@ -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();