Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
MNT Fix broken unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jan 26, 2023
1 parent 759c49e commit 4eebc22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/php/Extension/FluentExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function testLocalisedMixSorting()

// Sort by the NonLocalisedSort field first then the LocalisedField second both in ascending order
// so the result will be opposite if the order of the columns is not maintained
$objects=MixedLocalisedSortObject::get()->sort(
$objects=MixedLocalisedSortObject::get()->orderBy(
'"FluentExtensionTest_MixedLocalisedSortObject"."LocalizedSort", '.
'"FluentExtensionTest_MixedLocalisedSortObject"."NonLocalizedSort", '.
'"FluentExtensionTest_MixedLocalisedSortObject"."Title"'
Expand Down Expand Up @@ -294,7 +294,7 @@ public function testLocalisedFieldsCanBeSorted($locale, array $sortArgs, $expect
FluentState::singleton()->withState(function (FluentState $newState) use ($locale, $sortArgs, $expected) {
$newState->setLocale($locale);

$records = LocalisedParent::get()->sort(...$sortArgs);
$records = LocalisedParent::get()->orderBy(...$sortArgs);
$titles = $records->column('Title');
$this->assertEquals($expected, $titles);
});
Expand Down
7 changes: 4 additions & 3 deletions tests/php/Extension/FluentSiteTreeExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Page;
use SilverStripe\CMS\Forms\SiteTreeURLSegmentField;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\SapphireTest;
Expand Down Expand Up @@ -74,8 +75,8 @@ public function testGetLocaleInformation()
$this->assertEquals('English (New Zealand)', $result->getTitle());
$this->assertEquals('English', $result->getLanguageNative());
$this->assertEquals('en', $result->getLanguage());
$this->assertEquals('/newzealand/a-page/', $result->getLink());
$this->assertEquals('http://mocked/newzealand/a-page/', $result->getAbsoluteLink());
$this->assertEquals(Controller::normaliseTrailingSlash('/newzealand/a-page/'), $result->getLink());
$this->assertEquals(Controller::normaliseTrailingSlash('http://mocked/newzealand/a-page/'), $result->getAbsoluteLink());
$this->assertEquals('link', $result->getLinkingMode());
$this->assertEquals('newzealand', $result->getURLSegment());
});
Expand Down Expand Up @@ -179,7 +180,7 @@ function (FluentState $newState) use ($domain, $locale, $prefixDisabled, $pageNa

/** @var Page|FluentSiteTreeExtension $page */
$page = $this->objFromFixture(Page::class, $pageName);
$this->assertEquals($url, $page->Link());
$this->assertEquals(Controller::normaliseTrailingSlash($url), $page->Link());
}
);
}
Expand Down

0 comments on commit 4eebc22

Please sign in to comment.