From c699d38ff532ca973b54de8d837faa2d2db03813 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Fri, 26 Jul 2024 03:01:36 -0600 Subject: [PATCH] Improve reliability of tests --- .../tests/classes/AutoDatasourceTest.php | 2 +- .../system/tests/classes/ImageResizerTest.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) rename modules/{system => cms}/tests/classes/AutoDatasourceTest.php (99%) diff --git a/modules/system/tests/classes/AutoDatasourceTest.php b/modules/cms/tests/classes/AutoDatasourceTest.php similarity index 99% rename from modules/system/tests/classes/AutoDatasourceTest.php rename to modules/cms/tests/classes/AutoDatasourceTest.php index d3550ee691..b481c2afc9 100644 --- a/modules/system/tests/classes/AutoDatasourceTest.php +++ b/modules/cms/tests/classes/AutoDatasourceTest.php @@ -1,6 +1,6 @@ markTestSkipped('The CMS module is not active.'); + } + // Resize with default options $imageResizer = new ImageResizer( (new CmsController())->themeUrl('assets/images/winter.png'), @@ -178,6 +182,10 @@ public function testConfiguration() */ public function testURLSources() { + if (!in_array('Cms', Config::get('cms.loadModules', []))) { + $this->markTestSkipped('The CMS module is not active.'); + } + // Theme URL (absolute URL) $this->setUpStorage(); $this->copyMedia(); @@ -352,6 +360,10 @@ public function testSpaceInFilename() public function testGetResizedUrl() { + if (!in_array('Cms', Config::get('cms.loadModules', []))) { + $this->markTestSkipped('The CMS module is not active.'); + } + $imageResizer = new ImageResizer((new CmsController())->themeUrl('assets/images/winter.png')); Config::set('cms.linkPolicy', 'force'); @@ -365,6 +377,10 @@ public function testGetResizedUrl() public function testGetResizerUrl() { + if (!in_array('Cms', Config::get('cms.loadModules', []))) { + $this->markTestSkipped('The CMS module is not active.'); + } + $imageResizer = new ImageResizer((new CmsController())->themeUrl('assets/images/winter.png')); Config::set('cms.linkPolicy', 'force');