FIXED: Odd crash with error "Invalid CRT parameters detected" in test cases. Replaced with equivalent non-crashing code.

This commit is contained in:
Damian Mooyman 2012-08-16 16:47:24 +12:00 committed by Ingo Schommer
parent a3b3ec8c4e
commit ba62557aac

View File

@ -260,7 +260,8 @@ class TranslatableTest extends FunctionalTest {
sprintf("\"SiteTree\".\"MenuTitle\" = '%s'", 'A Testpage') sprintf("\"SiteTree\".\"MenuTitle\" = '%s'", 'A Testpage')
); );
$resultPagesDefaultLangIDs = $resultPagesDefaultLang->column('ID'); $resultPagesDefaultLangIDs = $resultPagesDefaultLang->column('ID');
array_walk($resultPagesDefaultLangIDs, 'intval'); foreach($resultPagesDefaultLangIDs as $key => $val)
$resultPagesDefaultLangIDs[$key] = intval($val);
$this->assertEquals($resultPagesDefaultLang->Count(), 2); $this->assertEquals($resultPagesDefaultLang->Count(), 2);
$this->assertContains((int)$origTestPage->ID, $resultPagesDefaultLangIDs); $this->assertContains((int)$origTestPage->ID, $resultPagesDefaultLangIDs);
$this->assertContains((int)$otherTestPage->ID, $resultPagesDefaultLangIDs); $this->assertContains((int)$otherTestPage->ID, $resultPagesDefaultLangIDs);
@ -273,7 +274,8 @@ class TranslatableTest extends FunctionalTest {
sprintf("\"SiteTree\".\"MenuTitle\" = '%s'", 'A Testpage') sprintf("\"SiteTree\".\"MenuTitle\" = '%s'", 'A Testpage')
); );
$resultPagesCustomLangIDs = $resultPagesCustomLang->column('ID'); $resultPagesCustomLangIDs = $resultPagesCustomLang->column('ID');
array_walk($resultPagesCustomLangIDs, 'intval'); foreach($resultPagesCustomLangIDs as $key => $val)
$resultPagesCustomLangIDs[$key] = intval($val);
$this->assertEquals($resultPagesCustomLang->Count(), 1); $this->assertEquals($resultPagesCustomLang->Count(), 1);
$this->assertNotContains((int)$origTestPage->ID, $resultPagesCustomLangIDs); $this->assertNotContains((int)$origTestPage->ID, $resultPagesCustomLangIDs);
$this->assertNotContains((int)$otherTestPage->ID, $resultPagesCustomLangIDs); $this->assertNotContains((int)$otherTestPage->ID, $resultPagesCustomLangIDs);