mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
FIXED: Odd crash with error "Invalid CRT parameters detected" in test cases. Replaced with equivalent non-crashing code.
This commit is contained in:
parent
a3b3ec8c4e
commit
ba62557aac
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user