From 65c711cfea7c7036d64e861ba4f4b253ec461910 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 31 Mar 2010 05:09:36 +0000 Subject: [PATCH] MINOR: Fix tests to cope with ID type cleanup changed recently git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101970 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/api/RestfulServerTest.php | 8 ++++---- tests/model/TranslatableTest.php | 3 +-- tests/search/TranslatableSearchFormTest.php | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/api/RestfulServerTest.php b/tests/api/RestfulServerTest.php index a568890d1..baa8b4453 100644 --- a/tests/api/RestfulServerTest.php +++ b/tests/api/RestfulServerTest.php @@ -106,8 +106,8 @@ class RestfulServerTest extends SapphireTest { $ratingsArr = $responseArr['Ratings']['RestfulServerTest_AuthorRating']; $this->assertEquals(count($ratingsArr), 2); $ratingIDs = array( - $ratingsArr[0]['@attributes']['id'], - $ratingsArr[1]['@attributes']['id'] + (int)$ratingsArr[0]['@attributes']['id'], + (int)$ratingsArr[1]['@attributes']['id'] ); $this->assertContains($rating1->ID, $ratingIDs); $this->assertContains($rating2->ID, $ratingIDs); @@ -127,8 +127,8 @@ class RestfulServerTest extends SapphireTest { $this->assertEquals(count($authorsArr), 2); $ratingIDs = array( - $authorsArr[0]['ID'], - $authorsArr[1]['ID'] + (int)$authorsArr[0]['ID'], + (int)$authorsArr[1]['ID'] ); $this->assertContains($author2->ID, $ratingIDs); $this->assertContains($author3->ID, $ratingIDs); diff --git a/tests/model/TranslatableTest.php b/tests/model/TranslatableTest.php index d51b2209e..a31f89f26 100755 --- a/tests/model/TranslatableTest.php +++ b/tests/model/TranslatableTest.php @@ -263,8 +263,7 @@ class TranslatableTest extends FunctionalTest { $this->assertEquals($resultPagesCustomLang->Count(), 1); $this->assertNotContains($origTestPage->ID, $resultPagesCustomLang->column('ID')); $this->assertNotContains($otherTestPage->ID, $resultPagesCustomLang->column('ID')); - // casting as a workaround for types not properly set on duplicated dataobjects from createTranslation() - $this->assertContains((string)$translatedPage->ID, $resultPagesCustomLang->column('ID')); + $this->assertContains($translatedPage->ID, $resultPagesCustomLang->column('ID')); Translatable::set_current_locale('en_US'); } diff --git a/tests/search/TranslatableSearchFormTest.php b/tests/search/TranslatableSearchFormTest.php index 7a805191b..8980e14ee 100644 --- a/tests/search/TranslatableSearchFormTest.php +++ b/tests/search/TranslatableSearchFormTest.php @@ -71,7 +71,7 @@ class TranslatableSearchFormTest extends FunctionalTest { 'Published pages in default language are not found when searching in another language' ); $this->assertContains( - (string)$translatedPublishedPage->ID, + $translatedPublishedPage->ID, $results->column('ID'), 'Published pages in another language are found when searching in this language' );