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
This commit is contained in:
Sam Minnee 2010-03-31 05:09:36 +00:00
parent 9ae7fe67a5
commit 65c711cfea
3 changed files with 6 additions and 7 deletions

View File

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

View File

@ -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');
}

View File

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