Merge branch '4' into 5

This commit is contained in:
Sabina Talipova 2022-11-21 15:51:08 +13:00
commit aa27715a11
2 changed files with 7 additions and 5 deletions

View File

@ -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 = <<<JS
let input = jQuery('[name="$field"]');

View File

@ -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;
}