Initial Drupal 11 with DDEV setup

This commit is contained in:
gluebox
2025-10-08 11:39:17 -04:00
commit 89ef74b305
25344 changed files with 2599172 additions and 0 deletions

View File

@ -0,0 +1,187 @@
<?php
namespace Robo\Task\Testing;
use Robo\Contract\CommandInterface;
use Robo\Contract\PrintedInterface;
use Robo\Task\BaseTask;
use Robo\Common\ExecOneCommand;
/**
* Runs [atoum](http://atoum.org/) tests
*
* ``` php
* <?php
* $this->taskAtoum()
* ->files('path/to/test.php')
* ->configFile('config/dev.php')
* ->run()
*
* ?>
* ```
*/
class Atoum extends BaseTask implements CommandInterface, PrintedInterface
{
use ExecOneCommand;
/**
* @var string
*/
protected $command;
/**
* Atoum constructor.
*
* @param null|string $pathToAtoum
*
* @throws \Robo\Exception\TaskException
*/
public function __construct($pathToAtoum = null)
{
$this->command = $pathToAtoum;
if (!$this->command) {
$this->command = $this->findExecutable('atoum');
}
if (!$this->command) {
throw new \Robo\Exception\TaskException(__CLASS__, "Neither local atoum nor global composer installation not found");
}
}
/**
* Tag or Tags to filter.
*
* @param string|string[] $tags
*
* @return $this
*/
public function tags($tags)
{
return $this->addMultipleOption('tags', $tags);
}
/**
* Display result using the light reporter.
*
* @return $this
*/
public function lightReport()
{
$this->option("--use-light-report");
return $this;
}
/**
* Display result using the tap reporter.
*
* @return $this
*/
public function tap()
{
$this->option("use-tap-report");
return $this;
}
/**
* Path to the bootstrap file.
* @param string $file
*
* @return $this
*/
public function bootstrap($file)
{
$this->option("bootstrap", $file);
return $this;
}
/**
* Path to the config file.
*
* @param string $file
*
* @return $this
*/
public function configFile($file)
{
$this->option('-c', $file);
return $this;
}
/**
* Use atoum's debug mode.
*
* @return $this
*/
public function debug()
{
$this->option("debug");
return $this;
}
/**
* Test file or test files to run.
*
* @param string|string[]
*
* @return $this
*/
public function files($files)
{
return $this->addMultipleOption('f', $files);
}
/**
* Test directory or directories to run.
*
* @param string|string[]
* A single directory or a list of directories.
*
* @return $this
*/
public function directories($directories)
{
return $this->addMultipleOption('directories', $directories);
}
/**
* @param string $option
* @param string|string[] $values
*
* @return $this
*/
protected function addMultipleOption($option, $values)
{
if (is_string($values)) {
$values = [$values];
}
foreach ($values as $value) {
$this->option($option, $value);
}
return $this;
}
/**
* {@inheritdoc}
*/
public function getCommand()
{
return $this->command . $this->arguments;
}
/**
* {@inheritdoc}
*/
public function run()
{
$this->printTaskInfo('Running atoum ' . $this->arguments);
return $this->executeCommand($this->getCommand());
}
}

View File

@ -0,0 +1,162 @@
<?php
namespace Robo\Task\Testing;
use Robo\Contract\CommandInterface;
use Robo\Contract\PrintedInterface;
use Robo\Task\BaseTask;
use Robo\Common\ExecOneCommand;
/**
* Executes Behat tests
*
* ``` php
* <?php
* $this->taskBehat()
* ->format('pretty')
* ->noInteraction()
* ->run();
* ?>
* ```
*
*/
class Behat extends BaseTask implements CommandInterface, PrintedInterface
{
use ExecOneCommand;
/**
* @var string
*/
protected $command;
/**
* @var string[] $formaters available formaters for format option
*/
protected $formaters = ['progress', 'pretty', 'junit'];
/**
* @var string[] $verbose_levels available verbose levels
*/
protected $verbose_levels = ['v', 'vv'];
/**
* Behat constructor.
*
* @param null|string $pathToBehat
*
* @throws \Robo\Exception\TaskException
*/
public function __construct($pathToBehat = null)
{
$this->command = $pathToBehat;
if (!$this->command) {
$this->command = $this->findExecutable('behat');
}
if (!$this->command) {
throw new \Robo\Exception\TaskException(__CLASS__, "Neither composer nor phar installation of Behat found");
}
}
/**
* @return $this
*/
public function stopOnFail()
{
$this->option('stop-on-failure');
return $this;
}
/**
* @return $this
*/
public function noInteraction()
{
$this->option('no-interaction');
return $this;
}
/**
* @param string $config_file
*
* @return $this
*/
public function config($config_file)
{
$this->option('config', $config_file);
return $this;
}
/**
* @return $this
*/
public function colors()
{
$this->option('colors');
return $this;
}
/**
* @return $this
*/
public function noColors()
{
$this->option('no-colors');
return $this;
}
/**
* @param string $suite
*
* @return $this
*/
public function suite($suite)
{
$this->option('suite', $suite);
return $this;
}
/**
* @param string $level
*
* @return $this
*/
public function verbose($level = 'v')
{
if (!in_array($level, $this->verbose_levels)) {
throw new \InvalidArgumentException('expected ' . implode(',', $this->verbose_levels));
}
$this->option('-' . $level);
return $this;
}
/**
* @param string $formater
*
* @return $this
*/
public function format($formater)
{
if (!in_array($formater, $this->formaters)) {
throw new \InvalidArgumentException('expected ' . implode(',', $this->formaters));
}
$this->option('format', $formater);
return $this;
}
/**
* {@inheritdoc}
*/
public function getCommand()
{
return $this->command . $this->arguments;
}
/**
* {@inheritdoc}
*/
public function run()
{
$this->printTaskInfo('Running behat {arguments}', ['arguments' => $this->arguments]);
return $this->executeCommand($this->getCommand());
}
}

View File

@ -0,0 +1,287 @@
<?php
namespace Robo\Task\Testing;
use Robo\Contract\PrintedInterface;
use Robo\Exception\TaskException;
use Robo\Task\BaseTask;
use Robo\Contract\CommandInterface;
use Robo\Common\ExecOneCommand;
/**
* Executes Codeception tests
*
* ``` php
* <?php
* // config
* $this->taskCodecept()
* ->suite('acceptance')
* ->env('chrome')
* ->group('admin')
* ->xml()
* ->html()
* ->run();
*
* ?>
* ```
*
*/
class Codecept extends BaseTask implements CommandInterface, PrintedInterface
{
use ExecOneCommand;
/**
* @var string
*/
protected $command;
protected $providedPathToCodeception;
/**
* @param string $pathToCodeception
*
* @throws \Robo\Exception\TaskException
*/
public function __construct($pathToCodeception = '')
{
$this->providedPathToCodeception = $pathToCodeception;
}
/**
* @param string $suite
*
* @return $this
*/
public function suite($suite)
{
$this->option(null, $suite);
return $this;
}
/**
* @param string $testName
*
* @return $this
*/
public function test($testName)
{
$this->option(null, $testName);
return $this;
}
/**
* set group option. Can be called multiple times
*
* @param string $group
*
* @return $this
*/
public function group($group)
{
$this->option("group", $group);
return $this;
}
/**
* @param string $group
*
* @return $this
*/
public function excludeGroup($group)
{
$this->option("skip-group", $group);
return $this;
}
/**
* generate json report
*
* @param string $file
*
* @return $this
*/
public function json($file = null)
{
$this->option("json", $file);
return $this;
}
/**
* generate xml JUnit report
*
* @param string $file
*
* @return $this
*/
public function xml($file = null)
{
$this->option("xml", $file);
return $this;
}
/**
* Generate html report
*
* @param string $dir
*
* @return $this
*/
public function html($dir = null)
{
$this->option("html", $dir);
return $this;
}
/**
* generate tap report
*
* @param string $file
*
* @return $this
*/
public function tap($file = null)
{
$this->option("tap", $file);
return $this;
}
/**
* provides config file other then default `codeception.yml` with `-c` option
*
* @param string $file
*
* @return $this
*/
public function configFile($file)
{
$this->option("-c", $file);
return $this;
}
/**
* collect codecoverage in raw format. You may pass name of cov file to save results
*
* @param null|string $cov
*
* @return $this
*/
public function coverage($cov = null)
{
$this->option("coverage", $cov);
return $this;
}
/**
* execute in silent mode
*
* @return $this
*/
public function silent()
{
$this->option("silent");
return $this;
}
/**
* collect code coverage in xml format. You may pass name of xml file to save results
*
* @param string $xml
*
* @return $this
*/
public function coverageXml($xml = null)
{
$this->option("coverage-xml", $xml);
return $this;
}
/**
* collect code coverage and generate html report. You may pass
*
* @param string $html
*
* @return $this
*/
public function coverageHtml($html = null)
{
$this->option("coverage-html", $html);
return $this;
}
/**
* @param string $env
*
* @return $this
*/
public function env($env)
{
$this->option("env", $env);
return $this;
}
/**
* @return $this
*/
public function debug()
{
$this->option("debug");
return $this;
}
/**
* @return $this
*/
public function noRebuild()
{
$this->option("no-rebuild");
return $this;
}
/**
* @return $this
*/
public function noExit()
{
$this->option("no-exit");
return $this;
}
/**
* @param string $failGroup
* @return $this
*/
public function failGroup($failGroup)
{
$this->option('override', "extensions: config: Codeception\\Extension\\RunFailed: fail-group: {$failGroup}");
return $this;
}
/**
* {@inheritdoc}
*/
public function getCommand()
{
if (!$this->command) {
$this->command = $this->providedPathToCodeception;
if (!$this->command) {
$this->command = $this->findExecutable('codecept');
}
if (!$this->command) {
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
throw new TaskException(__CLASS__, "Neither composer nor phar installation of Codeception found.");
}
$this->command .= ' run';
}
return $this->command . $this->arguments;
}
/**
* {@inheritdoc}
*/
public function run()
{
$command = $this->getCommand();
$this->printTaskInfo('Executing {command}', ['command' => $command]);
return $this->executeCommand($command);
}
}

View File

@ -0,0 +1,210 @@
<?php
namespace Robo\Task\Testing;
use Robo\Contract\CommandInterface;
use Robo\Contract\PrintedInterface;
use Robo\Task\BaseTask;
use Robo\Common\ExecOneCommand;
/**
* Runs PHPUnit tests
*
* ``` php
* <?php
* $this->taskPHPUnit()
* ->group('core')
* ->bootstrap('test/bootstrap.php')
* ->run()
*
* ?>
* ```
*/
class PHPUnit extends BaseTask implements CommandInterface, PrintedInterface
{
use ExecOneCommand;
/**
* @var string
*/
protected $command;
/**
* Directory of test files or single test file to run. Appended to
* the command and arguments.
*
* @var string
*/
protected $files = '';
/**
* PHPUnit constructor.
*
* @param null|string $pathToPhpUnit
*
* @throws \Robo\Exception\TaskException
*/
public function __construct($pathToPhpUnit = null)
{
$this->command = $pathToPhpUnit;
if (!$this->command) {
$this->command = $this->findExecutablePhar('phpunit');
}
if (!$this->command) {
throw new \Robo\Exception\TaskException(__CLASS__, "Neither local phpunit nor global composer installation not found");
}
}
/**
* @param string $filter
*
* @return $this
*/
public function filter($filter)
{
$this->option('filter', $filter);
return $this;
}
/**
* @param string $group
*
* @return $this
*/
public function group($group)
{
$this->option("group", $group);
return $this;
}
/**
* @param string $group
*
* @return $this
*/
public function excludeGroup($group)
{
$this->option("exclude-group", $group);
return $this;
}
/**
* adds `log-json` option to runner
*
* @param string $file
*
* @return $this
*/
public function json($file = null)
{
$this->option("log-json", $file);
return $this;
}
/**
* adds `log-junit` option
*
* @param string $file
*
* @return $this
*/
public function xml($file = null)
{
$this->option("log-junit", $file);
return $this;
}
/**
* @param string $file
*
* @return $this
*/
public function tap($file = "")
{
$this->option("log-tap", $file);
return $this;
}
/**
* @param string $file
*
* @return $this
*/
public function bootstrap($file)
{
$this->option("bootstrap", $file);
return $this;
}
/**
* @param string $file
*
* @return $this
*/
public function configFile($file)
{
$this->option('-c', $file);
return $this;
}
/**
* @return $this
*/
public function debug()
{
$this->option("debug");
return $this;
}
/**
* Directory of test files or single test file to run.
*
* @param string $files
* A single test file or a directory containing test files.
*
* @return $this
*
* @throws \Robo\Exception\TaskException
*
* @deprecated Use file() or dir() method instead
*/
public function files($files)
{
if (!empty($this->files) || is_array($files)) {
throw new \Robo\Exception\TaskException(__CLASS__, "Only one file or directory may be provided.");
}
$this->files = ' ' . $files;
return $this;
}
/**
* Test the provided file.
*
* @param string $file
* Path to file to test.
*
* @return $this
*/
public function file($file)
{
return $this->files($file);
}
/**
* {@inheritdoc}
*/
public function getCommand()
{
return $this->command . $this->arguments . $this->files;
}
/**
* {@inheritdoc}
*/
public function run()
{
$this->printTaskInfo('Running PHPUnit {arguments}', ['arguments' => $this->arguments]);
return $this->executeCommand($this->getCommand());
}
}

View File

@ -0,0 +1,154 @@
<?php
namespace Robo\Task\Testing;
use Robo\Contract\PrintedInterface;
use Robo\Task\BaseTask;
use Robo\Contract\CommandInterface;
use Robo\Common\ExecOneCommand;
/**
* Executes Phpspec tests
*
* ``` php
* <?php
* $this->taskPhpspec()
* ->format('pretty')
* ->noInteraction()
* ->run();
* ?>
* ```
*
*/
class Phpspec extends BaseTask implements CommandInterface, PrintedInterface
{
use ExecOneCommand;
/**
* @var string
*/
protected $command;
/**
* @var string[] $formaters
* Available formaters for format option.
*/
protected $formaters = ['progress', 'html', 'pretty', 'junit', 'dot', 'tap'];
/**
* @var array $verbose_levels
* Available verbose levels.
*/
protected $verbose_levels = ['v', 'vv', 'vvv'];
/**
* Phpspec constructor.
*
* @param null|string $pathToPhpspec
*
* @throws \Robo\Exception\TaskException
*/
public function __construct($pathToPhpspec = null)
{
$this->command = $pathToPhpspec;
if (!$this->command) {
$this->command = $this->findExecutable('phpspec');
}
if (!$this->command) {
throw new \Robo\Exception\TaskException(__CLASS__, "Neither composer nor phar installation of Phpspec found");
}
$this->arg('run');
}
public function stopOnFail()
{
$this->option('stop-on-failure');
return $this;
}
public function noCodeGeneration()
{
$this->option('no-code-generation');
return $this;
}
public function quiet()
{
$this->option('quiet');
return $this;
}
/**
* @param string $level
*
* @return $this
*/
public function verbose($level = 'v')
{
if (!in_array($level, $this->verbose_levels)) {
throw new \InvalidArgumentException('expected ' . implode(',', $this->verbose_levels));
}
$this->option('-' . $level);
return $this;
}
/**
* @return $this
*/
public function noAnsi()
{
$this->option('no-ansi');
return $this;
}
/**
* @return $this
*/
public function noInteraction()
{
$this->option('no-interaction');
return $this;
}
/**
* @param string $config_file
*
* @return $this
*/
public function config($config_file)
{
$this->option('config', $config_file);
return $this;
}
/**
* @param string $formater
*
* @return $this
*/
public function format($formater)
{
if (!in_array($formater, $this->formaters)) {
throw new \InvalidArgumentException('expected ' . implode(',', $this->formaters));
}
$this->option('format', $formater);
return $this;
}
/**
* {@inheritdoc}
*/
public function getCommand()
{
return $this->command . $this->arguments;
}
/**
* {@inheritdoc}
*/
public function run()
{
$this->printTaskInfo('Running phpspec {arguments}', ['arguments' => $this->arguments]);
return $this->executeCommand($this->getCommand());
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace Robo\Task\Testing;
trait Tasks
{
/**
* @param null|string $pathToCodeception
*
* @return \Robo\Task\Testing\Codecept|\Robo\Collection\CollectionBuilder
*/
protected function taskCodecept($pathToCodeception = null)
{
return $this->task(Codecept::class, $pathToCodeception);
}
/**
* @param null|string $pathToPhpUnit
*
* @return \Robo\Task\Testing\PHPUnit|\Robo\Collection\CollectionBuilder
*/
protected function taskPhpUnit($pathToPhpUnit = null)
{
return $this->task(PHPUnit::class, $pathToPhpUnit);
}
/**
* @param null|string $pathToPhpspec
*
* @return \Robo\Task\Testing\Phpspec|\Robo\Collection\CollectionBuilder
*/
protected function taskPhpspec($pathToPhpspec = null)
{
return $this->task(Phpspec::class, $pathToPhpspec);
}
/**
* @param null|string $pathToAtoum
*
* @return \Robo\Task\Testing\Atoum|\Robo\Collection\CollectionBuilder
*/
protected function taskAtoum($pathToAtoum = null)
{
return $this->task(Atoum::class, $pathToAtoum);
}
/**
* @param null|string $pathToBehat
*
* @return \Robo\Task\Testing\Behat|\Robo\Collection\CollectionBuilder
*/
protected function taskBehat($pathToBehat = null)
{
return $this->task(Behat::class, $pathToBehat);
}
}