diff --git a/tests/php/Controllers/CMSBatchActionsTest.php b/tests/php/Controllers/CMSBatchActionsTest.php index 9a079b8073..3ec33d5681 100644 --- a/tests/php/Controllers/CMSBatchActionsTest.php +++ b/tests/php/Controllers/CMSBatchActionsTest.php @@ -26,7 +26,7 @@ protected function setUp(): void $this->logInWithPermission('ADMIN'); // Tests assume strict hierarchy is enabled - Config::inst()->update(SiteTree::class, 'enforce_strict_hierarchy', true); + Config::inst()->set(SiteTree::class, 'enforce_strict_hierarchy', true); // published page $published = $this->objFromFixture(SiteTree::class, 'published'); diff --git a/tests/php/Model/RedirectorPageTest.php b/tests/php/Model/RedirectorPageTest.php index b49998c86c..fa007731f6 100644 --- a/tests/php/Model/RedirectorPageTest.php +++ b/tests/php/Model/RedirectorPageTest.php @@ -33,7 +33,7 @@ protected function setUp(): void $file->publishSingle(); } - Director::config()->update('alternate_base_url', 'http://www.mysite.com/'); + Director::config()->set('alternate_base_url', 'http://www.mysite.com/'); // Ensure all pages are published /** @var Page $page */ diff --git a/tests/php/Model/SiteTreeTest.php b/tests/php/Model/SiteTreeTest.php index 86880f7cc5..4d4762011a 100644 --- a/tests/php/Model/SiteTreeTest.php +++ b/tests/php/Model/SiteTreeTest.php @@ -430,7 +430,7 @@ public function testRestoreToStage() public function testNoCascadingDeleteWithoutID() { - Config::inst()->update('SiteTree', 'enforce_strict_hierarchy', true); + Config::inst()->set('SiteTree', 'enforce_strict_hierarchy', true); $count = SiteTree::get()->count(); $this->assertNotEmpty($count); $obj = new SiteTree(); @@ -1253,27 +1253,27 @@ public function testAllowedChildrenValidation() $classCext->write(); $classB->ParentID = $page->ID; - $valid = $classB->doValidate(); + $valid = $classB->validate(); $this->assertTrue($valid->isValid(), "Does allow children on unrestricted parent"); $classB->ParentID = $classA->ID; - $valid = $classB->doValidate(); + $valid = $classB->validate(); $this->assertTrue($valid->isValid(), "Does allow child specifically allowed by parent"); $classC->ParentID = $classA->ID; - $valid = $classC->doValidate(); + $valid = $classC->validate(); $this->assertFalse($valid->isValid(), "Doesnt allow child on parents specifically restricting children"); $classB->ParentID = $classC->ID; - $valid = $classB->doValidate(); + $valid = $classB->validate(); $this->assertFalse($valid->isValid(), "Doesnt allow child on parents disallowing all children"); $classB->ParentID = $classCext->ID; - $valid = $classB->doValidate(); + $valid = $classB->validate(); $this->assertTrue($valid->isValid(), "Extensions of allowed classes are incorrectly reported as invalid"); $classCext->ParentID = $classD->ID; - $valid = $classCext->doValidate(); + $valid = $classCext->validate(); $this->assertFalse($valid->isValid(), "Doesnt allow child where only parent class is allowed on parent node, and asterisk prefixing is used"); } @@ -1655,7 +1655,7 @@ public function testGetControllerName() */ public function testGetControllerNameFromConfig() { - Config::inst()->update(Page::class, 'controller_name', 'This\\Is\\A\\New\\Controller'); + Config::inst()->set(Page::class, 'controller_name', 'This\\Is\\A\\New\\Controller'); $class = new Page; $this->assertSame('This\\Is\\A\\New\\Controller', $class->getControllerName()); } @@ -1665,7 +1665,7 @@ public function testGetControllerNameFromConfig() */ public function testGetControllerNameFromNamespaceMappingConfig() { - Config::inst()->update(SiteTree::class, 'namespace_mapping', [ + Config::inst()->merge(SiteTree::class, 'namespace_mapping', [ 'SilverStripe\\CMS\\Tests\\Page' => 'SilverStripe\\CMS\\Tests\\Controllers', ]); diff --git a/tests/php/Model/VirtualPageTest.php b/tests/php/Model/VirtualPageTest.php index b4ee7ba550..39086e310c 100644 --- a/tests/php/Model/VirtualPageTest.php +++ b/tests/php/Model/VirtualPageTest.php @@ -412,11 +412,11 @@ public function testAllowedChildrenLimitedOnVirtualPages() $classCVirtual->write(); $classBVirtual->ParentID = $classA->ID; - $valid = $classBVirtual->doValidate(); + $valid = $classBVirtual->validate(); $this->assertTrue($valid->isValid(), "Does allow child linked to virtual page type allowed by parent"); $classCVirtual->ParentID = $classA->ID; - $valid = $classCVirtual->doValidate(); + $valid = $classCVirtual->validate(); $this->assertFalse($valid->isValid(), "Doesn't allow child linked to virtual page type disallowed by parent"); } diff --git a/tests/php/Tasks/MigrateSiteTreeLinkingTaskTest.php b/tests/php/Tasks/MigrateSiteTreeLinkingTaskTest.php index 12f92ccdc7..2b3fdc75fe 100644 --- a/tests/php/Tasks/MigrateSiteTreeLinkingTaskTest.php +++ b/tests/php/Tasks/MigrateSiteTreeLinkingTaskTest.php @@ -12,8 +12,6 @@ class MigrateSiteTreeLinkingTaskTest extends SapphireTest { protected static $fixture_file = 'MigrateSiteTreeLinkingTaskTest.yml'; - protected static $use_draft_site = true; - public static function setUpBeforeClass(): void { parent::setUpBeforeClass();