mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Added test for SiteTree::get_by_url() in TranslatableTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84576 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e7e0e9424d
commit
26ff1f9264
@ -792,6 +792,25 @@ class TranslatableTest extends FunctionalTest {
|
||||
$adminUser->logOut();
|
||||
Translatable::set_current_locale($origLocale);
|
||||
}
|
||||
|
||||
public function testSiteTreeGetByUrlFindsTranslationWithoutLocale() {
|
||||
$parent = $this->objFromFixture('Page', 'parent');
|
||||
|
||||
$parentTranslation = $parent->createTranslation('en_AU');
|
||||
$parentTranslation->URLSegment = 'parent-en-AU';
|
||||
$parentTranslation->write();
|
||||
|
||||
$match = Sitetree::get_by_url($parentTranslation->URLSegment);
|
||||
$this->assertNotNull(
|
||||
$match,
|
||||
'SiteTree::get_by_url() doesnt need a locale setting to find translated pages'
|
||||
);
|
||||
$this->assertEquals(
|
||||
$parentTranslation->ID,
|
||||
$match->ID,
|
||||
'SiteTree::get_by_url() doesnt need a locale setting to find translated pages'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TranslatableTest_DataObject extends DataObject implements TestOnly {
|
||||
|
Loading…
x
Reference in New Issue
Block a user