From 6a0185d477f711e93b4e5157179cbe303dff0e3b Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 18 Oct 2022 14:49:04 +1300 Subject: [PATCH 1/3] ENH Update deprecation messages --- src/Context/BasicContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Context/BasicContext.php b/src/Context/BasicContext.php index dab5810..c7bdd0b 100644 --- a/src/Context/BasicContext.php +++ b/src/Context/BasicContext.php @@ -624,7 +624,7 @@ JS; * @param string $path * @return Call\Given * - * @deprecated 4.5..5.0 - use iAttachTheFileToTheField() instead + * @deprecated 4.5..5.0 Use iAttachTheFileToTheField() instead */ public function iAttachTheFileTo($field, $path) { From 5c6b9756fbe206cc4962d2c37a700e876435b965 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 18 Oct 2022 14:49:22 +1300 Subject: [PATCH 2/3] API Update deprecations --- src/Context/BasicContext.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Context/BasicContext.php b/src/Context/BasicContext.php index c7bdd0b..49335a8 100644 --- a/src/Context/BasicContext.php +++ b/src/Context/BasicContext.php @@ -2,6 +2,7 @@ namespace SilverStripe\BehatExtension\Context; +use SilverStripe\Dev\Deprecation; use Exception; use InvalidArgumentException; use Behat\Behat\Context\Context; @@ -624,10 +625,11 @@ JS; * @param string $path * @return Call\Given * - * @deprecated 4.5..5.0 Use iAttachTheFileToTheField() instead + * @deprecated 4.5.0 Use iAttachTheFileToTheField() instead */ public function iAttachTheFileTo($field, $path) { + Deprecation::notice('4.5.0', 'Use iAttachTheFileToTheField() instead'); // Remove wrapped button styling to make input field accessible to Selenium $js = << Date: Thu, 3 Nov 2022 14:13:44 +1300 Subject: [PATCH 3/3] API Stop using deprecated API --- src/Controllers/ModuleInitialisationController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Controllers/ModuleInitialisationController.php b/src/Controllers/ModuleInitialisationController.php index 15609bb..d4e9b89 100644 --- a/src/Controllers/ModuleInitialisationController.php +++ b/src/Controllers/ModuleInitialisationController.php @@ -138,7 +138,7 @@ class ModuleInitialisationController implements Controller { // Create feature_path $features = $this->container->getParameter('silverstripe_extension.context.features_path'); - $fullPath = $module->getResourcePath($features); + $fullPath = $module->getResource($features)->getPath(); if (is_dir($fullPath ?? '')) { return; } @@ -164,7 +164,7 @@ class ModuleInitialisationController implements Controller protected function initClassPath(OutputInterface $output, Module $module, $namespaceRoot) { $classesPath = $this->container->getParameter('silverstripe_extension.context.class_path'); - $dirPath = $module->getResourcePath($classesPath); + $dirPath = $module->getResource($classesPath)->getPath(); if (!is_dir($dirPath ?? '')) { mkdir($dirPath ?? '', 0777, true); } @@ -193,7 +193,7 @@ class ModuleInitialisationController implements Controller ); // Add to composer json - $composerFile = $module->getResourcePath('composer.json'); + $composerFile = $module->getResource('composer.json')->getPath(); if (!file_exists($composerFile ?? '')) { return; } @@ -251,7 +251,7 @@ class ModuleInitialisationController implements Controller */ protected function initConfig($output, $module, $namespaceRoot) { - $configPath = $module->getResourcePath('behat.yml'); + $configPath = $module->getResource('behat.yml')->getPath(); if (file_exists($configPath ?? '')) { return; }