diff --git a/.vortex/installer/phpcs.xml b/.vortex/installer/phpcs.xml index 6806b8776..2bc036c20 100644 --- a/.vortex/installer/phpcs.xml +++ b/.vortex/installer/phpcs.xml @@ -46,4 +46,10 @@ *.TestCase\.php *.test + + + *.Test\.php + *.TestCase\.php + *.test + diff --git a/.vortex/installer/rector.php b/.vortex/installer/rector.php index 6b2e987b1..bed46ac87 100644 --- a/.vortex/installer/rector.php +++ b/.vortex/installer/rector.php @@ -27,6 +27,7 @@ use Rector\Naming\Rector\ClassMethod\RenameVariableToMatchNewTypeRector; use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector; +use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector; use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; @@ -80,6 +81,7 @@ // Additional rules. ->withRules([ DeclareStrictTypesRector::class, + YieldDataProviderRector::class, ]) ->withFileExtensions([ 'php', diff --git a/.vortex/installer/src/Prompts/Handlers/Tools.php b/.vortex/installer/src/Prompts/Handlers/Tools.php index c1c3e4d41..739f36469 100644 --- a/.vortex/installer/src/Prompts/Handlers/Tools.php +++ b/.vortex/installer/src/Prompts/Handlers/Tools.php @@ -382,6 +382,9 @@ public static function getToolDefinitions(string $filter = 'all'): array { 'ahoy test-functional', 'ahoy test -- --filter=TestClassName', ], + 'rector.php' => [ + 'YieldDataProviderRector', + ], ], 'ahoy' => [ '/^.*phpunit.*\n?/m', diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/rector.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/rector.php index fd931800f..d53dbdfdf 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/rector.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/rector.php @@ -36,6 +36,7 @@ use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector; use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector; use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; +use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector; use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; @@ -98,6 +99,7 @@ // Additional rules. ->withRules([ DeclareStrictTypesRector::class, + YieldDataProviderRector::class, ]) // Configure Drupal autoloading. ->withAutoloadPaths((function (): array { diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/DatabaseSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/DatabaseSettingsTest.php index eaf054bd7..9efa33e15 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/DatabaseSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/DatabaseSettingsTest.php @@ -30,108 +30,107 @@ public function testDatabases(array $vars, array $expected): void { /** * Data provider for resulting database settings. */ - public static function dataProviderDatabases(): array { - return [ + public static function dataProviderDatabases(): \Iterator { + yield [ + [], [ - [], - [ + 'default' => [ 'default' => [ - 'default' => [ - 'database' => 'drupal', - 'username' => 'drupal', - 'password' => 'drupal', - 'host' => 'localhost', - 'port' => '3306', - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_general_ci', - 'driver' => 'mysql', - 'prefix' => '', - ], + 'database' => 'drupal', + 'username' => 'drupal', + 'password' => 'drupal', + 'host' => 'localhost', + 'port' => '3306', + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_general_ci', + 'driver' => 'mysql', + 'prefix' => '', ], ], ], + ]; + yield [ [ - [ - 'DATABASE_NAME' => 'database_db_name', - 'DATABASE_USERNAME' => 'database_db_user', - 'DATABASE_PASSWORD' => 'database_db_pass', - 'DATABASE_HOST' => 'database_db_host', - 'DATABASE_PORT' => 'database_db_port', - 'DATABASE_CHARSET' => 'database_utf8', - 'DATABASE_COLLATION' => 'database_utf8_unicode_ci', - ], - [ + 'DATABASE_NAME' => 'database_db_name', + 'DATABASE_USERNAME' => 'database_db_user', + 'DATABASE_PASSWORD' => 'database_db_pass', + 'DATABASE_HOST' => 'database_db_host', + 'DATABASE_PORT' => 'database_db_port', + 'DATABASE_CHARSET' => 'database_utf8', + 'DATABASE_COLLATION' => 'database_utf8_unicode_ci', + ], + [ + 'default' => [ 'default' => [ - 'default' => [ - 'database' => 'database_db_name', - 'username' => 'database_db_user', - 'password' => 'database_db_pass', - 'host' => 'database_db_host', - 'port' => 'database_db_port', - 'charset' => 'database_utf8', - 'collation' => 'database_utf8_unicode_ci', - 'driver' => 'mysql', - 'prefix' => '', - ], + 'database' => 'database_db_name', + 'username' => 'database_db_user', + 'password' => 'database_db_pass', + 'host' => 'database_db_host', + 'port' => 'database_db_port', + 'charset' => 'database_utf8', + 'collation' => 'database_utf8_unicode_ci', + 'driver' => 'mysql', + 'prefix' => '', ], ], ], + ]; + yield [ [ - [ - 'MARIADB_DATABASE' => 'mariadb_db_name', - 'MARIADB_USERNAME' => 'mariadb_db_user', - 'MARIADB_PASSWORD' => 'mariadb_db_pass', - 'MARIADB_HOST' => 'mariadb_db_host', - 'MARIADB_PORT' => 'mariadb_db_port', - 'MARIADB_CHARSET' => 'mariadb_latin1', - 'MARIADB_COLLATION' => 'mariadb_latin1_swedish_ci', - ], - [ + 'MARIADB_DATABASE' => 'mariadb_db_name', + 'MARIADB_USERNAME' => 'mariadb_db_user', + 'MARIADB_PASSWORD' => 'mariadb_db_pass', + 'MARIADB_HOST' => 'mariadb_db_host', + 'MARIADB_PORT' => 'mariadb_db_port', + 'MARIADB_CHARSET' => 'mariadb_latin1', + 'MARIADB_COLLATION' => 'mariadb_latin1_swedish_ci', + ], + [ + 'default' => [ 'default' => [ - 'default' => [ - 'database' => 'mariadb_db_name', - 'username' => 'mariadb_db_user', - 'password' => 'mariadb_db_pass', - 'host' => 'mariadb_db_host', - 'port' => 'mariadb_db_port', - 'charset' => 'mariadb_latin1', - 'collation' => 'mariadb_latin1_swedish_ci', - 'driver' => 'mysql', - 'prefix' => '', - ], + 'database' => 'mariadb_db_name', + 'username' => 'mariadb_db_user', + 'password' => 'mariadb_db_pass', + 'host' => 'mariadb_db_host', + 'port' => 'mariadb_db_port', + 'charset' => 'mariadb_latin1', + 'collation' => 'mariadb_latin1_swedish_ci', + 'driver' => 'mysql', + 'prefix' => '', ], ], ], + ]; + yield [ [ - [ - 'DATABASE_DATABASE' => 'database_db_name', - 'DATABASE_USERNAME' => 'database_db_user', - 'DATABASE_PASSWORD' => 'database_db_pass', - 'DATABASE_HOST' => 'database_db_host', - 'DATABASE_PORT' => 'database_db_port', - 'MYSQL_CHARSET' => 'mysql_utf8mb3', - 'MYSQL_COLLATION' => 'mysql_utf8mb3_bin', - ], - [ + 'DATABASE_DATABASE' => 'database_db_name', + 'DATABASE_USERNAME' => 'database_db_user', + 'DATABASE_PASSWORD' => 'database_db_pass', + 'DATABASE_HOST' => 'database_db_host', + 'DATABASE_PORT' => 'database_db_port', + 'MYSQL_CHARSET' => 'mysql_utf8mb3', + 'MYSQL_COLLATION' => 'mysql_utf8mb3_bin', + ], + [ + 'default' => [ 'default' => [ - 'default' => [ - 'database' => 'database_db_name', - 'username' => 'database_db_user', - 'password' => 'database_db_pass', - 'host' => 'database_db_host', - 'port' => 'database_db_port', - 'charset' => 'mysql_utf8mb3', - 'collation' => 'mysql_utf8mb3_bin', - 'driver' => 'mysql', - 'prefix' => '', - ], + 'database' => 'database_db_name', + 'username' => 'database_db_user', + 'password' => 'database_db_pass', + 'host' => 'database_db_host', + 'port' => 'database_db_port', + 'charset' => 'mysql_utf8mb3', + 'collation' => 'mysql_utf8mb3_bin', + 'driver' => 'mysql', + 'prefix' => '', ], ], ], ]; + } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 623549955..c3ab1cfc0 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -38,28 +38,26 @@ public function testEnvironmentTypeDetection(array $vars, string $expected_env): /** * Data provider for testing environment type detection. */ - public static function dataProviderEnvironmentTypeDetection(): array { - return [ - // By default, the default environment type is local. - [[], self::ENVIRONMENT_LOCAL], + public static function dataProviderEnvironmentTypeDetection(): \Iterator { + // By default, the default environment type is local. + yield [[], self::ENVIRONMENT_LOCAL]; - // CI. + // CI. + yield [ [ - [ - 'CI' => 1, - ], - self::ENVIRONMENT_CI, + 'CI' => 1, ], + self::ENVIRONMENT_CI, + ]; - // Container. + // Container. + yield [ [ - [ - 'VORTEX_LOCALDEV_URL' => 'https://example-site.docker.amazee.io', - ], - self::ENVIRONMENT_LOCAL, + 'VORTEX_LOCALDEV_URL' => 'https://example-site.docker.amazee.io', ], - + self::ENVIRONMENT_LOCAL, ]; + } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/SwitchableSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/SwitchableSettingsTest.php index c9c2f7be1..b772d2891 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -93,71 +93,69 @@ public function testConfigSplit(string $env, array $expected_present, array $exp /** * Data provider for testConfigSplit(). */ - public static function dataProviderConfigSplit(): array { - return [ + public static function dataProviderConfigSplit(): \Iterator { + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_LOCAL, - [ - 'config_split.config_split.local' => ['status' => TRUE], - ], - [ - 'config_split.config_split.stage' => NULL, - 'config_split.config_split.dev' => NULL, - 'config_split.config_split.ci' => NULL, - ], + 'config_split.config_split.local' => ['status' => TRUE], ], [ - self::ENVIRONMENT_CI, - [ - 'config_split.config_split.ci' => ['status' => TRUE], - ], - [ - 'config_split.config_split.stage' => NULL, - 'config_split.config_split.dev' => NULL, - 'config_split.config_split.local' => NULL, - ], + 'config_split.config_split.stage' => NULL, + 'config_split.config_split.dev' => NULL, + 'config_split.config_split.ci' => NULL, ], + ]; + yield [ + self::ENVIRONMENT_CI, [ - self::ENVIRONMENT_DEV, - [ - 'config_split.config_split.dev' => ['status' => TRUE], - ], - [ - 'config_split.config_split.stage' => NULL, - 'config_split.config_split.ci' => NULL, - 'config_split.config_split.local' => NULL, - ], + 'config_split.config_split.ci' => ['status' => TRUE], ], [ - self::ENVIRONMENT_STAGE, - [ - 'config_split.config_split.stage' => ['status' => TRUE], - ], - [ - 'config_split.config_split.dev' => NULL, - 'config_split.config_split.ci' => NULL, - 'config_split.config_split.local' => NULL, - ], + 'config_split.config_split.stage' => NULL, + 'config_split.config_split.dev' => NULL, + 'config_split.config_split.local' => NULL, ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_PROD, - [], - [ - 'config_split.config_split.stage' => NULL, - 'config_split.config_split.dev' => NULL, - 'config_split.config_split.ci' => NULL, - 'config_split.config_split.local' => NULL, - ], + 'config_split.config_split.dev' => ['status' => TRUE], ], [ - self::ENVIRONMENT_SUT, - [], - [ - 'config_split.config_split.stage' => NULL, - 'config_split.config_split.dev' => NULL, - 'config_split.config_split.ci' => NULL, - 'config_split.config_split.local' => NULL, - ], + 'config_split.config_split.stage' => NULL, + 'config_split.config_split.ci' => NULL, + 'config_split.config_split.local' => NULL, + ], + ]; + yield [ + self::ENVIRONMENT_STAGE, + [ + 'config_split.config_split.stage' => ['status' => TRUE], + ], + [ + 'config_split.config_split.dev' => NULL, + 'config_split.config_split.ci' => NULL, + 'config_split.config_split.local' => NULL, + ], + ]; + yield [ + self::ENVIRONMENT_PROD, + [], + [ + 'config_split.config_split.stage' => NULL, + 'config_split.config_split.dev' => NULL, + 'config_split.config_split.ci' => NULL, + 'config_split.config_split.local' => NULL, + ], + ]; + yield [ + self::ENVIRONMENT_SUT, + [], + [ + 'config_split.config_split.stage' => NULL, + 'config_split.config_split.dev' => NULL, + 'config_split.config_split.ci' => NULL, + 'config_split.config_split.local' => NULL, ], ]; } @@ -180,49 +178,47 @@ public function testEnvironmentIndicator(string $env, array $expected_present, a /** * Data provider for testEnvironmentIndicator(). */ - public static function dataProviderEnvironmentIndicator(): array { - return [ + public static function dataProviderEnvironmentIndicator(): \Iterator { + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_LOCAL, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_LOCAL, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_LOCAL, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], + ]; + yield [ + self::ENVIRONMENT_CI, [ - self::ENVIRONMENT_CI, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_CI, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_CI, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_DEV, 'bg_color' => '#4caf50', 'fg_color' => '#000000'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_DEV, 'bg_color' => '#4caf50', 'fg_color' => '#000000'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], + ]; + yield [ + self::ENVIRONMENT_STAGE, [ - self::ENVIRONMENT_STAGE, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_STAGE, 'bg_color' => '#fff176', 'fg_color' => '#000000'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_STAGE, 'bg_color' => '#fff176', 'fg_color' => '#000000'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], + ]; + yield [ + self::ENVIRONMENT_PROD, [ - self::ENVIRONMENT_PROD, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_PROD, 'bg_color' => '#ef5350', 'fg_color' => '#000000'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_PROD, 'bg_color' => '#ef5350', 'fg_color' => '#000000'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], + ]; + yield [ + self::ENVIRONMENT_SUT, [ - self::ENVIRONMENT_SUT, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_SUT, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_SUT, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], ]; } @@ -316,358 +312,356 @@ public function testShield(string $env, array $vars, array $expected_present, ar /** * Data provider for testShield(). */ - public static function dataProviderShield(): array { - return [ + public static function dataProviderShield(): \Iterator { + yield [ + self::ENVIRONMENT_LOCAL, + [], [ - self::ENVIRONMENT_LOCAL, - [], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], - [ - 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'shield.settings' => ['shield_enable' => FALSE], ], [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], - [ - 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], ], + ]; + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + ], + [ + 'shield.settings' => ['shield_enable' => FALSE], + ], + [ + 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], ], + ]; + yield [ + self::ENVIRONMENT_LOCAL, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + ], + [ + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_CI, [ - self::ENVIRONMENT_CI, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', ], + [ + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', ], + [ + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_STAGE, [ - self::ENVIRONMENT_STAGE, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + ], + [ + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], ], + ]; + yield [ + self::ENVIRONMENT_PROD, [ - self::ENVIRONMENT_PROD, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', ], + [ + 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + [ + 'shield.settings' => ['shield_enable' => FALSE], + ], + ]; + yield [ + self::ENVIRONMENT_SUT, [ - self::ENVIRONMENT_SUT, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', ], + [ + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => '', - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => '', ], + [ + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => 0, - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => 0, ], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => 1, - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], ], + ]; + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => 1, + ], + [ + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => '0', - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => '0', ], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => '1', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => 'false', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => '1', ], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => 'true', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => 'false', + ], + [ + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => 'true', ], + [ + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], + 'DRUPAL_SHIELD_DISABLED' => TRUE, ], [ - self::ENVIRONMENT_STAGE, - [ - 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], + 'shield.settings' => ['shield_enable' => FALSE], ], + ]; + yield [ + self::ENVIRONMENT_STAGE, [ - self::ENVIRONMENT_PROD, - [ - 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], + 'DRUPAL_SHIELD_DISABLED' => TRUE, + ], + [ + 'shield.settings' => ['shield_enable' => FALSE], + ], + ]; + yield [ + self::ENVIRONMENT_PROD, + [ + 'DRUPAL_SHIELD_DISABLED' => TRUE, ], + [ + 'shield.settings' => ['shield_enable' => FALSE], + ], + ]; - // ACME challenge passthrough tests. + // ACME challenge passthrough tests. + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ - 'shield.settings' => [ - 'shield_enable' => TRUE, - 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - 'method' => 0, - 'paths' => '/.well-known/acme-challenge/*', - ], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, ], [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ - 'shield.settings' => [ - 'shield_enable' => FALSE, - 'method' => 0, - 'paths' => '/.well-known/acme-challenge/*', - ], + 'shield.settings' => [ + 'shield_enable' => TRUE, + 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], + 'method' => 0, + 'paths' => '/.well-known/acme-challenge/*', ], ], - // ACME challenge disabled - verify settings are absent. + ]; + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'shield.settings' => [ - 'shield_enable' => TRUE, - 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], - ], - [ - 'shield.settings' => ['method' => NULL, 'paths' => NULL], - ], + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, ], - // ACME challenge with empty value - should not set. [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => '', - ], - [ - 'shield.settings' => [ - 'shield_enable' => TRUE, - 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], - ], - [ - 'shield.settings' => ['method' => NULL, 'paths' => NULL], + 'shield.settings' => [ + 'shield_enable' => FALSE, + 'method' => 0, + 'paths' => '/.well-known/acme-challenge/*', ], ], - // ACME challenge with 0 value - should not set. + ]; + // ACME challenge disabled - verify settings are absent. + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 0, + 'shield.settings' => [ + 'shield_enable' => TRUE, + 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], ], - [ - 'shield.settings' => [ - 'shield_enable' => TRUE, - 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], + ], + [ + 'shield.settings' => ['method' => NULL, 'paths' => NULL], + ], + ]; + // ACME challenge with empty value - should not set. + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => '', + ], + [ + 'shield.settings' => [ + 'shield_enable' => TRUE, + 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], ], - [ - 'shield.settings' => ['method' => NULL, 'paths' => NULL], + ], + [ + 'shield.settings' => ['method' => NULL, 'paths' => NULL], + ], + ]; + // ACME challenge with 0 value - should not set. + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 0, + ], + [ + 'shield.settings' => [ + 'shield_enable' => TRUE, + 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], ], ], + [ + 'shield.settings' => ['method' => NULL, 'paths' => NULL], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ - 'shield.settings' => [ - 'method' => 0, - 'paths' => "/custom/path/*\n/.well-known/acme-challenge/*", - ], - ], - [], - [ - 'shield.settings' => ['paths' => '/custom/path/*'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, ], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ - 'shield.settings' => [ - 'method' => 0, - 'paths' => "/.well-known/acme-challenge/*\n/other/path/*", - ], - ], - [], - [ - 'shield.settings' => ['paths' => "/.well-known/acme-challenge/*\n/other/path/*"], + 'shield.settings' => [ + 'method' => 0, + 'paths' => "/custom/path/*\n/.well-known/acme-challenge/*", ], ], + [], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ - 'shield.settings' => [ - 'method' => 0, - 'paths' => "/admin/*\n/api/*\n/.well-known/acme-challenge/*", - ], + 'shield.settings' => ['paths' => '/custom/path/*'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, + ], + [ + 'shield.settings' => [ + 'method' => 0, + 'paths' => "/.well-known/acme-challenge/*\n/other/path/*", ], - [], - [ - 'shield.settings' => ['paths' => "/admin/*\n/api/*"], + ], + [], + [ + 'shield.settings' => ['paths' => "/.well-known/acme-challenge/*\n/other/path/*"], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, + ], + [ + 'shield.settings' => [ + 'method' => 0, + 'paths' => "/admin/*\n/api/*\n/.well-known/acme-challenge/*", ], ], + [], + [ + 'shield.settings' => ['paths' => "/admin/*\n/api/*"], + ], ]; } @@ -687,114 +681,112 @@ public function testStageFileProxy(string $env, array $vars, array $expected_pre /** * Data provider for testStageFileProxy(). */ - public static function dataProviderStageFileProxy(): array { - return [ - [ - self::ENVIRONMENT_LOCAL, - [], - [], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], - ], + public static function dataProviderStageFileProxy(): \Iterator { + yield [ + self::ENVIRONMENT_LOCAL, + [], + [], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], ], + ]; + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', ], [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], - [], + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], ], + [], + ]; + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], + ], + [], + ]; + yield [ + self::ENVIRONMENT_LOCAL, + [ + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], ], + [], + ]; + yield [ + self::ENVIRONMENT_CI, [ - self::ENVIRONMENT_CI, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], ], + [], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], ], + [], + ]; + yield [ + self::ENVIRONMENT_STAGE, [ - self::ENVIRONMENT_STAGE, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], + ], + [], + ]; + yield [ + self::ENVIRONMENT_PROD, [ - self::ENVIRONMENT_PROD, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], + [], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], ], + ]; + yield [ + self::ENVIRONMENT_SUT, [ - self::ENVIRONMENT_SUT, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], ], + [], ]; } @@ -813,83 +805,81 @@ public function testTrustedHostPatterns(array $vars, array $expected_patterns): /** * Data provider for testTrustedHostPatterns(). */ - public static function dataProviderTrustedHostPatterns(): array { - return [ - 'empty environment variable' => [ - [], - [ - '^localhost$', - ], + public static function dataProviderTrustedHostPatterns(): \Iterator { + yield 'empty environment variable' => [ + [], + [ + '^localhost$', ], - 'single domain' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'example.com'], - [ - '^localhost$', - '^example\.com$', - ], + ]; + yield 'single domain' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'example.com'], + [ + '^localhost$', + '^example\.com$', ], - 'multiple domains' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'example.com,www.example.com,cdn.example.org'], - [ - '^localhost$', - '^example\.com$', - '^www\.example\.com$', - '^cdn\.example\.org$', - ], + ]; + yield 'multiple domains' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'example.com,www.example.com,cdn.example.org'], + [ + '^localhost$', + '^example\.com$', + '^www\.example\.com$', + '^cdn\.example\.org$', ], - 'whitespace and empty values' => [ - ['DRUPAL_TRUSTED_HOSTS' => ' example.com , , www.example.com '], - [ - '^localhost$', - '^example\.com$', - '^www\.example\.com$', - ], + ]; + yield 'whitespace and empty values' => [ + ['DRUPAL_TRUSTED_HOSTS' => ' example.com , , www.example.com '], + [ + '^localhost$', + '^example\.com$', + '^www\.example\.com$', ], - 'special regex characters' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'sub-domain.example.com,test.example-site.org'], - [ - '^localhost$', - '^sub\-domain\.example\.com$', - '^test\.example\-site\.org$', - ], + ]; + yield 'special regex characters' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'sub-domain.example.com,test.example-site.org'], + [ + '^localhost$', + '^sub\-domain\.example\.com$', + '^test\.example\-site\.org$', ], - 'complex domains' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'api.v2.example.com,cdn-assets.example-site.co.uk'], - [ - '^localhost$', - '^api\.v2\.example\.com$', - '^cdn\-assets\.example\-site\.co\.uk$', - ], + ]; + yield 'complex domains' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'api.v2.example.com,cdn-assets.example-site.co.uk'], + [ + '^localhost$', + '^api\.v2\.example\.com$', + '^cdn\-assets\.example\-site\.co\.uk$', ], - 'duplicates' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'example.com,test.org,example.com,another.com,test.org'], - [ - '^localhost$', - '^example\.com$', - '^test\.org$', - '^example\.com$', - '^another\.com$', - '^test\.org$', - ], + ]; + yield 'duplicates' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'example.com,test.org,example.com,another.com,test.org'], + [ + '^localhost$', + '^example\.com$', + '^test\.org$', + '^example\.com$', + '^another\.com$', + '^test\.org$', ], - 'uppercase hosts' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'EXAMPLE.COM,Test.ORG,www.EXAMPLE-SITE.CO.UK'], - [ - '^localhost$', - '^example\.com$', - '^test\.org$', - '^www\.example\-site\.co\.uk$', - ], + ]; + yield 'uppercase hosts' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'EXAMPLE.COM,Test.ORG,www.EXAMPLE-SITE.CO.UK'], + [ + '^localhost$', + '^example\.com$', + '^test\.org$', + '^www\.example\-site\.co\.uk$', ], - 'explicit localhost' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'localhost,example.com,localhost,test.org'], - [ - '^localhost$', - '^localhost$', - '^example\.com$', - '^localhost$', - '^test\.org$', - ], + ]; + yield 'explicit localhost' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'localhost,example.com,localhost,test.org'], + [ + '^localhost$', + '^localhost$', + '^example\.com$', + '^localhost$', + '^test\.org$', ], ]; } diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php index 426c7c9fb..bf04b4f90 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php @@ -37,11 +37,9 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; } /** @@ -64,12 +62,10 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; } /** @@ -93,12 +89,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/Unit/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/Unit/ExampleTest.php index 3fb0d6cdc..1bbd8c049 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/Unit/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/Unit/ExampleTest.php @@ -37,11 +37,9 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; } /** @@ -64,12 +62,10 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; } /** @@ -93,12 +89,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php index d192a4b8a..854005f85 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [3, 1, 4], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [3, 1, 4]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/Unit/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/Unit/ExampleTest.php index 83158ca98..95b0cd0e8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/Unit/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/Unit/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [2, 1, 3], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [2, 1, 3]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php index 426c7c9fb..bf04b4f90 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php @@ -37,11 +37,9 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; } /** @@ -64,12 +62,10 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; } /** @@ -93,12 +89,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/Unit/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/Unit/ExampleTest.php index 3fb0d6cdc..1bbd8c049 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/Unit/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/Unit/ExampleTest.php @@ -37,11 +37,9 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; } /** @@ -64,12 +62,10 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; } /** @@ -93,12 +89,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php index d192a4b8a..854005f85 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [3, 1, 4], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [3, 1, 4]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/Unit/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/Unit/ExampleTest.php index 83158ca98..95b0cd0e8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/Unit/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/Unit/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [2, 1, 3], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [2, 1, 3]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/rector.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/rector.php index 7a05edc49..574b8e22b 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/rector.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/rector.php @@ -1,4 +1,4 @@ -@@ -44,10 +44,10 @@ +@@ -45,10 +45,10 @@ return RectorConfig::configure() ->withPaths([ @@ -13,7 +13,7 @@ __DIR__ . '/tests', ]) ->withSkip([ -@@ -72,7 +72,7 @@ +@@ -73,7 +73,7 @@ RenameVariableToMatchNewTypeRector::class, SimplifyEmptyCheckOnEmptyArrayRector::class, StringClassNameToClassConstantRector::class => [ diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d45f2d491..459480580 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,55 +1,55 @@ -@@ -59,6 +59,50 @@ - self::ENVIRONMENT_LOCAL, - ], +@@ -58,6 +58,50 @@ + self::ENVIRONMENT_LOCAL, + ]; -+ // Acquia. ++ // Acquia. ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => TRUE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'AH_SITE_ENVIRONMENT' => TRUE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'prod', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'AH_SITE_ENVIRONMENT' => 'prod', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'stage', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'AH_SITE_ENVIRONMENT' => 'stage', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'test', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'AH_SITE_ENVIRONMENT' => 'test', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'dev', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'AH_SITE_ENVIRONMENT' => 'dev', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'ode1', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'AH_SITE_ENVIRONMENT' => 'ode1', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'nonode1', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'AH_SITE_ENVIRONMENT' => 'nonode1', + ], ++ self::ENVIRONMENT_DEV, ++ ]; + - ]; } -@@ -325,6 +369,283 @@ + /** +@@ -323,6 +367,283 @@ $settings['skip_permissions_hardening'] = TRUE; $settings['config_sync_directory'] = '../config/default'; $settings['suspend_mail_send'] = TRUE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index e90ccf1e2..0c6aab903 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,191 +1,191 @@ -@@ -59,6 +59,186 @@ - self::ENVIRONMENT_LOCAL, - ], +@@ -58,6 +58,186 @@ + self::ENVIRONMENT_LOCAL, + ]; -+ // Lagoon. ++ // Lagoon. ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, + ], ++ self::ENVIRONMENT_DEV, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'master', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'master', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'master', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'master', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'release', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'release', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'release/__VERSION__', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'release/__VERSION__', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'hotfix', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'hotfix', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'hotfix/__VERSION__', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'hotfix/__VERSION__', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'somebranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'somebranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'somebranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'somebranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => '', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => '', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'mainbranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'mainbranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], - ]; ++ self::ENVIRONMENT_DEV, ++ ]; } -@@ -327,6 +507,224 @@ + /** +@@ -325,6 +505,224 @@ $settings['suspend_mail_send'] = TRUE; $settings['trusted_host_patterns'] = [ '^localhost$', diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php index 426c7c9fb..bf04b4f90 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php @@ -37,11 +37,9 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; } /** @@ -64,12 +62,10 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; } /** @@ -93,12 +89,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/Unit/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/Unit/ExampleTest.php index 3fb0d6cdc..1bbd8c049 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/Unit/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/Unit/ExampleTest.php @@ -37,11 +37,9 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; } /** @@ -64,12 +62,10 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; } /** @@ -93,12 +89,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php index d192a4b8a..854005f85 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [3, 1, 4], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [3, 1, 4]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/Unit/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/Unit/ExampleTest.php index 83158ca98..95b0cd0e8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/Unit/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/Unit/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [2, 1, 3], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [2, 1, 3]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/rector.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/rector.php index 7a05edc49..574b8e22b 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/rector.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/rector.php @@ -1,4 +1,4 @@ -@@ -44,10 +44,10 @@ +@@ -45,10 +45,10 @@ return RectorConfig::configure() ->withPaths([ @@ -13,7 +13,7 @@ __DIR__ . '/tests', ]) ->withSkip([ -@@ -72,7 +72,7 @@ +@@ -73,7 +73,7 @@ RenameVariableToMatchNewTypeRector::class, SimplifyEmptyCheckOnEmptyArrayRector::class, StringClassNameToClassConstantRector::class => [ diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d45f2d491..459480580 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,55 +1,55 @@ -@@ -59,6 +59,50 @@ - self::ENVIRONMENT_LOCAL, - ], +@@ -58,6 +58,50 @@ + self::ENVIRONMENT_LOCAL, + ]; -+ // Acquia. ++ // Acquia. ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => TRUE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'AH_SITE_ENVIRONMENT' => TRUE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'prod', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'AH_SITE_ENVIRONMENT' => 'prod', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'stage', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'AH_SITE_ENVIRONMENT' => 'stage', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'test', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'AH_SITE_ENVIRONMENT' => 'test', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'dev', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'AH_SITE_ENVIRONMENT' => 'dev', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'ode1', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'AH_SITE_ENVIRONMENT' => 'ode1', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'AH_SITE_ENVIRONMENT' => 'nonode1', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'AH_SITE_ENVIRONMENT' => 'nonode1', + ], ++ self::ENVIRONMENT_DEV, ++ ]; + - ]; } -@@ -325,6 +369,283 @@ + /** +@@ -323,6 +367,283 @@ $settings['skip_permissions_hardening'] = TRUE; $settings['config_sync_directory'] = '../config/default'; $settings['suspend_mail_send'] = TRUE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index e90ccf1e2..0c6aab903 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,191 +1,191 @@ -@@ -59,6 +59,186 @@ - self::ENVIRONMENT_LOCAL, - ], +@@ -58,6 +58,186 @@ + self::ENVIRONMENT_LOCAL, + ]; -+ // Lagoon. ++ // Lagoon. ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, + ], ++ self::ENVIRONMENT_DEV, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'master', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'master', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'master', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'master', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'release', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'release', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'release/__VERSION__', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'release/__VERSION__', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'hotfix', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'hotfix', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'hotfix/__VERSION__', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'hotfix/__VERSION__', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'somebranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'somebranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'somebranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'somebranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => '', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => '', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'mainbranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'mainbranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], - ]; ++ self::ENVIRONMENT_DEV, ++ ]; } -@@ -327,6 +507,224 @@ + /** +@@ -325,6 +505,224 @@ $settings['suspend_mail_send'] = TRUE; $settings['trusted_host_patterns'] = [ '^localhost$', diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index e90ccf1e2..0c6aab903 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,191 +1,191 @@ -@@ -59,6 +59,186 @@ - self::ENVIRONMENT_LOCAL, - ], +@@ -58,6 +58,186 @@ + self::ENVIRONMENT_LOCAL, + ]; -+ // Lagoon. ++ // Lagoon. ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, + ], ++ self::ENVIRONMENT_DEV, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'master', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'master', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'master', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'master', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'release', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'release', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'release/__VERSION__', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'release/__VERSION__', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'hotfix', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'hotfix', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'hotfix/__VERSION__', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'hotfix/__VERSION__', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'somebranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'somebranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'somebranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'somebranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => '', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => '', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'mainbranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'mainbranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], - ]; ++ self::ENVIRONMENT_DEV, ++ ]; } -@@ -327,6 +507,224 @@ + /** +@@ -325,6 +505,224 @@ $settings['suspend_mail_send'] = TRUE; $settings['trusted_host_patterns'] = [ '^localhost$', diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/tests/phpunit/Drupal/DatabaseSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/tests/phpunit/Drupal/DatabaseSettingsTest.php index 741324047..956cd535d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/tests/phpunit/Drupal/DatabaseSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/tests/phpunit/Drupal/DatabaseSettingsTest.php @@ -1,107 +1,110 @@ -@@ -48,6 +48,17 @@ - 'prefix' => '', - ], +@@ -47,6 +47,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -75,6 +86,17 @@ - 'prefix' => '', - ], +@@ -74,6 +85,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -102,6 +124,17 @@ - 'prefix' => '', - ], +@@ -101,6 +123,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -127,6 +160,52 @@ - 'collation' => 'mysql_utf8mb3_bin', - 'driver' => 'mysql', - 'prefix' => '', -+ ], -+ ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], +@@ -128,9 +161,55 @@ + 'prefix' => '', + ], + ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], + ], + ], + ]; + ++ yield [ ++ [ ++ 'DATABASE2_NAME' => 'migrate_db_name', ++ 'DATABASE2_USERNAME' => 'migrate_db_user', ++ 'DATABASE2_PASSWORD' => 'migrate_db_pass', ++ 'DATABASE2_HOST' => 'migrate_db_host', ++ 'DATABASE2_PORT' => '3307', + ], + [ -+ [ -+ 'DATABASE2_NAME' => 'migrate_db_name', -+ 'DATABASE2_USERNAME' => 'migrate_db_user', -+ 'DATABASE2_PASSWORD' => 'migrate_db_pass', -+ 'DATABASE2_HOST' => 'migrate_db_host', -+ 'DATABASE2_PORT' => '3307', ++ 'default' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '3306', ++ 'charset' => 'utf8mb4', ++ 'collation' => 'utf8mb4_general_ci', ++ 'driver' => 'mysql', ++ 'prefix' => '', ++ ], + ], -+ [ ++ 'migrate' => [ + 'default' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '3306', -+ 'charset' => 'utf8mb4', -+ 'collation' => 'utf8mb4_general_ci', -+ 'driver' => 'mysql', -+ 'prefix' => '', -+ ], ++ 'database' => 'migrate_db_name', ++ 'username' => 'migrate_db_user', ++ 'password' => 'migrate_db_pass', ++ 'host' => 'migrate_db_host', ++ 'port' => '3307', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'migrate_db_name', -+ 'username' => 'migrate_db_user', -+ 'password' => 'migrate_db_pass', -+ 'host' => 'migrate_db_host', -+ 'port' => '3307', -+ 'prefix' => '', -+ 'driver' => 'mysql', - ], - ], - ], ++ ], ++ ], ++ ]; + } + + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 5e6730bb3..0849e0c14 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -143,6 +143,13 @@ +@@ -141,6 +141,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/tests/phpunit/Drupal/DatabaseSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/tests/phpunit/Drupal/DatabaseSettingsTest.php index 741324047..956cd535d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/tests/phpunit/Drupal/DatabaseSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/tests/phpunit/Drupal/DatabaseSettingsTest.php @@ -1,107 +1,110 @@ -@@ -48,6 +48,17 @@ - 'prefix' => '', - ], +@@ -47,6 +47,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -75,6 +86,17 @@ - 'prefix' => '', - ], +@@ -74,6 +85,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -102,6 +124,17 @@ - 'prefix' => '', - ], +@@ -101,6 +123,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -127,6 +160,52 @@ - 'collation' => 'mysql_utf8mb3_bin', - 'driver' => 'mysql', - 'prefix' => '', -+ ], -+ ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], +@@ -128,9 +161,55 @@ + 'prefix' => '', + ], + ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], + ], + ], + ]; + ++ yield [ ++ [ ++ 'DATABASE2_NAME' => 'migrate_db_name', ++ 'DATABASE2_USERNAME' => 'migrate_db_user', ++ 'DATABASE2_PASSWORD' => 'migrate_db_pass', ++ 'DATABASE2_HOST' => 'migrate_db_host', ++ 'DATABASE2_PORT' => '3307', + ], + [ -+ [ -+ 'DATABASE2_NAME' => 'migrate_db_name', -+ 'DATABASE2_USERNAME' => 'migrate_db_user', -+ 'DATABASE2_PASSWORD' => 'migrate_db_pass', -+ 'DATABASE2_HOST' => 'migrate_db_host', -+ 'DATABASE2_PORT' => '3307', ++ 'default' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '3306', ++ 'charset' => 'utf8mb4', ++ 'collation' => 'utf8mb4_general_ci', ++ 'driver' => 'mysql', ++ 'prefix' => '', ++ ], + ], -+ [ ++ 'migrate' => [ + 'default' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '3306', -+ 'charset' => 'utf8mb4', -+ 'collation' => 'utf8mb4_general_ci', -+ 'driver' => 'mysql', -+ 'prefix' => '', -+ ], ++ 'database' => 'migrate_db_name', ++ 'username' => 'migrate_db_user', ++ 'password' => 'migrate_db_pass', ++ 'host' => 'migrate_db_host', ++ 'port' => '3307', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'migrate_db_name', -+ 'username' => 'migrate_db_user', -+ 'password' => 'migrate_db_pass', -+ 'host' => 'migrate_db_host', -+ 'port' => '3307', -+ 'prefix' => '', -+ 'driver' => 'mysql', - ], - ], - ], ++ ], ++ ], ++ ]; + } + + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 5e6730bb3..0849e0c14 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -143,6 +143,13 @@ +@@ -141,6 +141,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/tests/phpunit/Drupal/DatabaseSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/tests/phpunit/Drupal/DatabaseSettingsTest.php index 741324047..956cd535d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/tests/phpunit/Drupal/DatabaseSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/tests/phpunit/Drupal/DatabaseSettingsTest.php @@ -1,107 +1,110 @@ -@@ -48,6 +48,17 @@ - 'prefix' => '', - ], +@@ -47,6 +47,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -75,6 +86,17 @@ - 'prefix' => '', - ], +@@ -74,6 +85,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -102,6 +124,17 @@ - 'prefix' => '', - ], +@@ -101,6 +123,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -127,6 +160,52 @@ - 'collation' => 'mysql_utf8mb3_bin', - 'driver' => 'mysql', - 'prefix' => '', -+ ], -+ ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], +@@ -128,9 +161,55 @@ + 'prefix' => '', + ], + ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], + ], + ], + ]; + ++ yield [ ++ [ ++ 'DATABASE2_NAME' => 'migrate_db_name', ++ 'DATABASE2_USERNAME' => 'migrate_db_user', ++ 'DATABASE2_PASSWORD' => 'migrate_db_pass', ++ 'DATABASE2_HOST' => 'migrate_db_host', ++ 'DATABASE2_PORT' => '3307', + ], + [ -+ [ -+ 'DATABASE2_NAME' => 'migrate_db_name', -+ 'DATABASE2_USERNAME' => 'migrate_db_user', -+ 'DATABASE2_PASSWORD' => 'migrate_db_pass', -+ 'DATABASE2_HOST' => 'migrate_db_host', -+ 'DATABASE2_PORT' => '3307', ++ 'default' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '3306', ++ 'charset' => 'utf8mb4', ++ 'collation' => 'utf8mb4_general_ci', ++ 'driver' => 'mysql', ++ 'prefix' => '', ++ ], + ], -+ [ ++ 'migrate' => [ + 'default' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '3306', -+ 'charset' => 'utf8mb4', -+ 'collation' => 'utf8mb4_general_ci', -+ 'driver' => 'mysql', -+ 'prefix' => '', -+ ], ++ 'database' => 'migrate_db_name', ++ 'username' => 'migrate_db_user', ++ 'password' => 'migrate_db_pass', ++ 'host' => 'migrate_db_host', ++ 'port' => '3307', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'migrate_db_name', -+ 'username' => 'migrate_db_user', -+ 'password' => 'migrate_db_pass', -+ 'host' => 'migrate_db_host', -+ 'port' => '3307', -+ 'prefix' => '', -+ 'driver' => 'mysql', - ], - ], - ], ++ ], ++ ], ++ ]; + } + + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 5e6730bb3..0849e0c14 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -143,6 +143,13 @@ +@@ -141,6 +141,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/tests/phpunit/Drupal/DatabaseSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/tests/phpunit/Drupal/DatabaseSettingsTest.php index 741324047..956cd535d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/tests/phpunit/Drupal/DatabaseSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/tests/phpunit/Drupal/DatabaseSettingsTest.php @@ -1,107 +1,110 @@ -@@ -48,6 +48,17 @@ - 'prefix' => '', - ], +@@ -47,6 +47,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -75,6 +86,17 @@ - 'prefix' => '', - ], +@@ -74,6 +85,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -102,6 +124,17 @@ - 'prefix' => '', - ], +@@ -101,6 +123,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -127,6 +160,52 @@ - 'collation' => 'mysql_utf8mb3_bin', - 'driver' => 'mysql', - 'prefix' => '', -+ ], -+ ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], +@@ -128,9 +161,55 @@ + 'prefix' => '', + ], + ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], + ], + ], + ]; + ++ yield [ ++ [ ++ 'DATABASE2_NAME' => 'migrate_db_name', ++ 'DATABASE2_USERNAME' => 'migrate_db_user', ++ 'DATABASE2_PASSWORD' => 'migrate_db_pass', ++ 'DATABASE2_HOST' => 'migrate_db_host', ++ 'DATABASE2_PORT' => '3307', + ], + [ -+ [ -+ 'DATABASE2_NAME' => 'migrate_db_name', -+ 'DATABASE2_USERNAME' => 'migrate_db_user', -+ 'DATABASE2_PASSWORD' => 'migrate_db_pass', -+ 'DATABASE2_HOST' => 'migrate_db_host', -+ 'DATABASE2_PORT' => '3307', ++ 'default' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '3306', ++ 'charset' => 'utf8mb4', ++ 'collation' => 'utf8mb4_general_ci', ++ 'driver' => 'mysql', ++ 'prefix' => '', ++ ], + ], -+ [ ++ 'migrate' => [ + 'default' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '3306', -+ 'charset' => 'utf8mb4', -+ 'collation' => 'utf8mb4_general_ci', -+ 'driver' => 'mysql', -+ 'prefix' => '', -+ ], ++ 'database' => 'migrate_db_name', ++ 'username' => 'migrate_db_user', ++ 'password' => 'migrate_db_pass', ++ 'host' => 'migrate_db_host', ++ 'port' => '3307', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'migrate_db_name', -+ 'username' => 'migrate_db_user', -+ 'password' => 'migrate_db_pass', -+ 'host' => 'migrate_db_host', -+ 'port' => '3307', -+ 'prefix' => '', -+ 'driver' => 'mysql', - ], - ], - ], ++ ], ++ ], ++ ]; + } + + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 5e6730bb3..0849e0c14 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -143,6 +143,13 @@ +@@ -141,6 +141,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/tests/phpunit/Drupal/DatabaseSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/tests/phpunit/Drupal/DatabaseSettingsTest.php index 741324047..956cd535d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/tests/phpunit/Drupal/DatabaseSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/tests/phpunit/Drupal/DatabaseSettingsTest.php @@ -1,107 +1,110 @@ -@@ -48,6 +48,17 @@ - 'prefix' => '', - ], +@@ -47,6 +47,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -75,6 +86,17 @@ - 'prefix' => '', - ], +@@ -74,6 +85,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -102,6 +124,17 @@ - 'prefix' => '', - ], +@@ -101,6 +123,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -127,6 +160,52 @@ - 'collation' => 'mysql_utf8mb3_bin', - 'driver' => 'mysql', - 'prefix' => '', -+ ], -+ ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], +@@ -128,9 +161,55 @@ + 'prefix' => '', + ], + ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], + ], + ], + ]; + ++ yield [ ++ [ ++ 'DATABASE2_NAME' => 'migrate_db_name', ++ 'DATABASE2_USERNAME' => 'migrate_db_user', ++ 'DATABASE2_PASSWORD' => 'migrate_db_pass', ++ 'DATABASE2_HOST' => 'migrate_db_host', ++ 'DATABASE2_PORT' => '3307', + ], + [ -+ [ -+ 'DATABASE2_NAME' => 'migrate_db_name', -+ 'DATABASE2_USERNAME' => 'migrate_db_user', -+ 'DATABASE2_PASSWORD' => 'migrate_db_pass', -+ 'DATABASE2_HOST' => 'migrate_db_host', -+ 'DATABASE2_PORT' => '3307', ++ 'default' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '3306', ++ 'charset' => 'utf8mb4', ++ 'collation' => 'utf8mb4_general_ci', ++ 'driver' => 'mysql', ++ 'prefix' => '', ++ ], + ], -+ [ ++ 'migrate' => [ + 'default' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '3306', -+ 'charset' => 'utf8mb4', -+ 'collation' => 'utf8mb4_general_ci', -+ 'driver' => 'mysql', -+ 'prefix' => '', -+ ], ++ 'database' => 'migrate_db_name', ++ 'username' => 'migrate_db_user', ++ 'password' => 'migrate_db_pass', ++ 'host' => 'migrate_db_host', ++ 'port' => '3307', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'migrate_db_name', -+ 'username' => 'migrate_db_user', -+ 'password' => 'migrate_db_pass', -+ 'host' => 'migrate_db_host', -+ 'port' => '3307', -+ 'prefix' => '', -+ 'driver' => 'mysql', - ], - ], - ], ++ ], ++ ], ++ ]; + } + + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 5e6730bb3..0849e0c14 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -143,6 +143,13 @@ +@@ -141,6 +141,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/DatabaseSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/DatabaseSettingsTest.php index 741324047..956cd535d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/DatabaseSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/DatabaseSettingsTest.php @@ -1,107 +1,110 @@ -@@ -48,6 +48,17 @@ - 'prefix' => '', - ], +@@ -47,6 +47,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -75,6 +86,17 @@ - 'prefix' => '', - ], +@@ -74,6 +85,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -102,6 +124,17 @@ - 'prefix' => '', - ], +@@ -101,6 +123,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -127,6 +160,52 @@ - 'collation' => 'mysql_utf8mb3_bin', - 'driver' => 'mysql', - 'prefix' => '', -+ ], -+ ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], +@@ -128,9 +161,55 @@ + 'prefix' => '', + ], + ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], + ], + ], + ]; + ++ yield [ ++ [ ++ 'DATABASE2_NAME' => 'migrate_db_name', ++ 'DATABASE2_USERNAME' => 'migrate_db_user', ++ 'DATABASE2_PASSWORD' => 'migrate_db_pass', ++ 'DATABASE2_HOST' => 'migrate_db_host', ++ 'DATABASE2_PORT' => '3307', + ], + [ -+ [ -+ 'DATABASE2_NAME' => 'migrate_db_name', -+ 'DATABASE2_USERNAME' => 'migrate_db_user', -+ 'DATABASE2_PASSWORD' => 'migrate_db_pass', -+ 'DATABASE2_HOST' => 'migrate_db_host', -+ 'DATABASE2_PORT' => '3307', ++ 'default' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '3306', ++ 'charset' => 'utf8mb4', ++ 'collation' => 'utf8mb4_general_ci', ++ 'driver' => 'mysql', ++ 'prefix' => '', ++ ], + ], -+ [ ++ 'migrate' => [ + 'default' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '3306', -+ 'charset' => 'utf8mb4', -+ 'collation' => 'utf8mb4_general_ci', -+ 'driver' => 'mysql', -+ 'prefix' => '', -+ ], ++ 'database' => 'migrate_db_name', ++ 'username' => 'migrate_db_user', ++ 'password' => 'migrate_db_pass', ++ 'host' => 'migrate_db_host', ++ 'port' => '3307', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'migrate_db_name', -+ 'username' => 'migrate_db_user', -+ 'password' => 'migrate_db_pass', -+ 'host' => 'migrate_db_host', -+ 'port' => '3307', -+ 'prefix' => '', -+ 'driver' => 'mysql', - ], - ], - ], ++ ], ++ ], ++ ]; + } + + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 5e6730bb3..0849e0c14 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -143,6 +143,13 @@ +@@ -141,6 +141,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/DatabaseSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/DatabaseSettingsTest.php index 741324047..956cd535d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/DatabaseSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/DatabaseSettingsTest.php @@ -1,107 +1,110 @@ -@@ -48,6 +48,17 @@ - 'prefix' => '', - ], +@@ -47,6 +47,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -75,6 +86,17 @@ - 'prefix' => '', - ], +@@ -74,6 +85,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -102,6 +124,17 @@ - 'prefix' => '', - ], +@@ -101,6 +123,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -127,6 +160,52 @@ - 'collation' => 'mysql_utf8mb3_bin', - 'driver' => 'mysql', - 'prefix' => '', -+ ], -+ ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], +@@ -128,9 +161,55 @@ + 'prefix' => '', + ], + ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], + ], + ], + ]; + ++ yield [ ++ [ ++ 'DATABASE2_NAME' => 'migrate_db_name', ++ 'DATABASE2_USERNAME' => 'migrate_db_user', ++ 'DATABASE2_PASSWORD' => 'migrate_db_pass', ++ 'DATABASE2_HOST' => 'migrate_db_host', ++ 'DATABASE2_PORT' => '3307', + ], + [ -+ [ -+ 'DATABASE2_NAME' => 'migrate_db_name', -+ 'DATABASE2_USERNAME' => 'migrate_db_user', -+ 'DATABASE2_PASSWORD' => 'migrate_db_pass', -+ 'DATABASE2_HOST' => 'migrate_db_host', -+ 'DATABASE2_PORT' => '3307', ++ 'default' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '3306', ++ 'charset' => 'utf8mb4', ++ 'collation' => 'utf8mb4_general_ci', ++ 'driver' => 'mysql', ++ 'prefix' => '', ++ ], + ], -+ [ ++ 'migrate' => [ + 'default' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '3306', -+ 'charset' => 'utf8mb4', -+ 'collation' => 'utf8mb4_general_ci', -+ 'driver' => 'mysql', -+ 'prefix' => '', -+ ], ++ 'database' => 'migrate_db_name', ++ 'username' => 'migrate_db_user', ++ 'password' => 'migrate_db_pass', ++ 'host' => 'migrate_db_host', ++ 'port' => '3307', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'migrate_db_name', -+ 'username' => 'migrate_db_user', -+ 'password' => 'migrate_db_pass', -+ 'host' => 'migrate_db_host', -+ 'port' => '3307', -+ 'prefix' => '', -+ 'driver' => 'mysql', - ], - ], - ], ++ ], ++ ], ++ ]; + } + + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 7f1f22cc1..a8860030e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -143,6 +143,13 @@ +@@ -141,6 +141,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; @@ -12,7 +12,7 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. -@@ -282,9 +289,9 @@ +@@ -280,9 +287,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/DatabaseSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/DatabaseSettingsTest.php index 741324047..956cd535d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/DatabaseSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/DatabaseSettingsTest.php @@ -1,107 +1,110 @@ -@@ -48,6 +48,17 @@ - 'prefix' => '', - ], +@@ -47,6 +47,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -75,6 +86,17 @@ - 'prefix' => '', - ], +@@ -74,6 +85,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -102,6 +124,17 @@ - 'prefix' => '', - ], +@@ -101,6 +123,17 @@ + 'prefix' => '', ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], -+ ], ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', ++ ], ++ ], ], + ]; -@@ -127,6 +160,52 @@ - 'collation' => 'mysql_utf8mb3_bin', - 'driver' => 'mysql', - 'prefix' => '', -+ ], -+ ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '', -+ 'prefix' => '', -+ 'driver' => 'mysql', -+ ], +@@ -128,9 +161,55 @@ + 'prefix' => '', + ], + ], ++ 'migrate' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], + ], + ], + ]; + ++ yield [ ++ [ ++ 'DATABASE2_NAME' => 'migrate_db_name', ++ 'DATABASE2_USERNAME' => 'migrate_db_user', ++ 'DATABASE2_PASSWORD' => 'migrate_db_pass', ++ 'DATABASE2_HOST' => 'migrate_db_host', ++ 'DATABASE2_PORT' => '3307', + ], + [ -+ [ -+ 'DATABASE2_NAME' => 'migrate_db_name', -+ 'DATABASE2_USERNAME' => 'migrate_db_user', -+ 'DATABASE2_PASSWORD' => 'migrate_db_pass', -+ 'DATABASE2_HOST' => 'migrate_db_host', -+ 'DATABASE2_PORT' => '3307', ++ 'default' => [ ++ 'default' => [ ++ 'database' => 'drupal', ++ 'username' => 'drupal', ++ 'password' => 'drupal', ++ 'host' => 'localhost', ++ 'port' => '3306', ++ 'charset' => 'utf8mb4', ++ 'collation' => 'utf8mb4_general_ci', ++ 'driver' => 'mysql', ++ 'prefix' => '', ++ ], + ], -+ [ ++ 'migrate' => [ + 'default' => [ -+ 'default' => [ -+ 'database' => 'drupal', -+ 'username' => 'drupal', -+ 'password' => 'drupal', -+ 'host' => 'localhost', -+ 'port' => '3306', -+ 'charset' => 'utf8mb4', -+ 'collation' => 'utf8mb4_general_ci', -+ 'driver' => 'mysql', -+ 'prefix' => '', -+ ], ++ 'database' => 'migrate_db_name', ++ 'username' => 'migrate_db_user', ++ 'password' => 'migrate_db_pass', ++ 'host' => 'migrate_db_host', ++ 'port' => '3307', ++ 'prefix' => '', ++ 'driver' => 'mysql', + ], -+ 'migrate' => [ -+ 'default' => [ -+ 'database' => 'migrate_db_name', -+ 'username' => 'migrate_db_user', -+ 'password' => 'migrate_db_pass', -+ 'host' => 'migrate_db_host', -+ 'port' => '3307', -+ 'prefix' => '', -+ 'driver' => 'mysql', - ], - ], - ], ++ ], ++ ], ++ ]; + } + + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index e8916642d..0a55c1185 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,191 +1,191 @@ -@@ -59,6 +59,186 @@ - self::ENVIRONMENT_LOCAL, - ], +@@ -58,6 +58,186 @@ + self::ENVIRONMENT_LOCAL, + ]; -+ // Lagoon. ++ // Lagoon. ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, + ], ++ self::ENVIRONMENT_DEV, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'master', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'master', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'master', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'master', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'release', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'release', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'release/__VERSION__', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'release/__VERSION__', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'hotfix', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'hotfix', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'hotfix/__VERSION__', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'hotfix/__VERSION__', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'somebranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'somebranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'somebranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'somebranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => '', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => '', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'mainbranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'mainbranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], - ]; ++ self::ENVIRONMENT_DEV, ++ ]; } -@@ -143,6 +323,13 @@ + /** +@@ -141,6 +321,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; @@ -199,7 +199,7 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. -@@ -327,6 +514,224 @@ +@@ -325,6 +512,224 @@ $settings['suspend_mail_send'] = TRUE; $settings['trusted_host_patterns'] = [ '^localhost$', diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php index ba6cdff8a..1954a204b 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -192,7 +192,6 @@ +@@ -190,7 +190,6 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -6,7 +6,7 @@ $config['environment_indicator.indicator']['bg_color'] = '#006600'; $config['environment_indicator.indicator']['fg_color'] = '#ffffff'; $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; -@@ -241,7 +240,6 @@ +@@ -239,7 +238,6 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -14,7 +14,7 @@ $config['environment_indicator.indicator']['bg_color'] = '#006600'; $config['environment_indicator.indicator']['fg_color'] = '#ffffff'; $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; -@@ -292,7 +290,6 @@ +@@ -290,7 +288,6 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/SwitchableSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/SwitchableSettingsTest.php index ddf9bd795..855ddb383 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -1,4 +1,4 @@ -@@ -76,93 +76,6 @@ +@@ -76,91 +76,6 @@ } /** @@ -19,71 +19,69 @@ - /** - * Data provider for testConfigSplit(). - */ -- public static function dataProviderConfigSplit(): array { -- return [ +- public static function dataProviderConfigSplit(): \Iterator { +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'config_split.config_split.local' => ['status' => TRUE], -- ], -- [ -- 'config_split.config_split.stage' => NULL, -- 'config_split.config_split.dev' => NULL, -- 'config_split.config_split.ci' => NULL, -- ], +- 'config_split.config_split.local' => ['status' => TRUE], - ], - [ -- self::ENVIRONMENT_CI, -- [ -- 'config_split.config_split.ci' => ['status' => TRUE], -- ], -- [ -- 'config_split.config_split.stage' => NULL, -- 'config_split.config_split.dev' => NULL, -- 'config_split.config_split.local' => NULL, -- ], +- 'config_split.config_split.stage' => NULL, +- 'config_split.config_split.dev' => NULL, +- 'config_split.config_split.ci' => NULL, +- ], +- ]; +- yield [ +- self::ENVIRONMENT_CI, +- [ +- 'config_split.config_split.ci' => ['status' => TRUE], - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'config_split.config_split.dev' => ['status' => TRUE], -- ], -- [ -- 'config_split.config_split.stage' => NULL, -- 'config_split.config_split.ci' => NULL, -- 'config_split.config_split.local' => NULL, -- ], +- 'config_split.config_split.stage' => NULL, +- 'config_split.config_split.dev' => NULL, +- 'config_split.config_split.local' => NULL, - ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'config_split.config_split.stage' => ['status' => TRUE], -- ], -- [ -- 'config_split.config_split.dev' => NULL, -- 'config_split.config_split.ci' => NULL, -- 'config_split.config_split.local' => NULL, -- ], +- 'config_split.config_split.dev' => ['status' => TRUE], - ], - [ -- self::ENVIRONMENT_PROD, -- [], -- [ -- 'config_split.config_split.stage' => NULL, -- 'config_split.config_split.dev' => NULL, -- 'config_split.config_split.ci' => NULL, -- 'config_split.config_split.local' => NULL, -- ], +- 'config_split.config_split.stage' => NULL, +- 'config_split.config_split.ci' => NULL, +- 'config_split.config_split.local' => NULL, +- ], +- ]; +- yield [ +- self::ENVIRONMENT_STAGE, +- [ +- 'config_split.config_split.stage' => ['status' => TRUE], - ], - [ -- self::ENVIRONMENT_SUT, -- [], -- [ -- 'config_split.config_split.stage' => NULL, -- 'config_split.config_split.dev' => NULL, -- 'config_split.config_split.ci' => NULL, -- 'config_split.config_split.local' => NULL, -- ], +- 'config_split.config_split.dev' => NULL, +- 'config_split.config_split.ci' => NULL, +- 'config_split.config_split.local' => NULL, +- ], +- ]; +- yield [ +- self::ENVIRONMENT_PROD, +- [], +- [ +- 'config_split.config_split.stage' => NULL, +- 'config_split.config_split.dev' => NULL, +- 'config_split.config_split.ci' => NULL, +- 'config_split.config_split.local' => NULL, +- ], +- ]; +- yield [ +- self::ENVIRONMENT_SUT, +- [], +- [ +- 'config_split.config_split.stage' => NULL, +- 'config_split.config_split.dev' => NULL, +- 'config_split.config_split.ci' => NULL, +- 'config_split.config_split.local' => NULL, - ], - ]; - } diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php index ca0b1992d..272c893a5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -72,11 +72,6 @@ +@@ -70,11 +70,6 @@ $this->requireSettingsFile(); @@ -10,7 +10,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -146,11 +141,6 @@ +@@ -144,11 +139,6 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. @@ -22,7 +22,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -193,11 +183,6 @@ +@@ -191,11 +181,6 @@ $config['automated_cron.settings']['interval'] = 0; $config['config_split.config_split.local']['status'] = TRUE; @@ -34,7 +34,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -242,11 +227,6 @@ +@@ -240,11 +225,6 @@ $config['automated_cron.settings']['interval'] = 0; $config['config_split.config_split.local']['status'] = TRUE; @@ -46,7 +46,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -293,11 +273,6 @@ +@@ -291,11 +271,6 @@ $config['automated_cron.settings']['interval'] = 0; $config['config_split.config_split.ci']['status'] = TRUE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/SwitchableSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/SwitchableSettingsTest.php index 53e03642a..a49fb6446 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -1,4 +1,4 @@ -@@ -163,71 +163,6 @@ +@@ -161,69 +161,6 @@ } /** @@ -19,49 +19,47 @@ - /** - * Data provider for testEnvironmentIndicator(). - */ -- public static function dataProviderEnvironmentIndicator(): array { -- return [ +- public static function dataProviderEnvironmentIndicator(): \Iterator { +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_LOCAL, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_LOCAL, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_CI, - [ -- self::ENVIRONMENT_CI, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_CI, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_CI, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_DEV, 'bg_color' => '#4caf50', 'fg_color' => '#000000'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_DEV, 'bg_color' => '#4caf50', 'fg_color' => '#000000'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_STAGE, 'bg_color' => '#fff176', 'fg_color' => '#000000'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_STAGE, 'bg_color' => '#fff176', 'fg_color' => '#000000'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_PROD, - [ -- self::ENVIRONMENT_PROD, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_PROD, 'bg_color' => '#ef5350', 'fg_color' => '#000000'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_PROD, 'bg_color' => '#ef5350', 'fg_color' => '#000000'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_SUT, - [ -- self::ENVIRONMENT_SUT, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_SUT, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_SUT, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], - ]; - } diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b84376d93..01f9d39c3 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -77,7 +77,6 @@ +@@ -75,7 +75,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_SUT; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; @@ -6,7 +6,7 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -151,7 +150,6 @@ +@@ -149,7 +148,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_SUT; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; @@ -14,7 +14,7 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -198,7 +196,6 @@ +@@ -196,7 +194,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; @@ -22,7 +22,7 @@ $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -247,7 +244,6 @@ +@@ -245,7 +242,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; @@ -30,7 +30,7 @@ $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -298,7 +294,6 @@ +@@ -296,7 +292,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_CI; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php index af5537499..863664a21 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -204,8 +204,6 @@ +@@ -202,8 +202,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -7,7 +7,7 @@ $this->assertConfig($config); $settings['auto_create_htaccess'] = FALSE; -@@ -253,8 +251,6 @@ +@@ -251,8 +249,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -16,7 +16,7 @@ $this->assertConfig($config); $settings['auto_create_htaccess'] = FALSE; -@@ -304,8 +300,6 @@ +@@ -302,8 +298,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 6eff3445e..56475a0ef 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -78,7 +78,6 @@ +@@ -76,7 +76,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -6,7 +6,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.performance']['cache']['page']['max_age'] = 900; -@@ -152,7 +151,6 @@ +@@ -150,7 +149,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -14,7 +14,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.performance']['cache']['page']['max_age'] = 1800; -@@ -199,13 +197,10 @@ +@@ -197,13 +195,10 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -28,7 +28,7 @@ $this->assertConfig($config); $settings['auto_create_htaccess'] = FALSE; -@@ -248,13 +243,10 @@ +@@ -246,13 +241,10 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -42,7 +42,7 @@ $this->assertConfig($config); $settings['auto_create_htaccess'] = FALSE; -@@ -299,13 +291,10 @@ +@@ -297,13 +289,10 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/SwitchableSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/SwitchableSettingsTest.php index c8fe1f85b..8c99eb8db 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -1,4 +1,4 @@ -@@ -301,504 +301,6 @@ +@@ -297,500 +297,6 @@ } /** @@ -17,358 +17,356 @@ - /** - * Data provider for testShield(). - */ -- public static function dataProviderShield(): array { -- return [ +- public static function dataProviderShield(): \Iterator { +- yield [ +- self::ENVIRONMENT_LOCAL, +- [], - [ -- self::ENVIRONMENT_LOCAL, -- [], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], -- [ -- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => FALSE], - ], - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], -- [ -- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - ], - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => FALSE], +- ], +- [ +- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_CI, - [ -- self::ENVIRONMENT_CI, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_PROD, - [ -- self::ENVIRONMENT_PROD, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], +- [ +- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_SUT, - [ -- self::ENVIRONMENT_SUT, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => '', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => '', +- ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 0, -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 0, - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 1, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 1, +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => '0', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => '0', - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => '1', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 'false', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => '1', - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 'true', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 'false', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 'true', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_DISABLED' => TRUE, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'DRUPAL_SHIELD_DISABLED' => TRUE, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'shield.settings' => ['shield_enable' => FALSE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_PROD, -- [ -- 'DRUPAL_SHIELD_DISABLED' => TRUE, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_PROD, +- [ +- 'DRUPAL_SHIELD_DISABLED' => TRUE, +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], +- ], +- ]; - -- // ACME challenge passthrough tests. +- // ACME challenge passthrough tests. +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- 'method' => 0, -- 'paths' => '/.well-known/acme-challenge/*', -- ], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => FALSE, -- 'method' => 0, -- 'paths' => '/.well-known/acme-challenge/*', -- ], +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], +- 'method' => 0, +- 'paths' => '/.well-known/acme-challenge/*', - ], - ], -- // ACME challenge disabled - verify settings are absent. +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- ], -- ], -- [ -- 'shield.settings' => ['method' => NULL, 'paths' => NULL], -- ], +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], -- // ACME challenge with empty value - should not set. - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => '', -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- ], -- ], -- [ -- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- 'shield.settings' => [ +- 'shield_enable' => FALSE, +- 'method' => 0, +- 'paths' => '/.well-known/acme-challenge/*', - ], - ], -- // ACME challenge with 0 value - should not set. +- ]; +- // ACME challenge disabled - verify settings are absent. +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 0, +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- ], +- ], +- [ +- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- ]; +- // ACME challenge with empty value - should not set. +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => '', +- ], +- [ +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], -- [ -- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- [ +- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- ]; +- // ACME challenge with 0 value - should not set. +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 0, +- ], +- [ +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], - ], +- [ +- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'method' => 0, -- 'paths' => "/custom/path/*\n/.well-known/acme-challenge/*", -- ], -- ], -- [], -- [ -- 'shield.settings' => ['paths' => '/custom/path/*'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'method' => 0, -- 'paths' => "/.well-known/acme-challenge/*\n/other/path/*", -- ], -- ], -- [], -- [ -- 'shield.settings' => ['paths' => "/.well-known/acme-challenge/*\n/other/path/*"], +- 'shield.settings' => [ +- 'method' => 0, +- 'paths' => "/custom/path/*\n/.well-known/acme-challenge/*", - ], - ], +- [], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'method' => 0, -- 'paths' => "/admin/*\n/api/*\n/.well-known/acme-challenge/*", -- ], +- 'shield.settings' => ['paths' => '/custom/path/*'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, +- ], +- [ +- 'shield.settings' => [ +- 'method' => 0, +- 'paths' => "/.well-known/acme-challenge/*\n/other/path/*", - ], -- [], -- [ -- 'shield.settings' => ['paths' => "/admin/*\n/api/*"], +- ], +- [], +- [ +- 'shield.settings' => ['paths' => "/.well-known/acme-challenge/*\n/other/path/*"], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, +- ], +- [ +- 'shield.settings' => [ +- 'method' => 0, +- 'paths' => "/admin/*\n/api/*\n/.well-known/acme-challenge/*", - ], - ], +- [], +- [ +- 'shield.settings' => ['paths' => "/admin/*\n/api/*"], +- ], - ]; - } - @@ -388,114 +386,112 @@ - /** - * Data provider for testStageFileProxy(). - */ -- public static function dataProviderStageFileProxy(): array { -- return [ -- [ -- self::ENVIRONMENT_LOCAL, -- [], -- [], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], -- ], +- public static function dataProviderStageFileProxy(): \Iterator { +- yield [ +- self::ENVIRONMENT_LOCAL, +- [], +- [], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - ], - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], - ], +- [], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], +- [], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], +- ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_CI, - [ -- self::ENVIRONMENT_CI, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], +- ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], +- ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_PROD, - [ -- self::ENVIRONMENT_PROD, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], +- [], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_SUT, - [ -- self::ENVIRONMENT_SUT, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], +- [], - ]; - } - diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 05909f2ee..5c31b4b2e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -78,7 +78,6 @@ +@@ -76,7 +76,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -6,7 +6,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.performance']['cache']['page']['max_age'] = 900; -@@ -152,7 +151,6 @@ +@@ -150,7 +149,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -14,7 +14,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.performance']['cache']['page']['max_age'] = 1800; -@@ -199,7 +197,6 @@ +@@ -197,7 +195,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -22,7 +22,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -248,7 +245,6 @@ +@@ -246,7 +243,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -30,7 +30,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -299,7 +295,6 @@ +@@ -297,7 +293,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/SwitchableSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/SwitchableSettingsTest.php index ab3007be7..374fdad1c 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -1,4 +1,4 @@ -@@ -301,377 +301,6 @@ +@@ -297,375 +297,6 @@ } /** @@ -17,358 +17,356 @@ - /** - * Data provider for testShield(). - */ -- public static function dataProviderShield(): array { -- return [ +- public static function dataProviderShield(): \Iterator { +- yield [ +- self::ENVIRONMENT_LOCAL, +- [], - [ -- self::ENVIRONMENT_LOCAL, -- [], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], -- [ -- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => FALSE], - ], - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], -- [ -- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], - ], +- [ +- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_CI, - [ -- self::ENVIRONMENT_CI, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_PROD, - [ -- self::ENVIRONMENT_PROD, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], +- [ +- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_SUT, - [ -- self::ENVIRONMENT_SUT, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => '', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => '', - ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 0, -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 0, - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 1, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 1, +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => '0', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => '0', - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => '1', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 'false', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => '1', - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 'true', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 'false', - ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 'true', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_DISABLED' => TRUE, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'DRUPAL_SHIELD_DISABLED' => TRUE, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'shield.settings' => ['shield_enable' => FALSE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_PROD, -- [ -- 'DRUPAL_SHIELD_DISABLED' => TRUE, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'DRUPAL_SHIELD_DISABLED' => TRUE, +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_PROD, +- [ +- 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], +- ], +- ]; - -- // ACME challenge passthrough tests. +- // ACME challenge passthrough tests. +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- 'method' => 0, -- 'paths' => '/.well-known/acme-challenge/*', -- ], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => FALSE, -- 'method' => 0, -- 'paths' => '/.well-known/acme-challenge/*', -- ], +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], +- 'method' => 0, +- 'paths' => '/.well-known/acme-challenge/*', - ], - ], -- // ACME challenge disabled - verify settings are absent. +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, +- ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- ], -- ], -- [ -- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- 'shield.settings' => [ +- 'shield_enable' => FALSE, +- 'method' => 0, +- 'paths' => '/.well-known/acme-challenge/*', - ], - ], -- // ACME challenge with empty value - should not set. +- ]; +- // ACME challenge disabled - verify settings are absent. +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => '', -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- ], -- ], -- [ -- 'shield.settings' => ['method' => NULL, 'paths' => NULL], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], -- // ACME challenge with 0 value - should not set. - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 0, +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- ], +- ], +- [ +- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- ]; +- // ACME challenge with empty value - should not set. +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => '', +- ], +- [ +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], -- [ -- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- [ +- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- ]; +- // ACME challenge with 0 value - should not set. +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 0, +- ], +- [ +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], - ], +- [ +- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'method' => 0, -- 'paths' => "/custom/path/*\n/.well-known/acme-challenge/*", -- ], -- ], -- [], -- [ -- 'shield.settings' => ['paths' => '/custom/path/*'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'method' => 0, -- 'paths' => "/.well-known/acme-challenge/*\n/other/path/*", -- ], -- ], -- [], -- [ -- 'shield.settings' => ['paths' => "/.well-known/acme-challenge/*\n/other/path/*"], +- 'shield.settings' => [ +- 'method' => 0, +- 'paths' => "/custom/path/*\n/.well-known/acme-challenge/*", - ], - ], +- [], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'method' => 0, -- 'paths' => "/admin/*\n/api/*\n/.well-known/acme-challenge/*", -- ], +- 'shield.settings' => ['paths' => '/custom/path/*'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, +- ], +- [ +- 'shield.settings' => [ +- 'method' => 0, +- 'paths' => "/.well-known/acme-challenge/*\n/other/path/*", - ], -- [], -- [ -- 'shield.settings' => ['paths' => "/admin/*\n/api/*"], +- ], +- [], +- [ +- 'shield.settings' => ['paths' => "/.well-known/acme-challenge/*\n/other/path/*"], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, +- ], +- [ +- 'shield.settings' => [ +- 'method' => 0, +- 'paths' => "/admin/*\n/api/*\n/.well-known/acme-challenge/*", - ], - ], +- [], +- [ +- 'shield.settings' => ['paths' => "/admin/*\n/api/*"], +- ], - ]; - } - diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_stage_file_proxy/tests/phpunit/Drupal/SwitchableSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_stage_file_proxy/tests/phpunit/Drupal/SwitchableSettingsTest.php index 298326973..bc2373889 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_stage_file_proxy/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_stage_file_proxy/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -1,4 +1,4 @@ -@@ -672,133 +672,6 @@ +@@ -666,131 +666,6 @@ } /** @@ -17,114 +17,112 @@ - /** - * Data provider for testStageFileProxy(). - */ -- public static function dataProviderStageFileProxy(): array { -- return [ -- [ -- self::ENVIRONMENT_LOCAL, -- [], -- [], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], -- ], -- ], -- [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], -- ], -- [], -- ], -- [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], -- ], -- [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], -- ], -- [], +- public static function dataProviderStageFileProxy(): \Iterator { +- yield [ +- self::ENVIRONMENT_LOCAL, +- [], +- [], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], +- ], +- [], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], +- ], +- [], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], - ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_CI, +- [ +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], - [ -- self::ENVIRONMENT_CI, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], +- ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], +- ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_PROD, +- [ +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], +- [], - [ -- self::ENVIRONMENT_PROD, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_SUT, +- [ +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], - [ -- self::ENVIRONMENT_SUT, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], +- [], - ]; - } - diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 62a6ecb5c..228287672 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -72,14 +72,6 @@ +@@ -70,14 +70,6 @@ $this->requireSettingsFile(); @@ -13,7 +13,7 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); -@@ -146,14 +138,6 @@ +@@ -144,14 +136,6 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. @@ -28,7 +28,7 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.performance']['cache']['page']['max_age'] = 1800; $this->assertConfig($config); -@@ -192,20 +176,9 @@ +@@ -190,20 +174,9 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -49,7 +49,7 @@ $this->assertConfig($config); $settings['auto_create_htaccess'] = FALSE; -@@ -241,20 +214,9 @@ +@@ -239,20 +212,9 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -70,7 +70,7 @@ $this->assertConfig($config); $settings['auto_create_htaccess'] = FALSE; -@@ -292,20 +254,9 @@ +@@ -290,20 +252,9 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/SwitchableSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/SwitchableSettingsTest.php index a09f581a7..cffb6b01d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -1,4 +1,4 @@ -@@ -76,158 +76,6 @@ +@@ -76,154 +76,6 @@ } /** @@ -19,71 +19,69 @@ - /** - * Data provider for testConfigSplit(). - */ -- public static function dataProviderConfigSplit(): array { -- return [ +- public static function dataProviderConfigSplit(): \Iterator { +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'config_split.config_split.local' => ['status' => TRUE], -- ], -- [ -- 'config_split.config_split.stage' => NULL, -- 'config_split.config_split.dev' => NULL, -- 'config_split.config_split.ci' => NULL, -- ], +- 'config_split.config_split.local' => ['status' => TRUE], - ], - [ -- self::ENVIRONMENT_CI, -- [ -- 'config_split.config_split.ci' => ['status' => TRUE], -- ], -- [ -- 'config_split.config_split.stage' => NULL, -- 'config_split.config_split.dev' => NULL, -- 'config_split.config_split.local' => NULL, -- ], +- 'config_split.config_split.stage' => NULL, +- 'config_split.config_split.dev' => NULL, +- 'config_split.config_split.ci' => NULL, - ], +- ]; +- yield [ +- self::ENVIRONMENT_CI, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'config_split.config_split.dev' => ['status' => TRUE], -- ], -- [ -- 'config_split.config_split.stage' => NULL, -- 'config_split.config_split.ci' => NULL, -- 'config_split.config_split.local' => NULL, -- ], +- 'config_split.config_split.ci' => ['status' => TRUE], - ], - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'config_split.config_split.stage' => ['status' => TRUE], -- ], -- [ -- 'config_split.config_split.dev' => NULL, -- 'config_split.config_split.ci' => NULL, -- 'config_split.config_split.local' => NULL, -- ], +- 'config_split.config_split.stage' => NULL, +- 'config_split.config_split.dev' => NULL, +- 'config_split.config_split.local' => NULL, - ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_PROD, -- [], -- [ -- 'config_split.config_split.stage' => NULL, -- 'config_split.config_split.dev' => NULL, -- 'config_split.config_split.ci' => NULL, -- 'config_split.config_split.local' => NULL, -- ], +- 'config_split.config_split.dev' => ['status' => TRUE], - ], - [ -- self::ENVIRONMENT_SUT, -- [], -- [ -- 'config_split.config_split.stage' => NULL, -- 'config_split.config_split.dev' => NULL, -- 'config_split.config_split.ci' => NULL, -- 'config_split.config_split.local' => NULL, -- ], +- 'config_split.config_split.stage' => NULL, +- 'config_split.config_split.ci' => NULL, +- 'config_split.config_split.local' => NULL, +- ], +- ]; +- yield [ +- self::ENVIRONMENT_STAGE, +- [ +- 'config_split.config_split.stage' => ['status' => TRUE], +- ], +- [ +- 'config_split.config_split.dev' => NULL, +- 'config_split.config_split.ci' => NULL, +- 'config_split.config_split.local' => NULL, +- ], +- ]; +- yield [ +- self::ENVIRONMENT_PROD, +- [], +- [ +- 'config_split.config_split.stage' => NULL, +- 'config_split.config_split.dev' => NULL, +- 'config_split.config_split.ci' => NULL, +- 'config_split.config_split.local' => NULL, +- ], +- ]; +- yield [ +- self::ENVIRONMENT_SUT, +- [], +- [ +- 'config_split.config_split.stage' => NULL, +- 'config_split.config_split.dev' => NULL, +- 'config_split.config_split.ci' => NULL, +- 'config_split.config_split.local' => NULL, - ], - ]; - } @@ -106,49 +104,47 @@ - /** - * Data provider for testEnvironmentIndicator(). - */ -- public static function dataProviderEnvironmentIndicator(): array { -- return [ +- public static function dataProviderEnvironmentIndicator(): \Iterator { +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_LOCAL, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_LOCAL, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_CI, - [ -- self::ENVIRONMENT_CI, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_CI, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_CI, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_DEV, 'bg_color' => '#4caf50', 'fg_color' => '#000000'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_DEV, 'bg_color' => '#4caf50', 'fg_color' => '#000000'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_STAGE, 'bg_color' => '#fff176', 'fg_color' => '#000000'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_STAGE, 'bg_color' => '#fff176', 'fg_color' => '#000000'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_PROD, - [ -- self::ENVIRONMENT_PROD, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_PROD, 'bg_color' => '#ef5350', 'fg_color' => '#000000'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_PROD, 'bg_color' => '#ef5350', 'fg_color' => '#000000'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_SUT, - [ -- self::ENVIRONMENT_SUT, -- [ -- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_SUT, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], -- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], -- ], +- 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_SUT, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], +- 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], - ]; - } @@ -157,7 +153,7 @@ * Test Redis settings. */ public function testRedis(): void { -@@ -298,504 +146,6 @@ +@@ -294,500 +146,6 @@ unset($this->settings['bootstrap_container_definition']); $this->assertSettingsContains($settings); @@ -179,358 +175,356 @@ public function testRedis(): void { - /** - * Data provider for testShield(). - */ -- public static function dataProviderShield(): array { -- return [ +- public static function dataProviderShield(): \Iterator { +- yield [ +- self::ENVIRONMENT_LOCAL, +- [], - [ -- self::ENVIRONMENT_LOCAL, -- [], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], -- [ -- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => FALSE], - ], - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], -- [ -- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], +- ], +- [ +- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_CI, - [ -- self::ENVIRONMENT_CI, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_PROD, - [ -- self::ENVIRONMENT_PROD, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], +- [ +- 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_SUT, - [ -- self::ENVIRONMENT_SUT, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => '', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => '', +- ], +- [ +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 0, -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 0, - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 1, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 1, +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => '0', -- ], -- [ -- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => '0', - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => '1', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 'false', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => '1', - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', -- 'DRUPAL_SHIELD_DISABLED' => 'true', -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], -- ], +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 'false', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', +- 'DRUPAL_SHIELD_DISABLED' => 'true', +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_DISABLED' => TRUE, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'DRUPAL_SHIELD_DISABLED' => TRUE, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'shield.settings' => ['shield_enable' => FALSE], - ], +- ]; +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_PROD, -- [ -- 'DRUPAL_SHIELD_DISABLED' => TRUE, -- ], -- [ -- 'shield.settings' => ['shield_enable' => FALSE], -- ], +- 'DRUPAL_SHIELD_DISABLED' => TRUE, +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_PROD, +- [ +- 'DRUPAL_SHIELD_DISABLED' => TRUE, +- ], +- [ +- 'shield.settings' => ['shield_enable' => FALSE], - ], +- ]; - -- // ACME challenge passthrough tests. +- // ACME challenge passthrough tests. +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- 'method' => 0, -- 'paths' => '/.well-known/acme-challenge/*', -- ], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => FALSE, -- 'method' => 0, -- 'paths' => '/.well-known/acme-challenge/*', -- ], +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], +- 'method' => 0, +- 'paths' => '/.well-known/acme-challenge/*', - ], - ], -- // ACME challenge disabled - verify settings are absent. +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- ], -- ], -- [ -- 'shield.settings' => ['method' => NULL, 'paths' => NULL], -- ], +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], -- // ACME challenge with empty value - should not set. - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => '', -- ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- ], -- ], -- [ -- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- 'shield.settings' => [ +- 'shield_enable' => FALSE, +- 'method' => 0, +- 'paths' => '/.well-known/acme-challenge/*', - ], - ], -- // ACME challenge with 0 value - should not set. +- ]; +- // ACME challenge disabled - verify settings are absent. +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 0, +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], -- [ -- 'shield.settings' => [ -- 'shield_enable' => TRUE, -- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], -- ], +- ], +- [ +- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- ]; +- // ACME challenge with empty value - should not set. +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => '', +- ], +- [ +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], -- [ -- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- [ +- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- ]; +- // ACME challenge with 0 value - should not set. +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 0, +- ], +- [ +- 'shield.settings' => [ +- 'shield_enable' => TRUE, +- 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], - ], +- [ +- 'shield.settings' => ['method' => NULL, 'paths' => NULL], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'method' => 0, -- 'paths' => "/custom/path/*\n/.well-known/acme-challenge/*", -- ], -- ], -- [], -- [ -- 'shield.settings' => ['paths' => '/custom/path/*'], -- ], +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'method' => 0, -- 'paths' => "/.well-known/acme-challenge/*\n/other/path/*", -- ], -- ], -- [], -- [ -- 'shield.settings' => ['paths' => "/.well-known/acme-challenge/*\n/other/path/*"], +- 'shield.settings' => [ +- 'method' => 0, +- 'paths' => "/custom/path/*\n/.well-known/acme-challenge/*", - ], - ], +- [], - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, -- ], -- [ -- 'shield.settings' => [ -- 'method' => 0, -- 'paths' => "/admin/*\n/api/*\n/.well-known/acme-challenge/*", -- ], +- 'shield.settings' => ['paths' => '/custom/path/*'], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, +- ], +- [ +- 'shield.settings' => [ +- 'method' => 0, +- 'paths' => "/.well-known/acme-challenge/*\n/other/path/*", - ], -- [], -- [ -- 'shield.settings' => ['paths' => "/admin/*\n/api/*"], +- ], +- [], +- [ +- 'shield.settings' => ['paths' => "/.well-known/acme-challenge/*\n/other/path/*"], +- ], +- ]; +- yield [ +- self::ENVIRONMENT_DEV, +- [ +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, +- ], +- [ +- 'shield.settings' => [ +- 'method' => 0, +- 'paths' => "/admin/*\n/api/*\n/.well-known/acme-challenge/*", - ], - ], +- [], +- [ +- 'shield.settings' => ['paths' => "/admin/*\n/api/*"], +- ], - ]; - } - @@ -550,114 +544,112 @@ public function testRedis(): void { - /** - * Data provider for testStageFileProxy(). - */ -- public static function dataProviderStageFileProxy(): array { -- return [ -- [ -- self::ENVIRONMENT_LOCAL, -- [], -- [], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], -- ], +- public static function dataProviderStageFileProxy(): \Iterator { +- yield [ +- self::ENVIRONMENT_LOCAL, +- [], +- [], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], - ], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - ], - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], +- ], +- [], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ -- self::ENVIRONMENT_LOCAL, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], -- ], -- [], +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], +- ], +- [], +- ]; +- yield [ +- self::ENVIRONMENT_LOCAL, +- [ +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], +- ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_CI, - [ -- self::ENVIRONMENT_CI, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_DEV, - [ -- self::ENVIRONMENT_DEV, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], +- ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_STAGE, - [ -- self::ENVIRONMENT_STAGE, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], +- [], +- ]; - +- yield [ +- self::ENVIRONMENT_PROD, - [ -- self::ENVIRONMENT_PROD, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], +- [], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], +- ], +- ]; - +- yield [ +- self::ENVIRONMENT_SUT, - [ -- self::ENVIRONMENT_SUT, -- [ -- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', -- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', -- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', -- ], -- [ -- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], -- ], -- [], +- 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', +- 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', +- 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', +- ], +- [ +- 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], +- [], - ]; } diff --git a/.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/Kernel/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/Kernel/ExampleTest.php index 67cd6e68d..54605d315 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/Kernel/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/Kernel/ExampleTest.php @@ -37,11 +37,9 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; } /** @@ -64,12 +62,10 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; } /** @@ -93,12 +89,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/Unit/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/Unit/ExampleTest.php index 7ab995283..e8e0fd90c 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/Unit/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/Unit/ExampleTest.php @@ -37,11 +37,9 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; } /** @@ -64,12 +62,10 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; } /** @@ -93,12 +89,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/Kernel/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/Kernel/ExampleTest.php index b742dfc9b..40a7dff94 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/Kernel/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/Kernel/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [3, 1, 4], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [3, 1, 4]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/Unit/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/Unit/ExampleTest.php index 19857d426..2786a3dcf 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/Unit/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/Unit/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [2, 1, 3], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [2, 1, 3]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/tests/phpunit/Drupal/SwitchableSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/tests/phpunit/Drupal/SwitchableSettingsTest.php index 3c5f45706..adcdd971d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -1,4 +1,4 @@ -@@ -228,79 +228,6 @@ +@@ -224,79 +224,6 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index e90ccf1e2..0c6aab903 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,191 +1,191 @@ -@@ -59,6 +59,186 @@ - self::ENVIRONMENT_LOCAL, - ], +@@ -58,6 +58,186 @@ + self::ENVIRONMENT_LOCAL, + ]; -+ // Lagoon. ++ // Lagoon. ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, + ], ++ self::ENVIRONMENT_DEV, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'master', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'master', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'master', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'master', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_GIT_BRANCH' => 'main', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'production', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_GIT_BRANCH' => 'main', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'production', + ], ++ self::ENVIRONMENT_PROD, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'release', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'release', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'release/__VERSION__', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'release/__VERSION__', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'hotfix', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'hotfix', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'hotfix/__VERSION__', -+ ], -+ self::ENVIRONMENT_STAGE, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'hotfix/__VERSION__', + ], ++ self::ENVIRONMENT_STAGE, ++ ]; + ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'somebranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'somebranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => FALSE, -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => FALSE, ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'somebranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'somebranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => '', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => '', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', + ], ++ self::ENVIRONMENT_DEV, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ 'LAGOON_GIT_BRANCH' => 'mainbranch', -+ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', -+ ], -+ self::ENVIRONMENT_PROD, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', ++ 'LAGOON_GIT_BRANCH' => 'mainbranch', ++ 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', + ], ++ self::ENVIRONMENT_PROD, ++ ]; ++ yield [ + [ -+ [ -+ 'LAGOON_KUBERNETES' => 1, -+ 'LAGOON_ENVIRONMENT_TYPE' => 'development', -+ ], -+ self::ENVIRONMENT_DEV, ++ 'LAGOON_KUBERNETES' => 1, ++ 'LAGOON_ENVIRONMENT_TYPE' => 'development', + ], - ]; ++ self::ENVIRONMENT_DEV, ++ ]; } -@@ -327,6 +507,224 @@ + /** +@@ -325,6 +505,224 @@ $settings['suspend_mail_send'] = TRUE; $settings['trusted_host_patterns'] = [ '^localhost$', diff --git a/.vortex/installer/tests/Fixtures/handler_process/services_no_redis/tests/phpunit/Drupal/SwitchableSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/services_no_redis/tests/phpunit/Drupal/SwitchableSettingsTest.php index 3c5f45706..adcdd971d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/services_no_redis/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/services_no_redis/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -1,4 +1,4 @@ -@@ -228,79 +228,6 @@ +@@ -224,79 +224,6 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/services_none/tests/phpunit/Drupal/SwitchableSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/services_none/tests/phpunit/Drupal/SwitchableSettingsTest.php index 2e08354c1..0dca0c618 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/services_none/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/services_none/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -61,8 +61,8 @@ class SwitchableSettingsTest extends SettingsTestCase { * Test Config Split config. */ #[DataProvider('dataProviderConfigSplit')] -@@ -225,79 +169,6 @@ - ], +@@ -221,79 +165,6 @@ + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], ]; - } diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_claro/rector.php b/.vortex/installer/tests/Fixtures/handler_process/theme_claro/rector.php index 74275f199..09bf2278f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_claro/rector.php +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_claro/rector.php @@ -1,4 +1,4 @@ -@@ -45,7 +45,6 @@ +@@ -46,7 +46,6 @@ return RectorConfig::configure() ->withPaths([ __DIR__ . '/web/modules/custom', diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/Kernel/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/Kernel/ExampleTest.php index c77670959..c9780940f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/Kernel/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/Kernel/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [3, 1, 4], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [3, 1, 4]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/Unit/ExampleTest.php b/.vortex/installer/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/Unit/ExampleTest.php index a13ccb593..68eb53e07 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/Unit/ExampleTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/Unit/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [2, 1, 3], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [2, 1, 3]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/rector.php b/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/rector.php index 74275f199..09bf2278f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/rector.php +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/rector.php @@ -1,4 +1,4 @@ -@@ -45,7 +45,6 @@ +@@ -46,7 +46,6 @@ return RectorConfig::configure() ->withPaths([ __DIR__ . '/web/modules/custom', diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_stark/rector.php b/.vortex/installer/tests/Fixtures/handler_process/theme_stark/rector.php index 74275f199..09bf2278f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_stark/rector.php +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_stark/rector.php @@ -1,4 +1,4 @@ -@@ -45,7 +45,6 @@ +@@ -46,7 +46,6 @@ return RectorConfig::configure() ->withPaths([ __DIR__ . '/web/modules/custom', diff --git a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/CircleCiConfigTest.php index 98bfab325..11b2490e4 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/CircleCiConfigTest.php @@ -49,165 +49,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], - - ['ci'], - ['cisomething'], - - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], - - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], - - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], - - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], - - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], - - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], - - ['preci', FALSE], - ['precipost', FALSE], - - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], - - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], - - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], - - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], - - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], - - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; + + yield ['ci']; + yield ['cisomething']; + + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; + + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; + + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; + + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; + + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; + + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; + + yield ['preci', FALSE]; + yield ['precipost', FALSE]; + + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; + + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; + + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; + + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; + + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; + + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -223,34 +221,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], - - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; + + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index fa423d793..1e3b86ec5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -9,7 +9,7 @@ */ #[Group('drupal_settings')] class EnvironmentSettingsTest extends SettingsTestCase { -@@ -282,9 +278,9 @@ +@@ -280,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/rector.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/rector.php new file mode 100644 index 000000000..6d8e0f6d3 --- /dev/null +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/rector.php @@ -0,0 +1,16 @@ +@@ -36,7 +36,6 @@ + use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector; + use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector; + use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; +-use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; + use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector; + use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; + use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; +@@ -99,7 +98,6 @@ + // Additional rules. + ->withRules([ + DeclareStrictTypesRector::class, +- YieldDataProviderRector::class, + ]) + // Configure Drupal autoloading. + ->withAutoloadPaths((function (): array { diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/rector.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/rector.php new file mode 100644 index 000000000..6d8e0f6d3 --- /dev/null +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/rector.php @@ -0,0 +1,16 @@ +@@ -36,7 +36,6 @@ + use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector; + use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector; + use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; +-use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; + use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector; + use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; + use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; +@@ -99,7 +98,6 @@ + // Additional rules. + ->withRules([ + DeclareStrictTypesRector::class, +- YieldDataProviderRector::class, + ]) + // Configure Drupal autoloading. + ->withAutoloadPaths((function (): array { diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/rector.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/rector.php index 74275f199..09bf2278f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/rector.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/rector.php @@ -1,4 +1,4 @@ -@@ -45,7 +45,6 @@ +@@ -46,7 +46,6 @@ return RectorConfig::configure() ->withPaths([ __DIR__ . '/web/modules/custom', diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/rector.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/rector.php index 74275f199..09bf2278f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/rector.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/rector.php @@ -1,4 +1,4 @@ -@@ -45,7 +45,6 @@ +@@ -46,7 +46,6 @@ return RectorConfig::configure() ->withPaths([ __DIR__ . '/web/modules/custom', diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/rector.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/rector.php index 74275f199..09bf2278f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/rector.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/rector.php @@ -1,4 +1,4 @@ -@@ -45,7 +45,6 @@ +@@ -46,7 +46,6 @@ return RectorConfig::configure() ->withPaths([ __DIR__ . '/web/modules/custom', diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/CircleCiConfigTest.php index 15776fa5c..a5d166802 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/CircleCiConfigTest.php @@ -50,165 +50,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], - - ['ci'], - ['cisomething'], - - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], - - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], - - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], - - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], - - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], - - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], - - ['preci', FALSE], - ['precipost', FALSE], - - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], - - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], - - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], - - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], - - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], - - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; + + yield ['ci']; + yield ['cisomething']; + + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; + + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; + + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; + + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; + + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; + + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; + + yield ['preci', FALSE]; + yield ['precipost', FALSE]; + + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; + + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; + + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; + + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; + + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; + + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -224,34 +222,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], - - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; + + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index fa423d793..1e3b86ec5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -9,7 +9,7 @@ */ #[Group('drupal_settings')] class EnvironmentSettingsTest extends SettingsTestCase { -@@ -282,9 +278,9 @@ +@@ -280,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/tests/phpunit/CircleCiConfigTest.php index 9cdb89a80..1fe86e9ad 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/tests/phpunit/CircleCiConfigTest.php @@ -53,165 +53,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -227,34 +225,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit/rector.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit/rector.php new file mode 100644 index 000000000..6d8e0f6d3 --- /dev/null +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit/rector.php @@ -0,0 +1,16 @@ +@@ -36,7 +36,6 @@ + use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector; + use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector; + use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; +-use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; + use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector; + use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; + use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; +@@ -99,7 +98,6 @@ + // Additional rules. + ->withRules([ + DeclareStrictTypesRector::class, +- YieldDataProviderRector::class, + ]) + // Configure Drupal autoloading. + ->withAutoloadPaths((function (): array { diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/rector.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/rector.php new file mode 100644 index 000000000..6d8e0f6d3 --- /dev/null +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/rector.php @@ -0,0 +1,16 @@ +@@ -36,7 +36,6 @@ + use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector; + use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector; + use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; +-use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; + use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector; + use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; + use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; +@@ -99,7 +98,6 @@ + // Additional rules. + ->withRules([ + DeclareStrictTypesRector::class, +- YieldDataProviderRector::class, + ]) + // Configure Drupal autoloading. + ->withAutoloadPaths((function (): array { diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/CircleCiConfigTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/CircleCiConfigTest.php index 1d28e375e..416620280 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/CircleCiConfigTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/__VERSION__'], - ['release/__VERSION__'], - ['hotfix/__VERSION__'], - ['hotfix/__VERSION__'], + yield ['release/__VERSION__']; + yield ['release/__VERSION__']; + yield ['hotfix/__VERSION__']; + yield ['hotfix/__VERSION__']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/__VERSION__.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/__VERSION__.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/__VERSION__.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/__VERSION__.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/__VERSION__.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/__VERSION__.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/__VERSION__.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/__VERSION__.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/__VERSION__.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/__VERSION__.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/__VERSION__.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/__VERSION__.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], - ['release/__VERSION__', FALSE], + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; + yield ['release/__VERSION__', FALSE]; - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], - ['hotfix/__VERSION__', FALSE], + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; + yield ['hotfix/__VERSION__', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['__VERSION__'], - ['__VERSION__'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['__VERSION__']; + yield ['__VERSION__']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], - ['__VERSION__', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; + yield ['__VERSION__', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b51e57bc9..aa1deaed6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -282,9 +282,9 @@ +@@ -280,9 +280,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/rector.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/rector.php index 74275f199..09bf2278f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/rector.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/rector.php @@ -1,4 +1,4 @@ -@@ -45,7 +45,6 @@ +@@ -46,7 +46,6 @@ return RectorConfig::configure() ->withPaths([ __DIR__ . '/web/modules/custom', diff --git a/.vortex/installer/tests/Functional/Command/BuildCommandTest.php b/.vortex/installer/tests/Functional/Command/BuildCommandTest.php index ff4aa46f7..90f025743 100644 --- a/.vortex/installer/tests/Functional/Command/BuildCommandTest.php +++ b/.vortex/installer/tests/Functional/Command/BuildCommandTest.php @@ -147,27 +147,17 @@ public function testBuildCommand( /** * Data provider for testBuildWithMockedRunner. * - * @return array, - * expect_failure: bool, - * output_assertions: array, - * requirements_exit_callback?: ?\Closure, - * requirements_finder_callback?: ?\Closure, - * docker_compose_url?: ?string, - * before?: ?\Closure - * }> + * @return \Iterator, expect_failure: bool, output_assertions: array, requirements_exit_callback?: (\Closure | null), requirements_finder_callback?: (\Closure | null), docker_compose_url?: (string | null), before?: (\Closure | null)}> */ - public static function dataProviderBuildCommand(): array { - return [ - // ----------------------------------------------------------------------- - // Requirements check scenarios. - // ----------------------------------------------------------------------- - 'Build runs requirements check by default, success' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => [], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + public static function dataProviderBuildCommand(): \Iterator { + // ----------------------------------------------------------------------- + // Requirements check scenarios. + // ----------------------------------------------------------------------- + yield 'Build runs requirements check by default, success' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => [], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_CHECKING_REQUIREMENTS, TuiOutput::BUILD_BUILDING_SITE, @@ -176,15 +166,14 @@ public static function dataProviderBuildCommand(): array { TuiOutput::absent([ TuiOutput::BUILD_EXPORT_DATABASE, ]), - ), - 'requirements_exit_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - ], - - 'Requirements check fails - one missing, Docker' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => [], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + ), + 'requirements_exit_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + ]; + yield 'Requirements check fails - one missing, Docker' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => [], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_CHECKING_REQUIREMENTS, TuiOutput::CHECK_REQUIREMENTS_MISSING, @@ -193,16 +182,15 @@ public static function dataProviderBuildCommand(): array { TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_COMPLETED, ]), - ), - 'requirements_exit_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'requirements_finder_callback' => fn(string $name): ?string => $name === 'docker' ? NULL : '/usr/bin/' . $name, - ], - - 'Requirements check fails - all missing' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => [], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + ), + 'requirements_exit_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'requirements_finder_callback' => fn(string $name): ?string => $name === 'docker' ? NULL : '/usr/bin/' . $name, + ]; + yield 'Requirements check fails - all missing' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => [], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_CHECKING_REQUIREMENTS, TuiOutput::CHECK_REQUIREMENTS_MISSING, @@ -211,19 +199,18 @@ public static function dataProviderBuildCommand(): array { TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_COMPLETED, ]), - ), - 'requirements_exit_callback' => fn(string $current_command): int => RunnerInterface::EXIT_COMMAND_NOT_FOUND, - 'requirements_finder_callback' => fn(string $name): ?string => NULL, - ], - - // ----------------------------------------------------------------------- - // Basic build scenarios. - // ----------------------------------------------------------------------- - 'Build with skip requirements check, success' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + ), + 'requirements_exit_callback' => fn(string $current_command): int => RunnerInterface::EXIT_COMMAND_NOT_FOUND, + 'requirements_finder_callback' => fn(string $name): ?string => NULL, + ]; + // ----------------------------------------------------------------------- + // Basic build scenarios. + // ----------------------------------------------------------------------- + yield 'Build with skip requirements check, success' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_COMPLETED, @@ -232,21 +219,20 @@ public static function dataProviderBuildCommand(): array { TuiOutput::BUILD_CHECKING_REQUIREMENTS, TuiOutput::BUILD_EXPORT_DATABASE, ]), - ), + ), + ]; + // ----------------------------------------------------------------------- + // Profile flag scenarios. + // ----------------------------------------------------------------------- + yield 'Build with profile flag and skip requirements, success' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => [ + '--profile' => TRUE, + '--skip-requirements-check' => TRUE, ], - - // ----------------------------------------------------------------------- - // Profile flag scenarios. - // ----------------------------------------------------------------------- - 'Build with profile flag and skip requirements, success' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => [ - '--profile' => TRUE, - '--skip-requirements-check' => TRUE, - ], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_COMPLETED, @@ -255,48 +241,45 @@ public static function dataProviderBuildCommand(): array { TuiOutput::absent([ TuiOutput::BUILD_CHECKING_REQUIREMENTS, ]), - ), + ), + ]; + yield 'Build with profile flag and requirements check, success' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--profile' => TRUE], + 'expect_failure' => FALSE, + 'output_assertions' => TuiOutput::present([ + TuiOutput::BUILD_CHECKING_REQUIREMENTS, + TuiOutput::BUILD_BUILDING_SITE, + TuiOutput::BUILD_BUILD_COMPLETED, + TuiOutput::BUILD_EXPORT_DATABASE, + ]), + 'requirements_exit_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + ]; + yield 'Build with profile shows export database step' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => [ + '--profile' => TRUE, + '--skip-requirements-check' => TRUE, ], - - 'Build with profile flag and requirements check, success' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--profile' => TRUE], - 'expect_failure' => FALSE, - 'output_assertions' => TuiOutput::present([ - TuiOutput::BUILD_CHECKING_REQUIREMENTS, + 'expect_failure' => FALSE, + 'output_assertions' => [ + ...TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_COMPLETED, - TuiOutput::BUILD_EXPORT_DATABASE, ]), - 'requirements_exit_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + '* ' . TuiOutput::BUILD_EXPORT_DATABASE . ' ahoy export-db', ], - 'Build with profile shows export database step' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => [ - '--profile' => TRUE, - '--skip-requirements-check' => TRUE, - ], - 'expect_failure' => FALSE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::BUILD_BUILDING_SITE, - TuiOutput::BUILD_BUILD_COMPLETED, - ]), - '* ' . TuiOutput::BUILD_EXPORT_DATABASE . ' ahoy export-db', - ], - - ], - - // ----------------------------------------------------------------------- - // Build failure scenarios. - // ----------------------------------------------------------------------- - 'Build failure, ahoy build fails, exit code 1' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_FAILURE, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + ]; + // ----------------------------------------------------------------------- + // Build failure scenarios. + // ----------------------------------------------------------------------- + yield 'Build failure, ahoy build fails, exit code 1' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_FAILURE, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_FAILED, @@ -305,18 +288,17 @@ public static function dataProviderBuildCommand(): array { TuiOutput::absent([ TuiOutput::BUILD_BUILD_COMPLETED, ]), - ), + ), + ]; + yield 'Build failure with profile, ahoy build fails, exit code 1' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_FAILURE, + 'command_inputs' => [ + '--profile' => TRUE, + '--skip-requirements-check' => TRUE, ], - - 'Build failure with profile, ahoy build fails, exit code 1' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_FAILURE, - 'command_inputs' => [ - '--profile' => TRUE, - '--skip-requirements-check' => TRUE, - ], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_FAILED, @@ -326,15 +308,14 @@ public static function dataProviderBuildCommand(): array { TuiOutput::BUILD_BUILD_COMPLETED, TuiOutput::BUILD_EXPORT_DATABASE, ]), - ), - - ], + ), - 'Build failure, ahoy build fails, exit code 2' => [ - 'exit_code_callback' => fn(string $current_command): int => 2, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + ]; + yield 'Build failure, ahoy build fails, exit code 2' => [ + 'exit_code_callback' => fn(string $current_command): int => 2, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_FAILED, @@ -343,15 +324,14 @@ public static function dataProviderBuildCommand(): array { TuiOutput::absent([ TuiOutput::BUILD_BUILD_COMPLETED, ]), - ), + ), - ], - - 'Build failure, ahoy build fails, exit code 127' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_COMMAND_NOT_FOUND, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + ]; + yield 'Build failure, ahoy build fails, exit code 127' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_COMMAND_NOT_FOUND, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_FAILED, @@ -360,46 +340,43 @@ public static function dataProviderBuildCommand(): array { TuiOutput::absent([ TuiOutput::BUILD_BUILD_COMPLETED, ]), - ), + ), - ], - - 'Build failure shows log file path' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_FAILURE, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + ]; + yield 'Build failure shows log file path' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_FAILURE, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_FAILED, ]), ['* ' . TuiOutput::INSTALL_LOG_FILE . ' /tmp/mock.log'], - ), + ), - ], - - // ----------------------------------------------------------------------- - // Success output verification scenarios. - // ----------------------------------------------------------------------- - 'Build success shows log file path' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + ]; + // ----------------------------------------------------------------------- + // Success output verification scenarios. + // ----------------------------------------------------------------------- + yield 'Build success shows log file path' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_COMPLETED, ]), ['* ' . TuiOutput::INSTALL_LOG_FILE . ' /tmp/mock.log'], - ), - - ], + ), - 'Build success shows site URL from docker compose' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + ]; + yield 'Build success shows site URL from docker compose' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_COMPLETED, @@ -411,17 +388,16 @@ public static function dataProviderBuildCommand(): array { TuiOutput::absent([ 'your_site.docker.amazee.io', ]), - ), - 'requirements_exit_callback' => NULL, - 'requirements_finder_callback' => NULL, - 'docker_compose_url' => 'my-custom-project.docker.amazee.io', - ], - - 'Build success hides site URL when docker compose fails' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + ), + 'requirements_exit_callback' => NULL, + 'requirements_finder_callback' => NULL, + 'docker_compose_url' => 'my-custom-project.docker.amazee.io', + ]; + yield 'Build success hides site URL when docker compose fails' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::BUILD_BUILDING_SITE, TuiOutput::BUILD_BUILD_COMPLETED, @@ -431,70 +407,65 @@ public static function dataProviderBuildCommand(): array { TuiOutput::absent([ TuiOutput::BUILD_SITE_URL, ]), - ), - 'requirements_exit_callback' => NULL, - 'requirements_finder_callback' => NULL, - 'docker_compose_url' => NULL, - ], - - 'Build success shows next steps' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => FALSE, - 'output_assertions' => TuiOutput::present([ - TuiOutput::BUILD_BUILDING_SITE, - TuiOutput::BUILD_BUILD_COMPLETED, - TuiOutput::INSTALL_NEXT_STEPS, - TuiOutput::BUILD_REVIEW_DOCS, - ]), - - ], + ), + 'requirements_exit_callback' => NULL, + 'requirements_finder_callback' => NULL, + 'docker_compose_url' => NULL, + ]; + yield 'Build success shows next steps' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => FALSE, + 'output_assertions' => TuiOutput::present([ + TuiOutput::BUILD_BUILDING_SITE, + TuiOutput::BUILD_BUILD_COMPLETED, + TuiOutput::INSTALL_NEXT_STEPS, + TuiOutput::BUILD_REVIEW_DOCS, + ]), - 'Valid destination directory' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => FALSE, - 'output_assertions' => TuiOutput::present([TuiOutput::BUILD_BUILD_COMPLETED]), - 'requirements_exit_callback' => NULL, - 'requirements_finder_callback' => NULL, - 'docker_compose_url' => NULL, - 'before' => function (array $inputs, string $tmp): array { + ]; + yield 'Valid destination directory' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => FALSE, + 'output_assertions' => TuiOutput::present([TuiOutput::BUILD_BUILD_COMPLETED]), + 'requirements_exit_callback' => NULL, + 'requirements_finder_callback' => NULL, + 'docker_compose_url' => NULL, + 'before' => function (array $inputs, string $tmp): array { $dir = $tmp . '/valid_dest_' . uniqid(); File::mkdir($dir); $inputs['--destination'] = $dir; return $inputs; - }, - ], - - 'Destination is file instead of directory' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => TRUE, - 'output_assertions' => TuiOutput::present([TuiOutput::DESTINATION_NOT_EXIST]), - 'requirements_exit_callback' => NULL, - 'requirements_finder_callback' => NULL, - 'docker_compose_url' => NULL, - 'before' => function (array $inputs, string $tmp): array { + }, + ]; + yield 'Destination is file instead of directory' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => TRUE, + 'output_assertions' => TuiOutput::present([TuiOutput::DESTINATION_NOT_EXIST]), + 'requirements_exit_callback' => NULL, + 'requirements_finder_callback' => NULL, + 'docker_compose_url' => NULL, + 'before' => function (array $inputs, string $tmp): array { $file = $tmp . '/test_file_' . uniqid() . '.txt'; File::dump($file, 'test content'); $inputs['--destination'] = $file; return $inputs; - }, - ], - - 'Destination directory does not exist' => [ - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--skip-requirements-check' => TRUE], - 'expect_failure' => TRUE, - 'output_assertions' => TuiOutput::present([TuiOutput::DESTINATION_NOT_EXIST]), - 'requirements_exit_callback' => NULL, - 'requirements_finder_callback' => NULL, - 'docker_compose_url' => NULL, - 'before' => function (array $inputs, string $tmp): array { + }, + ]; + yield 'Destination directory does not exist' => [ + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--skip-requirements-check' => TRUE], + 'expect_failure' => TRUE, + 'output_assertions' => TuiOutput::present([TuiOutput::DESTINATION_NOT_EXIST]), + 'requirements_exit_callback' => NULL, + 'requirements_finder_callback' => NULL, + 'docker_compose_url' => NULL, + 'before' => function (array $inputs, string $tmp): array { $inputs['--destination'] = $tmp . '/non_existent_' . uniqid(); return $inputs; - }, - ], + }, ]; } diff --git a/.vortex/installer/tests/Functional/Command/CheckRequirementsCommandTest.php b/.vortex/installer/tests/Functional/Command/CheckRequirementsCommandTest.php index b39e172f9..6685ffc62 100644 --- a/.vortex/installer/tests/Functional/Command/CheckRequirementsCommandTest.php +++ b/.vortex/installer/tests/Functional/Command/CheckRequirementsCommandTest.php @@ -79,23 +79,15 @@ public function testCheckRequirementsCommand( /** * Data provider for testCheckRequirementsCommand. * - * @return array, - * expect_failure: bool, - * output_assertions: array, - * before?: ?\Closure - * }> + * @return \Iterator, expect_failure: bool, output_assertions: array, before?: (\Closure | null)}> */ - public static function dataProviderCheckRequirementsCommand(): array { - return [ - 'Check all requirements' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => [], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + public static function dataProviderCheckRequirementsCommand(): \Iterator { + yield 'Check all requirements' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => [], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_ALL_MET, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, @@ -106,15 +98,14 @@ public static function dataProviderCheckRequirementsCommand(): array { '* Ahoy: version 1.0.0', '* Pygmy: version 1.0.0', ], - ), - ], - - 'All requirements missing' => [ - 'executable_finder_callback' => fn(string $name): ?string => NULL, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_COMMAND_NOT_FOUND, - 'command_inputs' => [], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + ), + ]; + yield 'All requirements missing' => [ + 'executable_finder_callback' => fn(string $name): ?string => NULL, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_COMMAND_NOT_FOUND, + 'command_inputs' => [], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_MISSING, TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, @@ -129,30 +120,28 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, TuiOutput::CHECK_REQUIREMENTS_ALL_MET, ]), - ), - ], - - 'Check only Docker' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--only' => 'docker'], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + ), + ]; + yield 'Check only Docker' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--only' => 'docker'], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_ALL_MET, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, ]), ['* Docker: version 1.0.0'], ['! Ahoy:', '! Pygmy:'], - ), - ], - - 'Check only Docker and Ahoy' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--only' => 'docker,ahoy'], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + ), + ]; + yield 'Check only Docker and Ahoy' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--only' => 'docker,ahoy'], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_ALL_MET, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, @@ -162,15 +151,14 @@ public static function dataProviderCheckRequirementsCommand(): array { '* Ahoy: version 1.0.0', ], ['! Pygmy:'], - ), - ], - - 'Check with no-summary option' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--no-summary' => TRUE], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + ), + ]; + yield 'Check with no-summary option' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--no-summary' => TRUE], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_ALL_MET, ]), @@ -178,15 +166,14 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, ]), - ), - ], - - 'Docker missing' => [ - 'executable_finder_callback' => fn(string $name): ?string => $name === 'docker' ? NULL : '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--only' => 'docker'], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + ), + ]; + yield 'Docker missing' => [ + 'executable_finder_callback' => fn(string $name): ?string => $name === 'docker' ? NULL : '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--only' => 'docker'], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_MISSING, TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, @@ -196,15 +183,14 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::CHECK_REQUIREMENTS_DOCKER_AVAILABLE, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, ]), - ), - ], - - 'Ahoy missing' => [ - 'executable_finder_callback' => fn(string $name): ?string => $name === 'ahoy' ? NULL : '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--only' => 'ahoy'], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + ), + ]; + yield 'Ahoy missing' => [ + 'executable_finder_callback' => fn(string $name): ?string => $name === 'ahoy' ? NULL : '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--only' => 'ahoy'], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_MISSING, TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, @@ -214,15 +200,14 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::CHECK_REQUIREMENTS_AHOY_AVAILABLE, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, ]), - ), - ], - - 'Pygmy command not found' => [ - 'executable_finder_callback' => fn(string $name): ?string => $name === 'pygmy' ? NULL : '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--only' => 'pygmy'], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + ), + ]; + yield 'Pygmy command not found' => [ + 'executable_finder_callback' => fn(string $name): ?string => $name === 'pygmy' ? NULL : '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--only' => 'pygmy'], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_MISSING, TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, @@ -232,15 +217,14 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::CHECK_REQUIREMENTS_PYGMY_RUNNING, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, ]), - ), - ], - - 'Pygmy status command succeeds' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--only' => 'pygmy'], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + ), + ]; + yield 'Pygmy status command succeeds' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--only' => 'pygmy'], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_ALL_MET, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, @@ -249,21 +233,20 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::absent([ TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, ]), - ), - ], - - 'Pygmy status fails but amazeeio containers found' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => function (string $current_command): int { + ), + ]; + yield 'Pygmy status fails but amazeeio containers found' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => function (string $current_command): int { // Pygmy status fails. - if (str_contains($current_command, 'pygmy status')) { - return RunnerInterface::EXIT_FAILURE; - } + if (str_contains($current_command, 'pygmy status')) { + return RunnerInterface::EXIT_FAILURE; + } return RunnerInterface::EXIT_SUCCESS; - }, - 'command_inputs' => ['--only' => 'pygmy'], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + }, + 'command_inputs' => ['--only' => 'pygmy'], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_ALL_MET, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, @@ -272,25 +255,24 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::absent([ TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, ]), - ), - ], - - 'Pygmy status fails and no amazeeio containers' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => function (string $current_command): int { + ), + ]; + yield 'Pygmy status fails and no amazeeio containers' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => function (string $current_command): int { // Pygmy status fails. - if (str_contains($current_command, 'pygmy status')) { - return RunnerInterface::EXIT_FAILURE; - } + if (str_contains($current_command, 'pygmy status')) { + return RunnerInterface::EXIT_FAILURE; + } // No amazeeio containers. - if (str_contains($current_command, 'docker ps') && str_contains($current_command, 'amazeeio')) { - return RunnerInterface::EXIT_FAILURE; - } + if (str_contains($current_command, 'docker ps') && str_contains($current_command, 'amazeeio')) { + return RunnerInterface::EXIT_FAILURE; + } return RunnerInterface::EXIT_SUCCESS; - }, - 'command_inputs' => ['--only' => 'pygmy'], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + }, + 'command_inputs' => ['--only' => 'pygmy'], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_MISSING, TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, @@ -300,15 +282,14 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::CHECK_REQUIREMENTS_PYGMY_RUNNING, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, ]), - ), - ], - - 'Docker Compose via modern syntax' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--only' => 'docker-compose'], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + ), + ]; + yield 'Docker Compose via modern syntax' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--only' => 'docker-compose'], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_ALL_MET, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, @@ -317,21 +298,20 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::absent([ TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, ]), - ), - ], - - 'Docker Compose via legacy command' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => function (string $current_command): int { + ), + ]; + yield 'Docker Compose via legacy command' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => function (string $current_command): int { // Modern syntax fails. - if (str_contains($current_command, 'docker compose version')) { - return RunnerInterface::EXIT_COMMAND_NOT_FOUND; - } + if (str_contains($current_command, 'docker compose version')) { + return RunnerInterface::EXIT_COMMAND_NOT_FOUND; + } return RunnerInterface::EXIT_SUCCESS; - }, - 'command_inputs' => ['--only' => 'docker-compose'], - 'expect_failure' => FALSE, - 'output_assertions' => array_merge( + }, + 'command_inputs' => ['--only' => 'docker-compose'], + 'expect_failure' => FALSE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_ALL_MET, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, @@ -340,21 +320,20 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::absent([ TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, ]), - ), - ], - - 'Docker Compose missing completely' => [ - 'executable_finder_callback' => fn(string $name): ?string => $name === 'docker-compose' ? NULL : '/usr/bin/' . $name, - 'exit_code_callback' => function (string $current_command): int { + ), + ]; + yield 'Docker Compose missing completely' => [ + 'executable_finder_callback' => fn(string $name): ?string => $name === 'docker-compose' ? NULL : '/usr/bin/' . $name, + 'exit_code_callback' => function (string $current_command): int { // Modern docker compose command fails. - if (str_contains($current_command, 'docker compose version')) { - return RunnerInterface::EXIT_COMMAND_NOT_FOUND; - } + if (str_contains($current_command, 'docker compose version')) { + return RunnerInterface::EXIT_COMMAND_NOT_FOUND; + } return RunnerInterface::EXIT_SUCCESS; - }, - 'command_inputs' => ['--only' => 'docker-compose'], - 'expect_failure' => TRUE, - 'output_assertions' => array_merge( + }, + 'command_inputs' => ['--only' => 'docker-compose'], + 'expect_failure' => TRUE, + 'output_assertions' => array_merge( TuiOutput::present([ TuiOutput::CHECK_REQUIREMENTS_MISSING, TuiOutput::CHECK_REQUIREMENTS_MISSING_LABEL, @@ -364,70 +343,64 @@ public static function dataProviderCheckRequirementsCommand(): array { TuiOutput::CHECK_REQUIREMENTS_DOCKER_COMPOSE_AVAILABLE, TuiOutput::CHECK_REQUIREMENTS_PRESENT_LABEL, ]), - ), - ], - - 'Invalid requirement name' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--only' => 'invalid'], - 'expect_failure' => TRUE, - 'output_assertions' => [ - '* ' . TuiOutput::CHECK_REQUIREMENTS_UNKNOWN . ' invalid', - '* Available: docker, docker-compose, ahoy', - ], + ), + ]; + yield 'Invalid requirement name' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--only' => 'invalid'], + 'expect_failure' => TRUE, + 'output_assertions' => [ + '* ' . TuiOutput::CHECK_REQUIREMENTS_UNKNOWN . ' invalid', + '* Available: docker, docker-compose, ahoy', ], - - 'Mixed valid and invalid requirements' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => ['--only' => 'docker,invalid'], - 'expect_failure' => TRUE, - 'output_assertions' => [ - '* ' . TuiOutput::CHECK_REQUIREMENTS_UNKNOWN . ' invalid', - '* Available: docker, docker-compose, ahoy', - ], + ]; + yield 'Mixed valid and invalid requirements' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => ['--only' => 'docker,invalid'], + 'expect_failure' => TRUE, + 'output_assertions' => [ + '* ' . TuiOutput::CHECK_REQUIREMENTS_UNKNOWN . ' invalid', + '* Available: docker, docker-compose, ahoy', ], - - 'Valid destination directory' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => [], - 'expect_failure' => FALSE, - 'output_assertions' => TuiOutput::present([TuiOutput::CHECK_REQUIREMENTS_ALL_MET]), - 'before' => function (array $inputs, string $tmp): array { + ]; + yield 'Valid destination directory' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => [], + 'expect_failure' => FALSE, + 'output_assertions' => TuiOutput::present([TuiOutput::CHECK_REQUIREMENTS_ALL_MET]), + 'before' => function (array $inputs, string $tmp): array { $dir = $tmp . '/valid_dest_' . uniqid(); File::mkdir($dir); $inputs['--destination'] = $dir; return $inputs; - }, - ], - - 'Destination is file instead of directory' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => [], - 'expect_failure' => TRUE, - 'output_assertions' => TuiOutput::present([TuiOutput::DESTINATION_NOT_EXIST]), - 'before' => function (array $inputs, string $tmp): array { + }, + ]; + yield 'Destination is file instead of directory' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => [], + 'expect_failure' => TRUE, + 'output_assertions' => TuiOutput::present([TuiOutput::DESTINATION_NOT_EXIST]), + 'before' => function (array $inputs, string $tmp): array { $file = $tmp . '/test_file_' . uniqid() . '.txt'; File::dump($file, 'test content'); $inputs['--destination'] = $file; return $inputs; - }, - ], - - 'Destination directory does not exist' => [ - 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, - 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, - 'command_inputs' => [], - 'expect_failure' => TRUE, - 'output_assertions' => TuiOutput::present([TuiOutput::DESTINATION_NOT_EXIST]), - 'before' => function (array $inputs, string $tmp): array { + }, + ]; + yield 'Destination directory does not exist' => [ + 'executable_finder_callback' => fn(string $name): string => '/usr/bin/' . $name, + 'exit_code_callback' => fn(string $current_command): int => RunnerInterface::EXIT_SUCCESS, + 'command_inputs' => [], + 'expect_failure' => TRUE, + 'output_assertions' => TuiOutput::present([TuiOutput::DESTINATION_NOT_EXIST]), + 'before' => function (array $inputs, string $tmp): array { $inputs['--destination'] = $tmp . '/non_existent_' . uniqid(); return $inputs; - }, - ], + }, ]; } diff --git a/.vortex/installer/tests/Functional/Command/InstallCommandTest.php b/.vortex/installer/tests/Functional/Command/InstallCommandTest.php index 411588f09..58433e317 100644 --- a/.vortex/installer/tests/Functional/Command/InstallCommandTest.php +++ b/.vortex/installer/tests/Functional/Command/InstallCommandTest.php @@ -129,390 +129,369 @@ public function testInstallCommand( /** * Data provider for testInstallCommand. * - * @return array, - * install_executable_finder_find_callback: \Closure, - * build_runner_exit_callback: \Closure, - * check_requirements_runner_exit_callback: \Closure, - * expect_failure: bool, - * output_assertions: array, - * download_should_fail?: bool - * }> + * @return \Iterator, install_executable_finder_find_callback: \Closure, build_runner_exit_callback: \Closure, check_requirements_runner_exit_callback: \Closure, expect_failure: bool, output_assertions: array, download_should_fail?: bool}> */ - public static function dataProviderInstallCommand(): array { - return [ - 'Install without build flag, skips build' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, + public static function dataProviderInstallCommand(): \Iterator { + yield 'Install without build flag, skips build' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + ]), + 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, + 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'expect_failure' => FALSE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_STARTING, + TuiOutput::INSTALL_DOWNLOADING, + TuiOutput::INSTALL_CUSTOMIZING, + TuiOutput::INSTALL_PREPARING_DESTINATION, + TuiOutput::INSTALL_COPYING_FILES, + TuiOutput::INSTALL_PREPARING_DEMO, + TuiOutput::FOOTER_FINISHED_INSTALLING, + TuiOutput::FOOTER_GIT_ADD, + TuiOutput::FOOTER_GIT_COMMIT, + TuiOutput::FOOTER_READY_TO_BUILD, + TuiOutput::FOOTER_BUILD_THE_SITE, + TuiOutput::FOOTER_AHOY_BUILD, + TuiOutput::POSTBUILD_SETUP_GHA, ]), - 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, - 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'expect_failure' => FALSE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_STARTING, - TuiOutput::INSTALL_DOWNLOADING, - TuiOutput::INSTALL_CUSTOMIZING, - TuiOutput::INSTALL_PREPARING_DESTINATION, - TuiOutput::INSTALL_COPYING_FILES, - TuiOutput::INSTALL_PREPARING_DEMO, - TuiOutput::FOOTER_FINISHED_INSTALLING, - TuiOutput::FOOTER_GIT_ADD, - TuiOutput::FOOTER_GIT_COMMIT, - TuiOutput::FOOTER_READY_TO_BUILD, - TuiOutput::FOOTER_BUILD_THE_SITE, - TuiOutput::FOOTER_AHOY_BUILD, - TuiOutput::POSTBUILD_SETUP_GHA, - ]), - ...TuiOutput::absent([ - TuiOutput::INSTALL_BUILDING, - TuiOutput::FOOTER_SITE_READY, - ]), - ], - ], - - 'Install with config JSON string succeeds' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, - InstallCommand::OPTION_CONFIG => '{"VORTEX_PROJECT_NAME":"test_project"}', + ...TuiOutput::absent([ + TuiOutput::INSTALL_BUILDING, + TuiOutput::FOOTER_SITE_READY, ]), - 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, - 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'expect_failure' => FALSE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_STARTING, - TuiOutput::INSTALL_DOWNLOADING, - TuiOutput::INSTALL_CUSTOMIZING, - ]), - ], ], - - 'Install with no-cleanup flag succeeds' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, - InstallCommand::OPTION_NO_CLEANUP => TRUE, + ]; + yield 'Install with config JSON string succeeds' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + InstallCommand::OPTION_CONFIG => '{"VORTEX_PROJECT_NAME":"test_project"}', + ]), + 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, + 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'expect_failure' => FALSE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_STARTING, + TuiOutput::INSTALL_DOWNLOADING, + TuiOutput::INSTALL_CUSTOMIZING, ]), - 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, - 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'expect_failure' => FALSE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_STARTING, - TuiOutput::INSTALL_DOWNLOADING, - TuiOutput::INSTALL_CUSTOMIZING, - ]), - ], ], - - // ----------------------------------------------------------------------- - // Install command fails requirements check. - // ----------------------------------------------------------------------- - 'Requirements of install command check fails, missing git' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, + ]; + yield 'Install with no-cleanup flag succeeds' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + InstallCommand::OPTION_NO_CLEANUP => TRUE, + ]), + 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, + 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'expect_failure' => FALSE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_STARTING, + TuiOutput::INSTALL_DOWNLOADING, + TuiOutput::INSTALL_CUSTOMIZING, ]), - 'install_executable_finder_find_callback' => function (string $command): ?string { + ], + ]; + // ----------------------------------------------------------------------- + // Install command fails requirements check. + // ----------------------------------------------------------------------- + yield 'Requirements of install command check fails, missing git' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + ]), + 'install_executable_finder_find_callback' => function (string $command): ?string { // Git command fails. - if (str_contains($command, 'git')) { - return NULL; - } + if (str_contains($command, 'git')) { + return NULL; + } return '/usr/bin/' . $command; - }, - 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'expect_failure' => TRUE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_ERROR_MISSING_GIT, - ]), - ...TuiOutput::absent([ - TuiOutput::INSTALL_STARTING, - ]), - ], - ], - - 'Requirements of install command check fails, missing tar' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, + }, + 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'expect_failure' => TRUE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_ERROR_MISSING_GIT, + ]), + ...TuiOutput::absent([ + TuiOutput::INSTALL_STARTING, ]), - 'install_executable_finder_find_callback' => function (string $command): ?string { + ], + ]; + yield 'Requirements of install command check fails, missing tar' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + ]), + 'install_executable_finder_find_callback' => function (string $command): ?string { // Tar command fails. - if (str_contains($command, 'tar')) { - return NULL; - } + if (str_contains($command, 'tar')) { + return NULL; + } return '/usr/bin/' . $command; - }, - - 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'expect_failure' => TRUE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_ERROR_MISSING_TAR, - ]), - ...TuiOutput::absent([ - TuiOutput::INSTALL_STARTING, - ]), - ], - ], - - 'Requirements of install command check fails, missing composer' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, + }, + + 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'expect_failure' => TRUE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_ERROR_MISSING_TAR, + ]), + ...TuiOutput::absent([ + TuiOutput::INSTALL_STARTING, ]), - 'install_executable_finder_find_callback' => function (string $command): ?string { + ], + ]; + yield 'Requirements of install command check fails, missing composer' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + ]), + 'install_executable_finder_find_callback' => function (string $command): ?string { // Composer command fails. - if (str_contains($command, 'composer')) { - return NULL; - } + if (str_contains($command, 'composer')) { + return NULL; + } return '/usr/bin/' . $command; - }, - - 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'expect_failure' => TRUE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_ERROR_MISSING_COMPOSER, - ]), - ...TuiOutput::absent([ - TuiOutput::INSTALL_STARTING, - ]), - ], - ], - - 'Requirements of install command check fails, multiple missing tools' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, + }, + + 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'expect_failure' => TRUE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_ERROR_MISSING_COMPOSER, + ]), + ...TuiOutput::absent([ + TuiOutput::INSTALL_STARTING, ]), - 'install_executable_finder_find_callback' => function (string $command): ?string { + ], + ]; + yield 'Requirements of install command check fails, multiple missing tools' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + ]), + 'install_executable_finder_find_callback' => function (string $command): ?string { // Both git and curl commands fails. - if (str_contains($command, 'git')) { - return NULL; - } + if (str_contains($command, 'git')) { + return NULL; + } - if (str_contains($command, 'curl')) { - return NULL; - } + if (str_contains($command, 'curl')) { + return NULL; + } return '/usr/bin/' . $command; - }, - 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'expect_failure' => TRUE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_ERROR_MISSING_GIT, - ]), - ...TuiOutput::absent([ - TuiOutput::INSTALL_STARTING, - ]), - ], - ], - - // ----------------------------------------------------------------------- - // Download failures. - // ----------------------------------------------------------------------- - 'Download fails' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, + }, + 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'expect_failure' => TRUE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_ERROR_MISSING_GIT, + ]), + ...TuiOutput::absent([ + TuiOutput::INSTALL_STARTING, ]), - 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, - 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, - 'expect_failure' => TRUE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_STARTING, - TuiOutput::INSTALL_DOWNLOADING, - TuiOutput::INSTALL_ERROR_DOWNLOAD_FAILED, - ]), - ...TuiOutput::absent([ - TuiOutput::INSTALL_CUSTOMIZING, - TuiOutput::INSTALL_PREPARING_DESTINATION, - ]), - ], - 'download_should_fail' => TRUE, ], - - // ----------------------------------------------------------------------- - // Sub-commands: build with check-requirements. - // ----------------------------------------------------------------------- - 'Install with build flag succeeds' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, - InstallCommand::OPTION_BUILD => TRUE, + ]; + // ----------------------------------------------------------------------- + // Download failures. + // ----------------------------------------------------------------------- + yield 'Download fails' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + ]), + 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, + 'build_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'check_requirements_runner_exit_callback' => fn(string $command): int => RunnerInterface::EXIT_SUCCESS, + 'expect_failure' => TRUE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_STARTING, + TuiOutput::INSTALL_DOWNLOADING, + TuiOutput::INSTALL_ERROR_DOWNLOAD_FAILED, + ]), + ...TuiOutput::absent([ + TuiOutput::INSTALL_CUSTOMIZING, + TuiOutput::INSTALL_PREPARING_DESTINATION, ]), - 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, - 'build_runner_exit_callback' => TuiOutput::buildRunnerSuccess(), - 'check_requirements_runner_exit_callback' => TuiOutput::checkRequirementsSuccess(), - 'expect_failure' => FALSE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_STARTING, - TuiOutput::INSTALL_DOWNLOADING, - TuiOutput::INSTALL_CUSTOMIZING, - TuiOutput::INSTALL_PREPARING_DESTINATION, - TuiOutput::INSTALL_COPYING_FILES, - TuiOutput::INSTALL_PREPARING_DEMO, - TuiOutput::INSTALL_BUILDING, - TuiOutput::INSTALL_BUILD_SUCCESS, - TuiOutput::FOOTER_FINISHED_INSTALLING, - TuiOutput::FOOTER_GIT_ADD, - TuiOutput::FOOTER_GIT_COMMIT, - TuiOutput::FOOTER_SITE_READY, - TuiOutput::FOOTER_GET_SITE_INFO, - TuiOutput::FOOTER_AHOY_INFO, - TuiOutput::INSTALL_LOGIN, - TuiOutput::FOOTER_AHOY_LOGIN, - TuiOutput::POSTBUILD_SETUP_GHA, - ]), - ...TuiOutput::absent([ - TuiOutput::FOOTER_READY_TO_BUILD, - TuiOutput::FOOTER_BUILD_ERRORS, - ]), - ], ], - - 'Install with build flag and profile starter succeeds' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, - InstallCommand::OPTION_BUILD => TRUE, - InstallCommand::OPTION_CONFIG => '{"VORTEX_STARTER":"install_profile_core"}', + 'download_should_fail' => TRUE, + ]; + // ----------------------------------------------------------------------- + // Sub-commands: build with check-requirements. + // ----------------------------------------------------------------------- + yield 'Install with build flag succeeds' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + InstallCommand::OPTION_BUILD => TRUE, + ]), + 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, + 'build_runner_exit_callback' => TuiOutput::buildRunnerSuccess(), + 'check_requirements_runner_exit_callback' => TuiOutput::checkRequirementsSuccess(), + 'expect_failure' => FALSE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_STARTING, + TuiOutput::INSTALL_DOWNLOADING, + TuiOutput::INSTALL_CUSTOMIZING, + TuiOutput::INSTALL_PREPARING_DESTINATION, + TuiOutput::INSTALL_COPYING_FILES, + TuiOutput::INSTALL_PREPARING_DEMO, + TuiOutput::INSTALL_BUILDING, + TuiOutput::INSTALL_BUILD_SUCCESS, + TuiOutput::FOOTER_FINISHED_INSTALLING, + TuiOutput::FOOTER_GIT_ADD, + TuiOutput::FOOTER_GIT_COMMIT, + TuiOutput::FOOTER_SITE_READY, + TuiOutput::FOOTER_GET_SITE_INFO, + TuiOutput::FOOTER_AHOY_INFO, + TuiOutput::INSTALL_LOGIN, + TuiOutput::FOOTER_AHOY_LOGIN, + TuiOutput::POSTBUILD_SETUP_GHA, ]), - 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, - 'build_runner_exit_callback' => TuiOutput::buildRunnerSuccessProfile(), - 'check_requirements_runner_exit_callback' => TuiOutput::checkRequirementsSuccess(), - 'expect_failure' => FALSE, - 'output_assertions' => [ + ...TuiOutput::absent([ + TuiOutput::FOOTER_READY_TO_BUILD, + TuiOutput::FOOTER_BUILD_ERRORS, + ]), + ], + ]; + yield 'Install with build flag and profile starter succeeds' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + InstallCommand::OPTION_BUILD => TRUE, + InstallCommand::OPTION_CONFIG => '{"VORTEX_STARTER":"install_profile_core"}', + ]), + 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, + 'build_runner_exit_callback' => TuiOutput::buildRunnerSuccessProfile(), + 'check_requirements_runner_exit_callback' => TuiOutput::checkRequirementsSuccess(), + 'expect_failure' => FALSE, + 'output_assertions' => [ // Install command output - should be present. - ...TuiOutput::present([ - TuiOutput::INSTALL_STARTING, - TuiOutput::INSTALL_DOWNLOADING, - TuiOutput::INSTALL_CUSTOMIZING, - TuiOutput::INSTALL_PREPARING_DESTINATION, - TuiOutput::INSTALL_COPYING_FILES, - TuiOutput::INSTALL_PREPARING_DEMO, - TuiOutput::INSTALL_BUILDING, - ]), + ...TuiOutput::present([ + TuiOutput::INSTALL_STARTING, + TuiOutput::INSTALL_DOWNLOADING, + TuiOutput::INSTALL_CUSTOMIZING, + TuiOutput::INSTALL_PREPARING_DESTINATION, + TuiOutput::INSTALL_COPYING_FILES, + TuiOutput::INSTALL_PREPARING_DEMO, + TuiOutput::INSTALL_BUILDING, + ]), // Check requirements output - should be present. - ...TuiOutput::present([ - TuiOutput::CHECK_REQUIREMENTS_CHECKING_DOCKER, - TuiOutput::CHECK_REQUIREMENTS_CHECKING_DOCKER_COMPOSE, - TuiOutput::CHECK_REQUIREMENTS_CHECKING_AHOY, - TuiOutput::CHECK_REQUIREMENTS_CHECKING_PYGMY, - TuiOutput::CHECK_REQUIREMENTS_DOCKER_AVAILABLE, - TuiOutput::CHECK_REQUIREMENTS_DOCKER_COMPOSE_AVAILABLE, - TuiOutput::CHECK_REQUIREMENTS_AHOY_AVAILABLE, - TuiOutput::CHECK_REQUIREMENTS_PYGMY_RUNNING, - TuiOutput::CHECK_REQUIREMENTS_ALL_MET, - ]), + ...TuiOutput::present([ + TuiOutput::CHECK_REQUIREMENTS_CHECKING_DOCKER, + TuiOutput::CHECK_REQUIREMENTS_CHECKING_DOCKER_COMPOSE, + TuiOutput::CHECK_REQUIREMENTS_CHECKING_AHOY, + TuiOutput::CHECK_REQUIREMENTS_CHECKING_PYGMY, + TuiOutput::CHECK_REQUIREMENTS_DOCKER_AVAILABLE, + TuiOutput::CHECK_REQUIREMENTS_DOCKER_COMPOSE_AVAILABLE, + TuiOutput::CHECK_REQUIREMENTS_AHOY_AVAILABLE, + TuiOutput::CHECK_REQUIREMENTS_PYGMY_RUNNING, + TuiOutput::CHECK_REQUIREMENTS_ALL_MET, + ]), // Build output (profile) - should be present. - ...TuiOutput::present([ - TuiOutput::BUILD_ASSEMBLE_DOCKER, - TuiOutput::BUILD_ASSEMBLE_COMPOSER, - TuiOutput::BUILD_ASSEMBLE_YARN, - TuiOutput::BUILD_PROVISION_START, - TuiOutput::BUILD_PROVISION_PROJECT_INFO, - TuiOutput::BUILD_PROVISION_TYPE_PROFILE, - TuiOutput::BUILD_PROVISION_END, - ]), + ...TuiOutput::present([ + TuiOutput::BUILD_ASSEMBLE_DOCKER, + TuiOutput::BUILD_ASSEMBLE_COMPOSER, + TuiOutput::BUILD_ASSEMBLE_YARN, + TuiOutput::BUILD_PROVISION_START, + TuiOutput::BUILD_PROVISION_PROJECT_INFO, + TuiOutput::BUILD_PROVISION_TYPE_PROFILE, + TuiOutput::BUILD_PROVISION_END, + ]), // Final install output - should be present. - ...TuiOutput::present([ - TuiOutput::INSTALL_BUILD_SUCCESS, - TuiOutput::FOOTER_FINISHED_INSTALLING, - TuiOutput::FOOTER_GIT_ADD, - TuiOutput::FOOTER_GIT_COMMIT, - TuiOutput::FOOTER_SITE_READY, - TuiOutput::FOOTER_GET_SITE_INFO, - TuiOutput::FOOTER_AHOY_INFO, - TuiOutput::INSTALL_LOGIN, - TuiOutput::FOOTER_AHOY_LOGIN, - TuiOutput::POSTBUILD_SETUP_GHA, - ]), + ...TuiOutput::present([ + TuiOutput::INSTALL_BUILD_SUCCESS, + TuiOutput::FOOTER_FINISHED_INSTALLING, + TuiOutput::FOOTER_GIT_ADD, + TuiOutput::FOOTER_GIT_COMMIT, + TuiOutput::FOOTER_SITE_READY, + TuiOutput::FOOTER_GET_SITE_INFO, + TuiOutput::FOOTER_AHOY_INFO, + TuiOutput::INSTALL_LOGIN, + TuiOutput::FOOTER_AHOY_LOGIN, + TuiOutput::POSTBUILD_SETUP_GHA, + ]), // Negative assertions - should be absent. - ...TuiOutput::absent([ - TuiOutput::BUILD_PROVISION_TYPE_DB, - TuiOutput::INSTALL_BUILD_FAILED, - TuiOutput::INSTALL_EXIT_CODE, - TuiOutput::CHECK_REQUIREMENTS_MISSING, - TuiOutput::CHECK_REQUIREMENTS_DOCKER_MISSING, - TuiOutput::CHECK_REQUIREMENTS_DOCKER_COMPOSE_MISSING, - TuiOutput::CHECK_REQUIREMENTS_AHOY_MISSING, - TuiOutput::CHECK_REQUIREMENTS_PYGMY_NOT_RUNNING, - TuiOutput::FOOTER_READY_TO_BUILD, - TuiOutput::FOOTER_BUILD_ERRORS, - ]), - ], + ...TuiOutput::absent([ + TuiOutput::BUILD_PROVISION_TYPE_DB, + TuiOutput::INSTALL_BUILD_FAILED, + TuiOutput::INSTALL_EXIT_CODE, + TuiOutput::CHECK_REQUIREMENTS_MISSING, + TuiOutput::CHECK_REQUIREMENTS_DOCKER_MISSING, + TuiOutput::CHECK_REQUIREMENTS_DOCKER_COMPOSE_MISSING, + TuiOutput::CHECK_REQUIREMENTS_AHOY_MISSING, + TuiOutput::CHECK_REQUIREMENTS_PYGMY_NOT_RUNNING, + TuiOutput::FOOTER_READY_TO_BUILD, + TuiOutput::FOOTER_BUILD_ERRORS, + ]), ], - - 'Install with build flag fails' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, - InstallCommand::OPTION_BUILD => TRUE, + ]; + yield 'Install with build flag fails' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + InstallCommand::OPTION_BUILD => TRUE, + ]), + 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, + 'build_runner_exit_callback' => TuiOutput::buildRunnerFailure(), + 'check_requirements_runner_exit_callback' => TuiOutput::checkRequirementsSuccess(), + 'expect_failure' => TRUE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_STARTING, + TuiOutput::INSTALL_DOWNLOADING, + TuiOutput::INSTALL_CUSTOMIZING, + TuiOutput::INSTALL_PREPARING_DESTINATION, + TuiOutput::INSTALL_COPYING_FILES, + TuiOutput::INSTALL_PREPARING_DEMO, + TuiOutput::INSTALL_BUILDING, + TuiOutput::INSTALL_BUILD_FAILED, + TuiOutput::FOOTER_FINISHED_INSTALLING, + TuiOutput::FOOTER_GIT_ADD, + TuiOutput::FOOTER_GIT_COMMIT, + TuiOutput::FOOTER_BUILD_ERRORS, + TuiOutput::FOOTER_BUILD_FAILED_MESSAGE, + TuiOutput::FOOTER_TROUBLESHOOTING, + TuiOutput::FOOTER_CHECK_LOGS, + TuiOutput::FOOTER_AHOY_BUILD, + TuiOutput::FOOTER_DIAGNOSTICS, + ]), + ...TuiOutput::absent([ + TuiOutput::INSTALL_BUILD_SUCCESS, + TuiOutput::FOOTER_SITE_READY, + TuiOutput::FOOTER_READY_TO_BUILD, ]), - 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, - 'build_runner_exit_callback' => TuiOutput::buildRunnerFailure(), - 'check_requirements_runner_exit_callback' => TuiOutput::checkRequirementsSuccess(), - 'expect_failure' => TRUE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_STARTING, - TuiOutput::INSTALL_DOWNLOADING, - TuiOutput::INSTALL_CUSTOMIZING, - TuiOutput::INSTALL_PREPARING_DESTINATION, - TuiOutput::INSTALL_COPYING_FILES, - TuiOutput::INSTALL_PREPARING_DEMO, - TuiOutput::INSTALL_BUILDING, - TuiOutput::INSTALL_BUILD_FAILED, - TuiOutput::FOOTER_FINISHED_INSTALLING, - TuiOutput::FOOTER_GIT_ADD, - TuiOutput::FOOTER_GIT_COMMIT, - TuiOutput::FOOTER_BUILD_ERRORS, - TuiOutput::FOOTER_BUILD_FAILED_MESSAGE, - TuiOutput::FOOTER_TROUBLESHOOTING, - TuiOutput::FOOTER_CHECK_LOGS, - TuiOutput::FOOTER_AHOY_BUILD, - TuiOutput::FOOTER_DIAGNOSTICS, - ]), - ...TuiOutput::absent([ - TuiOutput::INSTALL_BUILD_SUCCESS, - TuiOutput::FOOTER_SITE_READY, - TuiOutput::FOOTER_READY_TO_BUILD, - ]), - ], ], - - 'Install with build flag and requirements of check-requirements command check fails' => [ - 'command_inputs' => self::tuiOptions([ - InstallCommand::OPTION_NO_INTERACTION => TRUE, - InstallCommand::OPTION_BUILD => TRUE, + ]; + yield 'Install with build flag and requirements of check-requirements command check fails' => [ + 'command_inputs' => self::tuiOptions([ + InstallCommand::OPTION_NO_INTERACTION => TRUE, + InstallCommand::OPTION_BUILD => TRUE, + ]), + 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, + 'build_runner_exit_callback' => TuiOutput::buildRunnerSuccess(), + 'check_requirements_runner_exit_callback' => TuiOutput::checkRequirementsFailure(), + 'expect_failure' => TRUE, + 'output_assertions' => [ + ...TuiOutput::present([ + TuiOutput::INSTALL_STARTING, + TuiOutput::INSTALL_DOWNLOADING, + TuiOutput::INSTALL_CUSTOMIZING, + TuiOutput::INSTALL_PREPARING_DESTINATION, + TuiOutput::INSTALL_COPYING_FILES, + TuiOutput::INSTALL_PREPARING_DEMO, + TuiOutput::INSTALL_BUILDING, + TuiOutput::BUILD_CHECKING_REQUIREMENTS, + TuiOutput::CHECK_REQUIREMENTS_MISSING, + ]), + ...TuiOutput::absent([ + TuiOutput::CHECK_REQUIREMENTS_ALL_MET, + TuiOutput::INSTALL_BUILD_SUCCESS, ]), - 'install_executable_finder_find_callback' => fn(string $command): string => '/usr/bin/' . $command, - 'build_runner_exit_callback' => TuiOutput::buildRunnerSuccess(), - 'check_requirements_runner_exit_callback' => TuiOutput::checkRequirementsFailure(), - 'expect_failure' => TRUE, - 'output_assertions' => [ - ...TuiOutput::present([ - TuiOutput::INSTALL_STARTING, - TuiOutput::INSTALL_DOWNLOADING, - TuiOutput::INSTALL_CUSTOMIZING, - TuiOutput::INSTALL_PREPARING_DESTINATION, - TuiOutput::INSTALL_COPYING_FILES, - TuiOutput::INSTALL_PREPARING_DEMO, - TuiOutput::INSTALL_BUILDING, - TuiOutput::BUILD_CHECKING_REQUIREMENTS, - TuiOutput::CHECK_REQUIREMENTS_MISSING, - ]), - ...TuiOutput::absent([ - TuiOutput::CHECK_REQUIREMENTS_ALL_MET, - TuiOutput::INSTALL_BUILD_SUCCESS, - ]), - ], ], ]; } diff --git a/.vortex/installer/tests/Functional/Command/SchemaValidateCommandTest.php b/.vortex/installer/tests/Functional/Command/SchemaValidateCommandTest.php index 89aa09773..dadee8451 100644 --- a/.vortex/installer/tests/Functional/Command/SchemaValidateCommandTest.php +++ b/.vortex/installer/tests/Functional/Command/SchemaValidateCommandTest.php @@ -199,12 +199,11 @@ public function testValidate(?string $config, array $expectations): void { /** * Data provider for testValidate. */ - public static function dataProviderValidate(): array { - return [ - // Valid configs. - 'full config with lagoon hosting' => ['valid_full.json', ['valid' => TRUE]], - 'minimal config with defaults' => [ - 'valid_minimal.json', + public static function dataProviderValidate(): \Iterator { + // Valid configs. + yield 'full config with lagoon hosting' => ['valid_full.json', ['valid' => TRUE]]; + yield 'minimal config with defaults' => [ + 'valid_minimal.json', [ 'valid' => TRUE, 'resolved' => [ @@ -213,59 +212,53 @@ public static function dataProviderValidate(): array { Name::id() => 'Minimal Site', ], ], - ], - 'config using env var key names' => ['valid_env_keys.json', ['valid' => TRUE]], - 'database provision with container registry' => ['valid_database_provision.json', ['valid' => TRUE]], - 'migration enabled' => ['valid_migration.json', ['valid' => TRUE]], - 'acquia hosting' => ['valid_acquia.json', ['valid' => TRUE]], - - // Invalid configs. - 'invalid hosting provider value' => [ - 'invalid_hosting_provider.json', + ]; + yield 'config using env var key names' => ['valid_env_keys.json', ['valid' => TRUE]]; + yield 'database provision with container registry' => ['valid_database_provision.json', ['valid' => TRUE]]; + yield 'migration enabled' => ['valid_migration.json', ['valid' => TRUE]]; + yield 'acquia hosting' => ['valid_acquia.json', ['valid' => TRUE]]; + // Invalid configs. + yield 'invalid hosting provider value' => [ + 'invalid_hosting_provider.json', ['valid' => FALSE, 'error_prompt' => HostingProvider::id(), 'error_message' => 'aws'], - ], - 'non-boolean for confirm field' => [ - 'invalid_confirm_not_boolean.json', + ]; + yield 'non-boolean for confirm field' => [ + 'invalid_confirm_not_boolean.json', ['valid' => FALSE, 'error_prompt' => Migration::id(), 'error_message' => 'Expected boolean'], - ], - 'invalid database download source' => [ - 'invalid_database_source.json', + ]; + yield 'invalid database download source' => [ + 'invalid_database_source.json', ['valid' => FALSE, 'error_prompt' => DatabaseDownloadSource::id(), 'error_message' => 'dropbox'], - ], - 'invalid provision type' => [ - 'invalid_provision_type.json', + ]; + yield 'invalid provision type' => [ + 'invalid_provision_type.json', ['valid' => FALSE, 'error_prompt' => 'provision_type', 'error_message' => 'magic'], - ], - - // Warnings. - 'warning for unmet dependency' => [ - 'warning_unmet_dependency.json', + ]; + // Warnings. + yield 'warning for unmet dependency' => [ + 'warning_unmet_dependency.json', ['valid' => TRUE, 'warning_prompt' => HostingProjectName::id()], - ], - - // Empty and array configs. - 'empty JSON object uses defaults' => [ - 'empty.json', + ]; + // Empty and array configs. + yield 'empty JSON object uses defaults' => [ + 'empty.json', [ 'valid' => FALSE, 'resolved' => [HostingProvider::id() => HostingProvider::NONE], ], - ], - 'JSON array treated as empty config' => [ - 'json_array.json', + ]; + yield 'JSON array treated as empty config' => [ + 'json_array.json', ['valid' => FALSE], - ], - - // Broken/unparseable inputs. - 'broken JSON syntax' => ['broken_json.json', ['output_contains' => 'Invalid JSON']], - 'plain text file' => ['not_json.txt', ['output_contains' => 'Invalid JSON']], - 'empty file' => ['empty_file.txt', ['output_contains' => 'Invalid JSON']], - 'JSON string instead of object' => ['json_string.json', ['output_contains' => 'Invalid JSON']], - 'non-existent file treated as raw JSON' => ['/nonexistent/path/config.json', ['output_contains' => 'Invalid JSON']], - - // Missing --config. - 'validate without --config fails' => [NULL, ['output_contains' => '--config']], ]; + // Broken/unparseable inputs. + yield 'broken JSON syntax' => ['broken_json.json', ['output_contains' => 'Invalid JSON']]; + yield 'plain text file' => ['not_json.txt', ['output_contains' => 'Invalid JSON']]; + yield 'empty file' => ['empty_file.txt', ['output_contains' => 'Invalid JSON']]; + yield 'JSON string instead of object' => ['json_string.json', ['output_contains' => 'Invalid JSON']]; + yield 'non-existent file treated as raw JSON' => ['/nonexistent/path/config.json', ['output_contains' => 'Invalid JSON']]; + // Missing --config. + yield 'validate without --config fails' => [NULL, ['output_contains' => '--config']]; } // ------------------------------------------------------------------------- diff --git a/.vortex/installer/tests/Functional/Handlers/AbstractHandlerProcessTestCase.php b/.vortex/installer/tests/Functional/Handlers/AbstractHandlerProcessTestCase.php index 4e47bc9a1..fb3988bad 100644 --- a/.vortex/installer/tests/Functional/Handlers/AbstractHandlerProcessTestCase.php +++ b/.vortex/installer/tests/Functional/Handlers/AbstractHandlerProcessTestCase.php @@ -73,7 +73,7 @@ public function testHandlerProcess( } } - abstract public static function dataProviderHandlerProcess(): array; + abstract public static function dataProviderHandlerProcess(): \Iterator; protected function assertCommon(): void { $this->assertDirectoriesIdentical(static::$root . '/scripts/vortex', static::$sut . '/scripts/vortex', 'Vortex scripts were not modified.'); diff --git a/.vortex/installer/tests/Functional/Handlers/AiCodeInstructionsHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/AiCodeInstructionsHandlerProcessTest.php index 6548212f5..a825221b6 100644 --- a/.vortex/installer/tests/Functional/Handlers/AiCodeInstructionsHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/AiCodeInstructionsHandlerProcessTest.php @@ -12,23 +12,20 @@ #[CoversClass(AiCodeInstructions::class)] class AiCodeInstructionsHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'ai_instructions_enabled' => [ - static::cw(fn() => Env::put(AiCodeInstructions::envName(), Env::TRUE)), - static::cw(function (FunctionalTestCase $test): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'ai_instructions_enabled' => [ + static::cw(fn() => Env::put(AiCodeInstructions::envName(), Env::TRUE)), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileExists(static::$sut . '/AGENTS.md'); $test->assertFileExists(static::$sut . '/CLAUDE.md'); - }), - ], - - 'ai_instructions_disabled' => [ - static::cw(fn() => Env::put(AiCodeInstructions::envName(), Env::FALSE)), - static::cw(function (FunctionalTestCase $test): void { + }), + ]; + yield 'ai_instructions_disabled' => [ + static::cw(fn() => Env::put(AiCodeInstructions::envName(), Env::FALSE)), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileDoesNotExist(static::$sut . '/AGENTS.md'); $test->assertFileDoesNotExist(static::$sut . '/CLAUDE.md'); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/BaselineHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/BaselineHandlerProcessTest.php index 8eceaf4c0..aad001a4d 100644 --- a/.vortex/installer/tests/Functional/Handlers/BaselineHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/BaselineHandlerProcessTest.php @@ -65,22 +65,19 @@ #[CoversClass(Tui::class)] class BaselineHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - static::BASELINE_DATASET => [ - NULL, - NULL, + public static function dataProviderHandlerProcess(): \Iterator { + yield static::BASELINE_DATASET => [ + NULL, + NULL, ['Welcome to the Vortex non-interactive installer'], - ], - - 'non_interactive' => [ - NULL, - NULL, + ]; + yield 'non_interactive' => [ + NULL, + NULL, ['Welcome to the Vortex non-interactive installer'], - ], - - 'non_interactive_config_file' => [ - static::cw(function (AbstractHandlerProcessTestCase $test): void { + ]; + yield 'non_interactive_config_file' => [ + static::cw(function (AbstractHandlerProcessTestCase $test): void { $config_file = static::$tmp . DIRECTORY_SEPARATOR . 'config.json'; File::dump($config_file, (string) json_encode([ // Test overriding scalar value. @@ -89,13 +86,12 @@ public static function dataProviderHandlerProcess(): array { Services::envName() => [Services::SOLR, Services::CLAMAV], ])); $test->installOptions['config'] = $config_file; - }), - NULL, + }), + NULL, ['Welcome to the Vortex non-interactive installer'], - ], - - 'non_interactive_config_string' => [ - static::cw(function (AbstractHandlerProcessTestCase $test): void { + ]; + yield 'non_interactive_config_string' => [ + static::cw(function (AbstractHandlerProcessTestCase $test): void { $config_string = (string) json_encode([ // Test overriding scalar value. Org::envName() => 'My other custom org', @@ -103,10 +99,9 @@ public static function dataProviderHandlerProcess(): array { Services::envName() => [Services::SOLR, Services::REDIS], ]); $test->installOptions['config'] = $config_string; - }), - NULL, + }), + NULL, ['Welcome to the Vortex non-interactive installer'], - ], ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/CiProviderHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/CiProviderHandlerProcessTest.php index a6a02ae7d..9608a56ed 100644 --- a/.vortex/installer/tests/Functional/Handlers/CiProviderHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/CiProviderHandlerProcessTest.php @@ -13,29 +13,26 @@ #[CoversClass(CiProvider::class)] class CiProviderHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'ciprovider_gha' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'ciprovider_gha' => [ + static::cw(function (): void { Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileNotContainsString(static::$sut . '/.github/workflows/build-test-deploy.yml', '1.x'); $test->assertFileNotContainsString(static::$sut . '/.github/workflows/build-test-deploy.yml', '2.x'); - }), - ], - - 'ciprovider_circleci' => [ - static::cw(function (): void { + }), + ]; + yield 'ciprovider_circleci' => [ + static::cw(function (): void { Env::put(CiProvider::envName(), CiProvider::CIRCLECI); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileNotContainsString(static::$sut . '/.circleci/config.yml', '1.x'); $test->assertFileNotContainsString(static::$sut . '/.circleci/config.yml', '2.x'); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/CodeProviderHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/CodeProviderHandlerProcessTest.php index 8aa538d4c..7eecdb011 100644 --- a/.vortex/installer/tests/Functional/Handlers/CodeProviderHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/CodeProviderHandlerProcessTest.php @@ -12,22 +12,19 @@ #[CoversClass(CodeProvider::class)] class CodeProviderHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'code_provider_github' => [ - static::cw(fn() => Env::put(CodeProvider::envName(), CodeProvider::GITHUB)), - static::cw(function (FunctionalTestCase $test): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'code_provider_github' => [ + static::cw(fn() => Env::put(CodeProvider::envName(), CodeProvider::GITHUB)), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileDoesNotExist(static::$sut . '/.github/PULL_REQUEST_TEMPLATE.dist.md'); $test->assertFileContainsString(static::$sut . '/.github/PULL_REQUEST_TEMPLATE.md', 'Checklist before requesting a review'); - }), - ], - - 'code_provider_other' => [ - static::cw(fn() => Env::put(CodeProvider::envName(), CodeProvider::OTHER)), - static::cw(function (FunctionalTestCase $test): void { + }), + ]; + yield 'code_provider_other' => [ + static::cw(fn() => Env::put(CodeProvider::envName(), CodeProvider::OTHER)), + static::cw(function (FunctionalTestCase $test): void { $test->assertDirectoryDoesNotExist(static::$sut . '/.github'); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/CustomModulesHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/CustomModulesHandlerProcessTest.php index 73b66b579..a31faf02b 100644 --- a/.vortex/installer/tests/Functional/Handlers/CustomModulesHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/CustomModulesHandlerProcessTest.php @@ -15,54 +15,48 @@ #[CoversClass(CustomModules::class)] class CustomModulesHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'custom_modules_no_base' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'custom_modules_no_base' => [ + static::cw(function (): void { Env::put(CustomModules::envName(), Converter::toList([CustomModules::SEARCH, CustomModules::DEMO])); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('_base')), - ], - - 'custom_modules_no_demo' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('_base')), + ]; + yield 'custom_modules_no_demo' => [ + static::cw(function (): void { Env::put(CustomModules::envName(), Converter::toList([CustomModules::BASE, CustomModules::SEARCH])); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutNotContains('_demo'); $test->assertSutNotContains('counter_block'); - }), - ], - - 'custom_modules_no_search' => [ - static::cw(function (): void { + }), + ]; + yield 'custom_modules_no_search' => [ + static::cw(function (): void { Env::put(CustomModules::envName(), Converter::toList([CustomModules::BASE, CustomModules::DEMO])); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('_search')), - ], - - 'custom_modules_none' => [ - static::cw(fn() => Env::put(CustomModules::envName(), ',')), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('_search')), + ]; + yield 'custom_modules_none' => [ + static::cw(fn() => Env::put(CustomModules::envName(), ',')), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutNotContains('_base'); $test->assertSutNotContains('_demo'); $test->assertSutNotContains('_search'); - }), - ], - - 'custom_modules_search_without_solr' => [ - static::cw(function (): void { + }), + ]; + yield 'custom_modules_search_without_solr' => [ + static::cw(function (): void { // Search module selected but Solr service deselected - safety net // should force-remove search module. Env::put(CustomModules::envName(), Converter::toList([CustomModules::BASE, CustomModules::SEARCH, CustomModules::DEMO])); Env::put(Services::envName(), Converter::toList([Services::CLAMAV, Services::REDIS])); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('_search')), - ], + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('_search')), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/DatabaseDownloadSourceHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/DatabaseDownloadSourceHandlerProcessTest.php index a007992bc..93efaca0b 100644 --- a/.vortex/installer/tests/Functional/Handlers/DatabaseDownloadSourceHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/DatabaseDownloadSourceHandlerProcessTest.php @@ -14,35 +14,28 @@ #[CoversClass(DatabaseImage::class)] class DatabaseDownloadSourceHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'db_download_source_url' => [ - static::cw(fn() => Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::URL)), - ], - - 'db_download_source_ftp' => [ - static::cw(fn() => Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::FTP)), - ], - - 'db_download_source_acquia' => [ - static::cw(fn() => Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::ACQUIA)), - ], - - 'db_download_source_lagoon' => [ - static::cw(fn() => Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::LAGOON)), - ], - - 'db_download_source_container_registry' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'db_download_source_url' => [ + static::cw(fn() => Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::URL)), + ]; + yield 'db_download_source_ftp' => [ + static::cw(fn() => Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::FTP)), + ]; + yield 'db_download_source_acquia' => [ + static::cw(fn() => Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::ACQUIA)), + ]; + yield 'db_download_source_lagoon' => [ + static::cw(fn() => Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::LAGOON)), + ]; + yield 'db_download_source_container_registry' => [ + static::cw(function (): void { Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::CONTAINER_REGISTRY); Env::put(DatabaseImage::envName(), 'the_empire/star_wars:latest'); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - ], - - 'db_download_source_s3' => [ - static::cw(fn() => Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::S3)), - ], + }), + ]; + yield 'db_download_source_s3' => [ + static::cw(fn() => Env::put(DatabaseDownloadSource::envName(), DatabaseDownloadSource::S3)), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/DependencyUpdatesProviderHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/DependencyUpdatesProviderHandlerProcessTest.php index 38dc85d97..d8ff84f3b 100644 --- a/.vortex/installer/tests/Functional/Handlers/DependencyUpdatesProviderHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/DependencyUpdatesProviderHandlerProcessTest.php @@ -12,26 +12,21 @@ #[CoversClass(DependencyUpdatesProvider::class)] class DependencyUpdatesProviderHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'deps_updates_provider_ci_gha' => [ - static::cw(fn() => Env::put(DependencyUpdatesProvider::envName(), DependencyUpdatesProvider::RENOVATEBOT_CI)), - ], - - 'deps_updates_provider_ci_circleci' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'deps_updates_provider_ci_gha' => [ + static::cw(fn() => Env::put(DependencyUpdatesProvider::envName(), DependencyUpdatesProvider::RENOVATEBOT_CI)), + ]; + yield 'deps_updates_provider_ci_circleci' => [ + static::cw(function (): void { Env::put(DependencyUpdatesProvider::envName(), DependencyUpdatesProvider::RENOVATEBOT_CI); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - ], - - 'deps_updates_provider_app' => [ - static::cw(fn() => Env::put(DependencyUpdatesProvider::envName(), DependencyUpdatesProvider::RENOVATEBOT_APP)), - ], - - 'deps_updates_provider_none' => [ - static::cw(fn() => Env::put(DependencyUpdatesProvider::envName(), DependencyUpdatesProvider::NONE)), - ], + }), + ]; + yield 'deps_updates_provider_app' => [ + static::cw(fn() => Env::put(DependencyUpdatesProvider::envName(), DependencyUpdatesProvider::RENOVATEBOT_APP)), + ]; + yield 'deps_updates_provider_none' => [ + static::cw(fn() => Env::put(DependencyUpdatesProvider::envName(), DependencyUpdatesProvider::NONE)), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/DeployTypeHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/DeployTypeHandlerProcessTest.php index eb0b8e735..54e5fdaba 100644 --- a/.vortex/installer/tests/Functional/Handlers/DeployTypeHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/DeployTypeHandlerProcessTest.php @@ -13,45 +13,36 @@ #[CoversClass(DeployTypes::class)] class DeployTypeHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'deploy_types_artifact' => [ - static::cw(fn() => Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::ARTIFACT], ',', TRUE))), - ], - - 'deploy_types_lagoon' => [ - static::cw(fn() => Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::LAGOON], ',', TRUE))), - ], - - 'deploy_types_container_image' => [ - static::cw(fn() => Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::CONTAINER_IMAGE], ',', TRUE))), - ], - - 'deploy_types_webhook' => [ - static::cw(fn() => Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::WEBHOOK], ',', TRUE))), - ], - - 'deploy_types_all_gha' => [ - static::cw(fn() => Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::WEBHOOK, DeployTypes::CONTAINER_IMAGE, DeployTypes::LAGOON, DeployTypes::ARTIFACT]))), - ], - - 'deploy_types_all_circleci' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'deploy_types_artifact' => [ + static::cw(fn() => Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::ARTIFACT], ',', TRUE))), + ]; + yield 'deploy_types_lagoon' => [ + static::cw(fn() => Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::LAGOON], ',', TRUE))), + ]; + yield 'deploy_types_container_image' => [ + static::cw(fn() => Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::CONTAINER_IMAGE], ',', TRUE))), + ]; + yield 'deploy_types_webhook' => [ + static::cw(fn() => Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::WEBHOOK], ',', TRUE))), + ]; + yield 'deploy_types_all_gha' => [ + static::cw(fn() => Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::WEBHOOK, DeployTypes::CONTAINER_IMAGE, DeployTypes::LAGOON, DeployTypes::ARTIFACT]))), + ]; + yield 'deploy_types_all_circleci' => [ + static::cw(function (): void { Env::put(DeployTypes::envName(), Converter::toList([DeployTypes::WEBHOOK, DeployTypes::CONTAINER_IMAGE, DeployTypes::LAGOON, DeployTypes::ARTIFACT])); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - ], - - 'deploy_types_none_gha' => [ - static::cw(fn() => Env::put(DeployTypes::envName(), ',')), - ], - - 'deploy_types_none_circleci' => [ - static::cw(function (): void { + }), + ]; + yield 'deploy_types_none_gha' => [ + static::cw(fn() => Env::put(DeployTypes::envName(), ',')), + ]; + yield 'deploy_types_none_circleci' => [ + static::cw(function (): void { Env::put(DeployTypes::envName(), ','); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/DocsHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/DocsHandlerProcessTest.php index ee9e9c644..020351493 100644 --- a/.vortex/installer/tests/Functional/Handlers/DocsHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/DocsHandlerProcessTest.php @@ -11,16 +11,12 @@ #[CoversClass(PreserveDocsProject::class)] class DocsHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'preserve_docs_project_enabled' => [ - static::cw(fn() => Env::put(PreserveDocsProject::envName(), Env::TRUE)), - ], - - 'preserve_docs_project_disabled' => [ - static::cw(fn() => Env::put(PreserveDocsProject::envName(), Env::FALSE)), - ], - + public static function dataProviderHandlerProcess(): \Iterator { + yield 'preserve_docs_project_enabled' => [ + static::cw(fn() => Env::put(PreserveDocsProject::envName(), Env::TRUE)), + ]; + yield 'preserve_docs_project_disabled' => [ + static::cw(fn() => Env::put(PreserveDocsProject::envName(), Env::FALSE)), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/HostingProjectNameHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/HostingProjectNameHandlerProcessTest.php index a65b6890d..8e5ae2afa 100644 --- a/.vortex/installer/tests/Functional/Handlers/HostingProjectNameHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/HostingProjectNameHandlerProcessTest.php @@ -13,33 +13,30 @@ #[CoversClass(HostingProjectName::class)] class HostingProjectNameHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'hosting_project_name___acquia' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'hosting_project_name___acquia' => [ + static::cw(function (): void { Env::put(HostingProvider::envName(), HostingProvider::ACQUIA); Env::put(HostingProjectName::envName(), 'my_custom_acquia-project'); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutContains([ 'VORTEX_ACQUIA_APP_NAME=my_custom_acquia-project', ]); - }), - ], - - 'hosting_project_name___lagoon' => [ - static::cw(function (): void { + }), + ]; + yield 'hosting_project_name___lagoon' => [ + static::cw(function (): void { Env::put(HostingProvider::envName(), HostingProvider::LAGOON); Env::put(HostingProjectName::envName(), 'my_custom_lagoon-project'); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutContains([ 'LAGOON_PROJECT=my_custom_lagoon-project', '/my_custom_lagoon-project-\$\{env-name\}/', '/\.my_custom_lagoon-project\.au2\.amazee\.io/', ]); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/HostingProviderHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/HostingProviderHandlerProcessTest.php index 18cfb8abd..a956a542d 100644 --- a/.vortex/installer/tests/Functional/Handlers/HostingProviderHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/HostingProviderHandlerProcessTest.php @@ -13,22 +13,19 @@ #[CoversClass(HostingProvider::class)] class HostingProviderHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'hosting_acquia' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'hosting_acquia' => [ + static::cw(function (): void { Env::put(HostingProvider::envName(), HostingProvider::ACQUIA); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - ], - - 'hosting_lagoon' => [ - static::cw(function (): void { + }), + ]; + yield 'hosting_lagoon' => [ + static::cw(function (): void { Env::put(HostingProvider::envName(), HostingProvider::LAGOON); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('acquia')), - ], + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('acquia')), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/MigrationDownloadSourceHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/MigrationDownloadSourceHandlerProcessTest.php index 4c2b3c614..e8f743c23 100644 --- a/.vortex/installer/tests/Functional/Handlers/MigrationDownloadSourceHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/MigrationDownloadSourceHandlerProcessTest.php @@ -13,72 +13,66 @@ #[CoversClass(MigrationDownloadSource::class)] class MigrationDownloadSourceHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'migration_download_source_url' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'migration_download_source_url' => [ + static::cw(function (): void { Env::put(Migration::envName(), Env::TRUE); Env::put(MigrationDownloadSource::envName(), MigrationDownloadSource::URL); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_SOURCE=url'); $test->assertFileContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_URL='); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_FTP_HOST'); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_S3_BUCKET'); - }), - ], - - 'migration_download_source_ftp' => [ - static::cw(function (): void { + }), + ]; + yield 'migration_download_source_ftp' => [ + static::cw(function (): void { Env::put(Migration::envName(), Env::TRUE); Env::put(MigrationDownloadSource::envName(), MigrationDownloadSource::FTP); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_SOURCE=ftp'); $test->assertFileContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_FTP_HOST'); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_URL='); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_S3_BUCKET'); - }), - ], - - 'migration_download_source_acquia' => [ - static::cw(function (): void { + }), + ]; + yield 'migration_download_source_acquia' => [ + static::cw(function (): void { Env::put(Migration::envName(), Env::TRUE); Env::put(MigrationDownloadSource::envName(), MigrationDownloadSource::ACQUIA); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_SOURCE=acquia'); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_URL='); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_FTP_HOST'); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_S3_BUCKET'); - }), - ], - - 'migration_download_source_lagoon' => [ - static::cw(function (): void { + }), + ]; + yield 'migration_download_source_lagoon' => [ + static::cw(function (): void { Env::put(Migration::envName(), Env::TRUE); Env::put(MigrationDownloadSource::envName(), MigrationDownloadSource::LAGOON); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_SOURCE=lagoon'); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_URL='); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_FTP_HOST'); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_S3_BUCKET'); - }), - ], - - 'migration_download_source_s3' => [ - static::cw(function (): void { + }), + ]; + yield 'migration_download_source_s3' => [ + static::cw(function (): void { Env::put(Migration::envName(), Env::TRUE); Env::put(MigrationDownloadSource::envName(), MigrationDownloadSource::S3); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_SOURCE=s3'); $test->assertFileContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_S3_BUCKET'); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_URL='); $test->assertFileNotContainsString(static::$sut . '/.env', 'VORTEX_DOWNLOAD_DB2_FTP_HOST'); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/MigrationHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/MigrationHandlerProcessTest.php index c87b6470f..6761a3535 100644 --- a/.vortex/installer/tests/Functional/Handlers/MigrationHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/MigrationHandlerProcessTest.php @@ -14,11 +14,10 @@ #[CoversClass(Migration::class)] class MigrationHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'migration_enabled' => [ - static::cw(fn() => Env::put(Migration::envName(), Env::TRUE)), - static::cw(function (FunctionalTestCase $test): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'migration_enabled' => [ + static::cw(fn() => Env::put(Migration::envName(), Env::TRUE)), + static::cw(function (FunctionalTestCase $test): void { // Files and directories created by the handler. $test->assertFileExists(static::$sut . '/web/sites/default/settings.migration.php'); $test->assertFileExists(static::$sut . '/scripts/custom/provision-20-migration.sh'); @@ -36,27 +35,25 @@ public static function dataProviderHandlerProcess(): array { $test->assertFileContainsString(static::$sut . '/web/sites/default/settings.php', 'settings.migration.php'); $test->assertFileContainsString(static::$sut . '/.github/workflows/build-test-deploy.yml', 'Download migration DB'); $test->assertFileContainsString(static::$sut . '/tests/phpunit/Drupal/SettingsTestCase.php', 'DATABASE2_'); - }), - ], - - 'migration_enabled_circleci' => [ - static::cw(function (): void { + }), + ]; + yield 'migration_enabled_circleci' => [ + static::cw(function (): void { Env::put(Migration::envName(), Env::TRUE); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileExists(static::$sut . '/web/sites/default/settings.migration.php'); $test->assertFileExists(static::$sut . '/scripts/custom/provision-20-migration.sh'); $test->assertDirectoryExists(static::$sut . '/web/modules/custom/ys_migrate'); $test->assertFileContainsString(static::$sut . '/composer.json', 'drupal/migrate_plus'); $test->assertFileContainsString(static::$sut . '/composer.json', 'drupal/migrate_tools'); $test->assertFileContainsString(static::$sut . '/.circleci/config.yml', 'Download migration DB'); - }), - ], - - 'migration_disabled' => [ - static::cw(fn() => Env::put(Migration::envName(), Env::FALSE)), - static::cw(function (FunctionalTestCase $test): void { + }), + ]; + yield 'migration_disabled' => [ + static::cw(fn() => Env::put(Migration::envName(), Env::FALSE)), + static::cw(function (FunctionalTestCase $test): void { // Files and directories removed by the handler. $test->assertFileDoesNotExist(static::$sut . '/web/sites/default/settings.migration.php'); $test->assertFileDoesNotExist(static::$sut . '/scripts/custom/provision-20-migration.sh'); @@ -74,53 +71,49 @@ public static function dataProviderHandlerProcess(): array { $test->assertFileNotContainsString(static::$sut . '/web/sites/default/settings.php', 'settings.migration.php'); $test->assertFileNotContainsString(static::$sut . '/.github/workflows/build-test-deploy.yml', 'Download migration DB'); $test->assertFileNotContainsString(static::$sut . '/tests/phpunit/Drupal/SettingsTestCase.php', 'DATABASE2_'); - }), - ], - - 'migration_disabled_circleci' => [ - static::cw(function (): void { + }), + ]; + yield 'migration_disabled_circleci' => [ + static::cw(function (): void { Env::put(Migration::envName(), Env::FALSE); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileDoesNotExist(static::$sut . '/web/sites/default/settings.migration.php'); $test->assertFileDoesNotExist(static::$sut . '/scripts/custom/provision-20-migration.sh'); $test->assertDirectoryDoesNotExist(static::$sut . '/web/modules/custom/ys_migrate'); $test->assertFileNotContainsString(static::$sut . '/composer.json', 'drupal/migrate_plus'); $test->assertFileNotContainsString(static::$sut . '/composer.json', 'drupal/migrate_tools'); $test->assertFileNotContainsString(static::$sut . '/.circleci/config.yml', 'Download migration DB'); - }), - ], - - 'migration_enabled_lagoon' => [ - static::cw(function (): void { + }), + ]; + yield 'migration_enabled_lagoon' => [ + static::cw(function (): void { Env::put(Migration::envName(), Env::TRUE); Env::put(HostingProvider::envName(), HostingProvider::LAGOON); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileExists(static::$sut . '/web/sites/default/settings.migration.php'); $test->assertFileExists(static::$sut . '/scripts/custom/provision-20-migration.sh'); $test->assertDirectoryExists(static::$sut . '/web/modules/custom/ys_migrate'); $test->assertFileContainsString(static::$sut . '/composer.json', 'drupal/migrate_plus'); $test->assertFileContainsString(static::$sut . '/composer.json', 'drupal/migrate_tools'); $test->assertFileContainsString(static::$sut . '/.lagoon.yml', 'Download migration database'); - }), - ], - - 'migration_disabled_lagoon' => [ - static::cw(function (): void { + }), + ]; + yield 'migration_disabled_lagoon' => [ + static::cw(function (): void { Env::put(Migration::envName(), Env::FALSE); Env::put(HostingProvider::envName(), HostingProvider::LAGOON); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileDoesNotExist(static::$sut . '/web/sites/default/settings.migration.php'); $test->assertFileDoesNotExist(static::$sut . '/scripts/custom/provision-20-migration.sh'); $test->assertDirectoryDoesNotExist(static::$sut . '/web/modules/custom/ys_migrate'); $test->assertFileNotContainsString(static::$sut . '/composer.json', 'drupal/migrate_plus'); $test->assertFileNotContainsString(static::$sut . '/composer.json', 'drupal/migrate_tools'); $test->assertFileNotContainsString(static::$sut . '/.lagoon.yml', 'Download migration database'); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/ModulesHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/ModulesHandlerProcessTest.php index 9bcc235e4..2411be7d9 100644 --- a/.vortex/installer/tests/Functional/Handlers/ModulesHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/ModulesHandlerProcessTest.php @@ -13,119 +13,104 @@ #[CoversClass(Modules::class)] class ModulesHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'modules_no_admin_toolbar' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'modules_no_admin_toolbar' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('admin_toolbar'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('drupal/admin_toolbar')), - ], - - 'modules_no_coffee' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('drupal/admin_toolbar')), + ]; + yield 'modules_no_coffee' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('coffee'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('coffee')), - ], - - 'modules_no_config_split' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('coffee')), + ]; + yield 'modules_no_config_split' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('config_split'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('config_split')), - ], - - 'modules_no_config_update' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('config_split')), + ]; + yield 'modules_no_config_update' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('config_update'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('config_update')), - ], - - 'modules_no_environment_indicator' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('config_update')), + ]; + yield 'modules_no_environment_indicator' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('environment_indicator'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('environment_indicator')), - ], - - 'modules_no_pathauto' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('environment_indicator')), + ]; + yield 'modules_no_pathauto' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('pathauto'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('drupal/pathauto')), - ], - - 'modules_no_redirect' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('drupal/pathauto')), + ]; + yield 'modules_no_redirect' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('redirect'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('drupal/redirect')), - ], - - 'modules_no_robotstxt' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('drupal/redirect')), + ]; + yield 'modules_no_robotstxt' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('robotstxt'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('robotstxt')), - ], - - 'modules_no_seckit' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('robotstxt')), + ]; + yield 'modules_no_seckit' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('seckit'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('seckit')), - ], - - 'modules_no_shield' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('seckit')), + ]; + yield 'modules_no_shield' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('shield'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('shield')), - ], - - 'modules_no_stage_file_proxy' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('shield')), + ]; + yield 'modules_no_stage_file_proxy' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept('stage_file_proxy'); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('stage_file_proxy')), - ], - - 'modules_no_seckit_shield_stage_file_proxy' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('stage_file_proxy')), + ]; + yield 'modules_no_seckit_shield_stage_file_proxy' => [ + static::cw(function (): void { $selected_modules = static::getModulesExcept(['seckit', 'shield', 'stage_file_proxy']); Env::put(Modules::envName(), Converter::toList($selected_modules)); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'seckit', - 'shield', - 'stage_file_proxy', - ])), - ], - - 'modules_none' => [ - static::cw(fn() => Env::put(Modules::envName(), ',')), - static::cw(function (FunctionalTestCase $test): void { - foreach (array_keys(Modules::getAvailableModules()) as $module) { - // Cannot assert by the module name alone, as some module names - // are generic words that may appear elsewhere. - $test->assertSutNotContains('drupal/' . $module); - } - }), - ], - + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'seckit', + 'shield', + 'stage_file_proxy', + ])), + ]; + yield 'modules_none' => [ + static::cw(fn() => Env::put(Modules::envName(), ',')), + static::cw(function (FunctionalTestCase $test): void { + foreach (array_keys(Modules::getAvailableModules()) as $module) { + // Cannot assert by the module name alone, as some module names + // are generic words that may appear elsewhere. + $test->assertSutNotContains('drupal/' . $module); + } + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/NamesHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/NamesHandlerProcessTest.php index 1e78010c1..e1745defc 100644 --- a/.vortex/installer/tests/Functional/Handlers/NamesHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/NamesHandlerProcessTest.php @@ -17,19 +17,17 @@ #[CoversClass(Name::class)] class NamesHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'names' => [ - static::cw(function (): void { - Env::put(Name::envName(), 'New hope'); - Env::put(MachineName::envName(), 'the_new_hope'); - Env::put(Org::envName(), 'Jedi Order'); - Env::put(OrgMachineName::envName(), 'the_jedi_order'); - Env::put(Domain::envName(), 'death-star.com'); - Env::put(ModulePrefix::envName(), 'the_force'); - Env::put(Theme::envName(), 'lightsaber'); - }), - ], + public static function dataProviderHandlerProcess(): \Iterator { + yield 'names' => [ + static::cw(function (): void { + Env::put(Name::envName(), 'New hope'); + Env::put(MachineName::envName(), 'the_new_hope'); + Env::put(Org::envName(), 'Jedi Order'); + Env::put(OrgMachineName::envName(), 'the_jedi_order'); + Env::put(Domain::envName(), 'death-star.com'); + Env::put(ModulePrefix::envName(), 'the_force'); + Env::put(Theme::envName(), 'lightsaber'); + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/NotificationChannelsHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/NotificationChannelsHandlerProcessTest.php index e8f3dd403..e5e9ef54d 100644 --- a/.vortex/installer/tests/Functional/Handlers/NotificationChannelsHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/NotificationChannelsHandlerProcessTest.php @@ -13,10 +13,9 @@ #[CoversClass(NotificationChannels::class)] class NotificationChannelsHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'notification_channels_all' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'notification_channels_all' => [ + static::cw(function (): void { Env::put(NotificationChannels::envName(), Converter::toList([ NotificationChannels::EMAIL, NotificationChannels::GITHUB, @@ -25,96 +24,88 @@ public static function dataProviderHandlerProcess(): array { NotificationChannels::SLACK, NotificationChannels::WEBHOOK, ], ',', TRUE)); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutContains('VORTEX_NOTIFY_EMAIL_FROM'); $test->assertSutContains('VORTEX_NOTIFY_EMAIL_RECIPIENTS'); $test->assertSutContains('VORTEX_NOTIFY_JIRA_USER_EMAIL'); $test->assertSutContains('VORTEX_NOTIFY_WEBHOOK_URL'); - }), - ], - - 'notification_channels_email_only' => [ - static::cw(function (): void { + }), + ]; + yield 'notification_channels_email_only' => [ + static::cw(function (): void { Env::put(NotificationChannels::envName(), Converter::toList([NotificationChannels::EMAIL], ',', TRUE)); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutContains('VORTEX_NOTIFY_EMAIL_FROM'); $test->assertSutContains('VORTEX_NOTIFY_EMAIL_RECIPIENTS'); $test->assertSutNotContains('VORTEX_NOTIFY_JIRA_USER_EMAIL'); $test->assertSutNotContains('VORTEX_NOTIFY_WEBHOOK_URL'); - }), - ], - - 'notification_channels_github_only' => [ - static::cw(function (): void { + }), + ]; + yield 'notification_channels_github_only' => [ + static::cw(function (): void { Env::put(NotificationChannels::envName(), Converter::toList([NotificationChannels::GITHUB], ',', TRUE)); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_FROM'); $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_RECIPIENTS'); $test->assertSutNotContains('VORTEX_NOTIFY_JIRA_USER_EMAIL'); $test->assertSutNotContains('VORTEX_NOTIFY_WEBHOOK_URL'); - }), - ], - - 'notification_channels_jira_only' => [ - static::cw(function (): void { + }), + ]; + yield 'notification_channels_jira_only' => [ + static::cw(function (): void { Env::put(NotificationChannels::envName(), Converter::toList([NotificationChannels::JIRA], ',', TRUE)); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutContains('VORTEX_NOTIFY_JIRA_USER_EMAIL'); $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_FROM'); $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_RECIPIENTS'); $test->assertSutNotContains('VORTEX_NOTIFY_WEBHOOK_URL'); - }), - ], - - 'notification_channels_newrelic_only' => [ - static::cw(function (): void { + }), + ]; + yield 'notification_channels_newrelic_only' => [ + static::cw(function (): void { Env::put(NotificationChannels::envName(), Converter::toList([NotificationChannels::NEWRELIC], ',', TRUE)); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_FROM'); $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_RECIPIENTS'); $test->assertSutNotContains('VORTEX_NOTIFY_JIRA_USER_EMAIL'); $test->assertSutNotContains('VORTEX_NOTIFY_WEBHOOK_URL'); - }), - ], - - 'notification_channels_slack_only' => [ - static::cw(function (): void { + }), + ]; + yield 'notification_channels_slack_only' => [ + static::cw(function (): void { Env::put(NotificationChannels::envName(), Converter::toList([NotificationChannels::SLACK], ',', TRUE)); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_FROM'); $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_RECIPIENTS'); $test->assertSutNotContains('VORTEX_NOTIFY_JIRA_USER_EMAIL'); $test->assertSutNotContains('VORTEX_NOTIFY_WEBHOOK_URL'); - }), - ], - - 'notification_channels_webhook_only' => [ - static::cw(function (): void { + }), + ]; + yield 'notification_channels_webhook_only' => [ + static::cw(function (): void { Env::put(NotificationChannels::envName(), Converter::toList([NotificationChannels::WEBHOOK], ',', TRUE)); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutContains('VORTEX_NOTIFY_WEBHOOK_URL'); $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_FROM'); $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_RECIPIENTS'); $test->assertSutNotContains('VORTEX_NOTIFY_JIRA_USER_EMAIL'); - }), - ], - - 'notification_channels_none' => [ - static::cw(fn() => Env::put(NotificationChannels::envName(), ',')), - static::cw(function (FunctionalTestCase $test): void { + }), + ]; + yield 'notification_channels_none' => [ + static::cw(fn() => Env::put(NotificationChannels::envName(), ',')), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_FROM'); $test->assertSutNotContains('VORTEX_NOTIFY_EMAIL_RECIPIENTS'); $test->assertSutNotContains('VORTEX_NOTIFY_JIRA_USER_EMAIL'); $test->assertSutNotContains('VORTEX_NOTIFY_WEBHOOK_URL'); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/ProfileHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/ProfileHandlerProcessTest.php index ea2c8ffa3..93c7ae004 100644 --- a/.vortex/installer/tests/Functional/Handlers/ProfileHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/ProfileHandlerProcessTest.php @@ -11,15 +11,12 @@ #[CoversClass(Profile::class)] class ProfileHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'profile_minimal' => [ - static::cw(fn() => Env::put(Profile::envName(), Profile::MINIMAL)), - ], - - 'profile_the_empire' => [ - static::cw(fn() => Env::put(Profile::envName(), 'the_empire')), - ], + public static function dataProviderHandlerProcess(): \Iterator { + yield 'profile_minimal' => [ + static::cw(fn() => Env::put(Profile::envName(), Profile::MINIMAL)), + ]; + yield 'profile_the_empire' => [ + static::cw(fn() => Env::put(Profile::envName(), 'the_empire')), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/ProvisionTypeHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/ProvisionTypeHandlerProcessTest.php index b3f825458..eb666033c 100644 --- a/.vortex/installer/tests/Functional/Handlers/ProvisionTypeHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/ProvisionTypeHandlerProcessTest.php @@ -13,26 +13,22 @@ #[CoversClass(ProvisionType::class)] class ProvisionTypeHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'provision_database' => [ - static::cw(fn() => Env::put(ProvisionType::envName(), ProvisionType::DATABASE)), - ], - - 'provision_database_lagoon' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'provision_database' => [ + static::cw(fn() => Env::put(ProvisionType::envName(), ProvisionType::DATABASE)), + ]; + yield 'provision_database_lagoon' => [ + static::cw(function (): void { Env::put(ProvisionType::envName(), ProvisionType::DATABASE); Env::put(HostingProvider::envName(), HostingProvider::LAGOON); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - ], - - 'provision_profile' => [ - static::cw(function (): void { + }), + ]; + yield 'provision_profile' => [ + static::cw(function (): void { Env::put(ProvisionType::envName(), ProvisionType::PROFILE); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/PullRequestHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/PullRequestHandlerProcessTest.php index 5363d0e44..d72946458 100644 --- a/.vortex/installer/tests/Functional/Handlers/PullRequestHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/PullRequestHandlerProcessTest.php @@ -13,23 +13,18 @@ #[CoversClass(LabelMergeConflictsPr::class)] class PullRequestHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'assign_author_pr_enabled' => [ - static::cw(fn() => Env::put(AssignAuthorPr::envName(), Env::TRUE)), - ], - - 'assign_author_pr_disabled' => [ - static::cw(fn() => Env::put(AssignAuthorPr::envName(), Env::FALSE)), - ], - - 'label_merge_conflicts_pr_enabled' => [ - static::cw(fn() => Env::put(LabelMergeConflictsPr::envName(), Env::TRUE)), - ], - - 'label_merge_conflicts_pr_disabled' => [ - static::cw(fn() => Env::put(LabelMergeConflictsPr::envName(), Env::FALSE)), - ], + public static function dataProviderHandlerProcess(): \Iterator { + yield 'assign_author_pr_enabled' => [ + static::cw(fn() => Env::put(AssignAuthorPr::envName(), Env::TRUE)), + ]; + yield 'assign_author_pr_disabled' => [ + static::cw(fn() => Env::put(AssignAuthorPr::envName(), Env::FALSE)), + ]; + yield 'label_merge_conflicts_pr_enabled' => [ + static::cw(fn() => Env::put(LabelMergeConflictsPr::envName(), Env::TRUE)), + ]; + yield 'label_merge_conflicts_pr_disabled' => [ + static::cw(fn() => Env::put(LabelMergeConflictsPr::envName(), Env::FALSE)), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/ServicesHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/ServicesHandlerProcessTest.php index 62ea438a6..b72677e7d 100644 --- a/.vortex/installer/tests/Functional/Handlers/ServicesHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/ServicesHandlerProcessTest.php @@ -14,41 +14,35 @@ #[CoversClass(Services::class)] class ServicesHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'services_no_clamav' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'services_no_clamav' => [ + static::cw(function (): void { Env::put(Services::envName(), Converter::toList([Services::SOLR, Services::REDIS])); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('clamav')), - ], - - 'services_no_redis' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('clamav')), + ]; + yield 'services_no_redis' => [ + static::cw(function (): void { Env::put(Services::envName(), Converter::toList([Services::CLAMAV, Services::SOLR])); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('redis')), - ], - - 'services_no_solr' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('redis')), + ]; + yield 'services_no_solr' => [ + static::cw(function (): void { Env::put(Services::envName(), Converter::toList([Services::CLAMAV, Services::REDIS])); Env::put(AiCodeInstructions::envName(), Env::TRUE); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('solr')), - ], - - 'services_none' => [ - static::cw(fn() => Env::put(Services::envName(), ',')), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains('solr')), + ]; + yield 'services_none' => [ + static::cw(fn() => Env::put(Services::envName(), ',')), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutNotContains('clamav'); $test->assertSutNotContains('solr'); $test->assertSutNotContains('redis'); - }), - ], - + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/StarterHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/StarterHandlerProcessTest.php index a42a29823..9f8c9a4c5 100644 --- a/.vortex/installer/tests/Functional/Handlers/StarterHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/StarterHandlerProcessTest.php @@ -12,34 +12,30 @@ #[CoversClass(Starter::class)] class StarterHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'starter_demo_db' => [ - static::cw(fn() => Env::put(Starter::envName(), Starter::LOAD_DATABASE_DEMO)), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'drupal/cms', - 'wikimedia/composer-merge-plugin', - 'vendor/drupal/cms/composer.json', - ])), - ], - - 'starter_drupal_profile' => [ - static::cw(fn() => Env::put(Starter::envName(), Starter::INSTALL_PROFILE_CORE)), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'drupal/cms', - 'wikimedia/composer-merge-plugin', - 'vendor/drupal/cms/composer.json', - ])), - ], - - 'starter_drupal_cms_profile' => [ - static::cw(fn() => Env::put(Starter::envName(), Starter::INSTALL_PROFILE_DRUPALCMS)), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutContains([ - 'drupal/cms', - 'wikimedia/composer-merge-plugin', - 'vendor/drupal/cms/composer.json', - ])), - ], + public static function dataProviderHandlerProcess(): \Iterator { + yield 'starter_demo_db' => [ + static::cw(fn() => Env::put(Starter::envName(), Starter::LOAD_DATABASE_DEMO)), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'drupal/cms', + 'wikimedia/composer-merge-plugin', + 'vendor/drupal/cms/composer.json', + ])), + ]; + yield 'starter_drupal_profile' => [ + static::cw(fn() => Env::put(Starter::envName(), Starter::INSTALL_PROFILE_CORE)), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'drupal/cms', + 'wikimedia/composer-merge-plugin', + 'vendor/drupal/cms/composer.json', + ])), + ]; + yield 'starter_drupal_cms_profile' => [ + static::cw(fn() => Env::put(Starter::envName(), Starter::INSTALL_PROFILE_DRUPALCMS)), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutContains([ + 'drupal/cms', + 'wikimedia/composer-merge-plugin', + 'vendor/drupal/cms/composer.json', + ])), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/ThemeHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/ThemeHandlerProcessTest.php index 170b45f3f..e5a535880 100644 --- a/.vortex/installer/tests/Functional/Handlers/ThemeHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/ThemeHandlerProcessTest.php @@ -12,45 +12,40 @@ #[CoversClass(Theme::class)] class ThemeHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'theme_olivero' => [ - static::cw(fn() => Env::put(Theme::envName(), Theme::OLIVERO)), - static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString(static::$sut, 'themes/custom', [ - '.gitignore', - 'scripts/vortex', - 'composer.json', - 'AGENTS.md', - 'CLAUDE.md', - ])), - ], - - 'theme_claro' => [ - static::cw(fn() => Env::put(Theme::envName(), Theme::CLARO)), - static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString(static::$sut, 'themes/custom', [ - '.gitignore', - 'scripts/vortex', - 'composer.json', - 'AGENTS.md', - 'CLAUDE.md', - ])), - ], - - 'theme_stark' => [ - static::cw(fn() => Env::put(Theme::envName(), Theme::STARK)), - static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString(static::$sut, 'themes/custom', [ - '.gitignore', - 'scripts/vortex', - 'composer.json', - 'AGENTS.md', - 'CLAUDE.md', - ])), - ], - - 'theme_custom' => [ - static::cw(fn() => Env::put(Theme::envName(), 'light_saber')), - static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString(static::$sut, 'your_site_theme')), - ], + public static function dataProviderHandlerProcess(): \Iterator { + yield 'theme_olivero' => [ + static::cw(fn() => Env::put(Theme::envName(), Theme::OLIVERO)), + static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString(static::$sut, 'themes/custom', [ + '.gitignore', + 'scripts/vortex', + 'composer.json', + 'AGENTS.md', + 'CLAUDE.md', + ])), + ]; + yield 'theme_claro' => [ + static::cw(fn() => Env::put(Theme::envName(), Theme::CLARO)), + static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString(static::$sut, 'themes/custom', [ + '.gitignore', + 'scripts/vortex', + 'composer.json', + 'AGENTS.md', + 'CLAUDE.md', + ])), + ]; + yield 'theme_stark' => [ + static::cw(fn() => Env::put(Theme::envName(), Theme::STARK)), + static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString(static::$sut, 'themes/custom', [ + '.gitignore', + 'scripts/vortex', + 'composer.json', + 'AGENTS.md', + 'CLAUDE.md', + ])), + ]; + yield 'theme_custom' => [ + static::cw(fn() => Env::put(Theme::envName(), 'light_saber')), + static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString(static::$sut, 'your_site_theme')), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/TimezoneHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/TimezoneHandlerProcessTest.php index 803f87b96..0042cf0ff 100644 --- a/.vortex/installer/tests/Functional/Handlers/TimezoneHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/TimezoneHandlerProcessTest.php @@ -13,15 +13,13 @@ #[CoversClass(Timezone::class)] class TimezoneHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - - 'timezone_gha' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'timezone_gha' => [ + static::cw(function (): void { Env::put(Timezone::envName(), 'America/New_York'); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { // Timezone should be replaced in .env file. $test->assertFileContainsString(static::$sut . '/.env', 'TZ=America/New_York'); $test->assertFileNotContainsString(static::$sut . '/.env', 'UTC'); @@ -38,21 +36,19 @@ public static function dataProviderHandlerProcess(): array { // Timezone should not be replaced in Docker Compose config. $test->assertFileNotContainsString(static::$sut . '/docker-compose.yml', 'America/New_York'); $test->assertFileContainsString(static::$sut . '/docker-compose.yml', 'UTC'); - }), - ], - - 'timezone_circleci' => [ - static::cw(function (): void { + }), + ]; + yield 'timezone_circleci' => [ + static::cw(function (): void { Env::put(Timezone::envName(), 'America/New_York'); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { // Timezone should not be replaced in CircleCI config in code as it // should be overridden via UI. $test->assertFileNotContainsString(static::$sut . '/.circleci/config.yml', 'TZ: America/New_York'); $test->assertFileContainsString(static::$sut . '/.circleci/config.yml', 'TZ: UTC'); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/ToolsHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/ToolsHandlerProcessTest.php index 9647c297f..11afa358d 100644 --- a/.vortex/installer/tests/Functional/Handlers/ToolsHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/ToolsHandlerProcessTest.php @@ -15,13 +15,12 @@ #[CoversClass(Tools::class)] class ToolsHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'tools_none' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'tools_none' => [ + static::cw(function (): void { Env::put(Tools::envName(), Converter::toList([])); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutNotContains([ 'phpcs', 'phpcbf', @@ -53,120 +52,111 @@ public static function dataProviderHandlerProcess(): array { '/\blint-fe:/', '/\blint-fe-fix:/', ]); - }), - ], - - 'tools_no_phpcs' => [ - static::cw(function (): void { + }), + ]; + yield 'tools_no_phpcs' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPCS]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpcs', - 'phpcbf', - 'dealerdirect/phpcodesniffer-composer-installer', - 'drupal/coder', - 'squizlabs/php_codesniffer', - ])), - ], - - 'tools_no_phpcs_circleci' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpcs', + 'phpcbf', + 'dealerdirect/phpcodesniffer-composer-installer', + 'drupal/coder', + 'squizlabs/php_codesniffer', + ])), + ]; + yield 'tools_no_phpcs_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPCS]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpcs', - 'phpcbf', - 'dealerdirect/phpcodesniffer-composer-installer', - 'drupal/coder', - 'squizlabs/php_codesniffer', - ])), - ], - - 'tools_no_phpstan' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpcs', + 'phpcbf', + 'dealerdirect/phpcodesniffer-composer-installer', + 'drupal/coder', + 'squizlabs/php_codesniffer', + ])), + ]; + yield 'tools_no_phpstan' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPSTAN]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpstan', - 'phpstan/phpstan', - 'mglaman/phpstan-drupal', - ])), - ], - - 'tools_no_phpstan_circleci' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpstan', + 'phpstan/phpstan', + 'mglaman/phpstan-drupal', + ])), + ]; + yield 'tools_no_phpstan_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPSTAN]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpstan', - 'phpstan/phpstan', - 'mglaman/phpstan-drupal', - ])), - ], - - 'tools_no_rector' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpstan', + 'phpstan/phpstan', + 'mglaman/phpstan-drupal', + ])), + ]; + yield 'tools_no_rector' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::RECTOR]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'rector', - 'rector/rector', - ])), - ], - - 'tools_no_rector_circleci' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'rector', + 'rector/rector', + ])), + ]; + yield 'tools_no_rector_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::RECTOR]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'rector', - 'rector/rector', - ])), - ], - - 'tools_no_phpmd' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'rector', + 'rector/rector', + ])), + ]; + yield 'tools_no_phpmd' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPMD]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpmd', - 'phpmd/phpmd', - ])), - ], - - 'tools_no_phpmd_circleci' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpmd', + 'phpmd/phpmd', + ])), + ]; + yield 'tools_no_phpmd_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPMD]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpmd', - 'phpmd/phpmd', - ])), - ], - - 'tools_no_eslint' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpmd', + 'phpmd/phpmd', + ])), + ]; + yield 'tools_no_eslint' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::ESLINT]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $pj = static::$sut . '/package.json'; $test->assertFileNotContainsString($pj, '"eslint":'); $test->assertFileNotContainsString($pj, '"eslint-config-airbnb-base":'); @@ -184,16 +174,15 @@ public static function dataProviderHandlerProcess(): array { $test->assertFileDoesNotExist(static::$sut . '/.prettierignore'); $test->assertFileContainsString($pj, '"stylelint":'); $test->assertFileExists(static::$sut . '/.stylelintrc.js'); - }), - ], - - 'tools_no_eslint_circleci' => [ - static::cw(function (): void { + }), + ]; + yield 'tools_no_eslint_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::ESLINT]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $pj = static::$sut . '/package.json'; $test->assertFileNotContainsString($pj, '"eslint":'); $test->assertFileNotContainsString($pj, '"eslint-config-airbnb-base":'); @@ -211,16 +200,15 @@ public static function dataProviderHandlerProcess(): array { $test->assertFileDoesNotExist(static::$sut . '/.prettierignore'); $test->assertFileContainsString($pj, '"stylelint":'); $test->assertFileExists(static::$sut . '/.stylelintrc.js'); - }), - ], - - 'tools_no_stylelint' => [ - static::cw(function (): void { + }), + ]; + yield 'tools_no_stylelint' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::STYLELINT]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $pj = static::$sut . '/package.json'; $test->assertFileNotContainsString($pj, '"stylelint":'); $test->assertFileNotContainsString($pj, '"stylelint-config-standard":'); @@ -228,16 +216,15 @@ public static function dataProviderHandlerProcess(): array { $test->assertFileDoesNotExist(static::$sut . '/.stylelintrc.js'); $test->assertFileContainsString($pj, '"eslint":'); $test->assertFileExists(static::$sut . '/.eslintrc.json'); - }), - ], - - 'tools_no_stylelint_circleci' => [ - static::cw(function (): void { + }), + ]; + yield 'tools_no_stylelint_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::STYLELINT]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $pj = static::$sut . '/package.json'; $test->assertFileNotContainsString($pj, '"stylelint":'); $test->assertFileNotContainsString($pj, '"stylelint-config-standard":'); @@ -245,123 +232,116 @@ public static function dataProviderHandlerProcess(): array { $test->assertFileDoesNotExist(static::$sut . '/.stylelintrc.js'); $test->assertFileContainsString($pj, '"eslint":'); $test->assertFileExists(static::$sut . '/.eslintrc.json'); - }), - ], - - 'tools_no_phpunit' => [ - static::cw(function (): void { + }), + ]; + yield 'tools_no_phpunit' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPUNIT]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpunit', - 'ahoy test-unit', - 'ahoy test-kernel', - 'ahoy test-functional', - ])), - ], - - 'tools_no_phpunit_circleci' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpunit', + 'ahoy test-unit', + 'ahoy test-kernel', + 'ahoy test-functional', + ])), + ]; + yield 'tools_no_phpunit_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPUNIT]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpunit', - 'ahoy test-unit', - 'ahoy test-kernel', - 'ahoy test-functional', - ])), - ], - - 'tools_no_behat' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpunit', + 'ahoy test-unit', + 'ahoy test-kernel', + 'ahoy test-functional', + ])), + ]; + yield 'tools_no_behat' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::BEHAT]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'behat', - 'behat/behat', - 'drupal/drupal-extension', - 'ahoy test-bdd', - 'gherkinlint', - 'gherkin-lint', - 'gherkin', - 'bdd', - ])), - ], - - 'tools_no_behat_circleci' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'behat', + 'behat/behat', + 'drupal/drupal-extension', + 'ahoy test-bdd', + 'gherkinlint', + 'gherkin-lint', + 'gherkin', + 'bdd', + ])), + ]; + yield 'tools_no_behat_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::BEHAT]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'behat', - 'behat/behat', - 'drupal/drupal-extension', - 'ahoy test-bdd', - 'gherkinlint', - 'gherkin-lint', - 'gherkin', - ])), - ], - - 'tools_groups_no_be_lint' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'behat', + 'behat/behat', + 'drupal/drupal-extension', + 'ahoy test-bdd', + 'gherkinlint', + 'gherkin-lint', + 'gherkin', + ])), + ]; + yield 'tools_groups_no_be_lint' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPCS, Tools::PHPMD, Tools::PHPSTAN, Tools::RECTOR]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpcs', - 'phpcbf', - 'dealerdirect/phpcodesniffer-composer-installer', - 'drupal/coder', - 'squizlabs/php_codesniffer', - 'phpmd', - 'phpmd/phpmd', - 'phpstan', - 'phpstan/phpstan', - 'mglaman/phpstan-drupal', - 'rector', - 'rector/rector', - ])), - ], - - 'tools_groups_no_be_lint_circleci' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpcs', + 'phpcbf', + 'dealerdirect/phpcodesniffer-composer-installer', + 'drupal/coder', + 'squizlabs/php_codesniffer', + 'phpmd', + 'phpmd/phpmd', + 'phpstan', + 'phpstan/phpstan', + 'mglaman/phpstan-drupal', + 'rector', + 'rector/rector', + ])), + ]; + yield 'tools_groups_no_be_lint_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPCS, Tools::PHPMD, Tools::PHPSTAN, Tools::RECTOR]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpcs', - 'phpcbf', - 'dealerdirect/phpcodesniffer-composer-installer', - 'drupal/coder', - 'squizlabs/php_codesniffer', - 'phpmd', - 'phpmd/phpmd', - 'phpstan', - 'phpstan/phpstan', - 'mglaman/phpstan-drupal', - 'rector', - 'rector/rector', - ])), - ], - - 'tools_groups_no_fe_lint' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpcs', + 'phpcbf', + 'dealerdirect/phpcodesniffer-composer-installer', + 'drupal/coder', + 'squizlabs/php_codesniffer', + 'phpmd', + 'phpmd/phpmd', + 'phpstan', + 'phpstan/phpstan', + 'mglaman/phpstan-drupal', + 'rector', + 'rector/rector', + ])), + ]; + yield 'tools_groups_no_fe_lint' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::ESLINT, Tools::STYLELINT]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileDoesNotExist(static::$sut . '/package.json'); $test->assertFileDoesNotExist(static::$sut . '/yarn.lock'); $test->assertFileDoesNotExist(static::$sut . '/.eslintrc.json'); @@ -369,16 +349,15 @@ public static function dataProviderHandlerProcess(): array { $test->assertFileDoesNotExist(static::$sut . '/.prettierrc.json'); $test->assertFileDoesNotExist(static::$sut . '/.prettierignore'); $test->assertFileDoesNotExist(static::$sut . '/.stylelintrc.js'); - }), - ], - - 'tools_groups_no_fe_lint_circleci' => [ - static::cw(function (): void { + }), + ]; + yield 'tools_groups_no_fe_lint_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::ESLINT, Tools::STYLELINT]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileDoesNotExist(static::$sut . '/package.json'); $test->assertFileDoesNotExist(static::$sut . '/yarn.lock'); $test->assertFileDoesNotExist(static::$sut . '/.eslintrc.json'); @@ -386,59 +365,56 @@ public static function dataProviderHandlerProcess(): array { $test->assertFileDoesNotExist(static::$sut . '/.prettierrc.json'); $test->assertFileDoesNotExist(static::$sut . '/.prettierignore'); $test->assertFileDoesNotExist(static::$sut . '/.stylelintrc.js'); - }), - ], - - 'tools_groups_no_be_tests' => [ - static::cw(function (): void { + }), + ]; + yield 'tools_groups_no_be_tests' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPUNIT, Tools::BEHAT]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpunit', - 'ahoy test-unit', - 'ahoy test-kernel', - 'ahoy test-functional', - 'behat', - 'behat/behat', - 'drupal/drupal-extension', - 'ahoy test-bdd', - 'gherkinlint', - 'gherkin-lint', - 'gherkin', - ])), - ], - - 'tools_groups_no_be_tests_circleci' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpunit', + 'ahoy test-unit', + 'ahoy test-kernel', + 'ahoy test-functional', + 'behat', + 'behat/behat', + 'drupal/drupal-extension', + 'ahoy test-bdd', + 'gherkinlint', + 'gherkin-lint', + 'gherkin', + ])), + ]; + yield 'tools_groups_no_be_tests_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::PHPUNIT, Tools::BEHAT]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); - }), - static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ - 'phpunit', - 'ahoy test-unit', - 'ahoy test-kernel', - 'ahoy test-functional', - 'behat', - 'behat/behat', - 'drupal/drupal-extension', - 'ahoy test-bdd', - 'gherkinlint', - 'gherkin-lint', - 'gherkin', - ])), - ], - - 'tools_groups_no_fe_lint_no_theme' => [ - static::cw(function (): void { + }), + static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([ + 'phpunit', + 'ahoy test-unit', + 'ahoy test-kernel', + 'ahoy test-functional', + 'behat', + 'behat/behat', + 'drupal/drupal-extension', + 'ahoy test-bdd', + 'gherkinlint', + 'gherkin-lint', + 'gherkin', + ])), + ]; + yield 'tools_groups_no_fe_lint_no_theme' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::ESLINT, Tools::STYLELINT]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); Env::put(Theme::envName(), Theme::OLIVERO); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileDoesNotExist(static::$sut . '/package.json'); $test->assertFileDoesNotExist(static::$sut . '/yarn.lock'); $test->assertFileDoesNotExist(static::$sut . '/.eslintrc.json'); @@ -452,17 +428,16 @@ public static function dataProviderHandlerProcess(): array { 'ahoy fei', '/\bfei:/', ]); - }), - ], - - 'tools_groups_no_fe_lint_no_theme_circleci' => [ - static::cw(function (): void { + }), + ]; + yield 'tools_groups_no_fe_lint_no_theme_circleci' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::ESLINT, Tools::STYLELINT]))); Env::put(CiProvider::envName(), CiProvider::CIRCLECI); Env::put(Theme::envName(), Theme::OLIVERO); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertFileDoesNotExist(static::$sut . '/package.json'); $test->assertFileDoesNotExist(static::$sut . '/yarn.lock'); $test->assertFileDoesNotExist(static::$sut . '/.eslintrc.json'); @@ -476,17 +451,16 @@ public static function dataProviderHandlerProcess(): array { 'ahoy fei', '/\bfei:/', ]); - }), - ], - - 'tools_no_stylelint_no_theme' => [ - static::cw(function (): void { + }), + ]; + yield 'tools_no_stylelint_no_theme' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::STYLELINT]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); Env::put(Theme::envName(), Theme::OLIVERO); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $pj = static::$sut . '/package.json'; $test->assertFileNotContainsString($pj, '"stylelint":'); $test->assertFileNotContainsString($pj, '"stylelint-config-standard":'); @@ -495,17 +469,16 @@ public static function dataProviderHandlerProcess(): array { $test->assertFileContainsString($pj, '"eslint":'); $test->assertFileExists(static::$sut . '/.eslintrc.json'); $test->assertSutContains(['yarn install', 'yarn run lint']); - }), - ], - - 'tools_no_eslint_no_theme' => [ - static::cw(function (): void { + }), + ]; + yield 'tools_no_eslint_no_theme' => [ + static::cw(function (): void { $tools = array_keys(Tools::getToolDefinitions('tools')); Env::put(Tools::envName(), Converter::toList(array_diff($tools, [Tools::ESLINT]))); Env::put(CiProvider::envName(), CiProvider::GITHUB_ACTIONS); Env::put(Theme::envName(), Theme::OLIVERO); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $pj = static::$sut . '/package.json'; $test->assertFileNotContainsString($pj, '"eslint":'); $test->assertFileNotContainsString($pj, '"eslint-config-airbnb-base":'); @@ -517,8 +490,7 @@ public static function dataProviderHandlerProcess(): array { $test->assertFileContainsString($pj, '"stylelint":'); $test->assertFileExists(static::$sut . '/.stylelintrc.js'); $test->assertSutContains(['yarn install', 'yarn run lint']); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Functional/Handlers/VersionSchemeHandlerProcessTest.php b/.vortex/installer/tests/Functional/Handlers/VersionSchemeHandlerProcessTest.php index 9e83fe693..0167f12a2 100644 --- a/.vortex/installer/tests/Functional/Handlers/VersionSchemeHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Handlers/VersionSchemeHandlerProcessTest.php @@ -12,41 +12,39 @@ #[CoversClass(VersionScheme::class)] class VersionSchemeHandlerProcessTest extends AbstractHandlerProcessTestCase { - public static function dataProviderHandlerProcess(): array { - return [ - 'version_scheme_calver' => [ - static::cw(function (): void { + public static function dataProviderHandlerProcess(): \Iterator { + yield 'version_scheme_calver' => [ + static::cw(function (): void { Env::put(VersionScheme::envName(), VersionScheme::CALVER); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutContains('Calendar Versioning'); $test->assertSutContains('calver.org'); $test->assertSutNotContains('Semantic Versioning'); $test->assertSutNotContains('semver.org'); - }), - ], - 'version_scheme_semver' => [ - static::cw(function (): void { + }), + ]; + yield 'version_scheme_semver' => [ + static::cw(function (): void { Env::put(VersionScheme::envName(), VersionScheme::SEMVER); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutContains('Semantic Versioning'); $test->assertSutContains('semver.org'); $test->assertSutNotContains('Calendar Versioning'); $test->assertSutNotContains('calver.org'); - }), - ], - 'version_scheme_other' => [ - static::cw(function (): void { + }), + ]; + yield 'version_scheme_other' => [ + static::cw(function (): void { Env::put(VersionScheme::envName(), VersionScheme::OTHER); - }), - static::cw(function (FunctionalTestCase $test): void { + }), + static::cw(function (FunctionalTestCase $test): void { $test->assertSutNotContains('Semantic Versioning'); $test->assertSutNotContains('semver.org'); $test->assertSutNotContains('Calendar Versioning'); $test->assertSutNotContains('calver.org'); - }), - ], + }), ]; } diff --git a/.vortex/installer/tests/Unit/ConfigTest.php b/.vortex/installer/tests/Unit/ConfigTest.php index 50dca04ea..bd54bde6b 100644 --- a/.vortex/installer/tests/Unit/ConfigTest.php +++ b/.vortex/installer/tests/Unit/ConfigTest.php @@ -65,32 +65,30 @@ public function testFromStringValid(string $json, array $expectedValues): void { } } - public static function dataProviderFromStringValid(): array { - return [ - 'empty_json' => [ - '{}', + public static function dataProviderFromStringValid(): \Iterator { + yield 'empty_json' => [ + '{}', [], - ], - 'single_value' => [ - '{"name": "test"}', + ]; + yield 'single_value' => [ + '{"name": "test"}', ['NAME' => 'test'], - ], - 'multiple_values' => [ - '{"name": "test", "version": "1.0.0", "debug": true}', + ]; + yield 'multiple_values' => [ + '{"name": "test", "version": "1.0.0", "debug": true}', ['NAME' => 'test', 'VERSION' => '1.0.0', 'DEBUG' => TRUE], - ], - 'mixed_types' => [ - '{"string": "value", "number": 42, "boolean": true, "null": null}', + ]; + yield 'mixed_types' => [ + '{"string": "value", "number": 42, "boolean": true, "null": null}', ['STRING' => 'value', 'NUMBER' => 42, 'BOOLEAN' => TRUE], - ], - 'nested_objects_and_arrays' => [ - '{"config": {"nested": "value"}, "list": [1, 2, 3]}', + ]; + yield 'nested_objects_and_arrays' => [ + '{"config": {"nested": "value"}, "list": [1, 2, 3]}', ['CONFIG' => ['nested' => 'value'], 'LIST' => [1, 2, 3]], - ], - 'lowercase_keys_get_uppercased' => [ - '{"lowercase_key": "value", "MixedCase": "value2"}', + ]; + yield 'lowercase_keys_get_uppercased' => [ + '{"lowercase_key": "value", "MixedCase": "value2"}', ['LOWERCASE_KEY' => 'value', 'MIXEDCASE' => 'value2'], - ], ]; } @@ -102,36 +100,34 @@ public function testFromStringInvalid(string $json, string $expectedError): void Config::fromString($json); } - public static function dataProviderFromStringInvalid(): array { - return [ - 'invalid_json' => [ - '{invalid json}', - 'Invalid configuration JSON string provided.', - ], - 'non_object_json' => [ - '"just a string"', - 'Invalid configuration JSON string provided.', - ], - 'array_json' => [ - '[1, 2, 3]', - 'Invalid key "0" in JSON string provided.', - ], - 'numeric_json' => [ - '42', - 'Invalid configuration JSON string provided.', - ], - 'boolean_json' => [ - 'true', - 'Invalid configuration JSON string provided.', - ], - 'null_json' => [ - 'null', - 'Invalid configuration JSON string provided.', - ], - 'numeric_key' => [ - '{"123": "value"}', - 'Invalid key "123" in JSON string provided.', - ], + public static function dataProviderFromStringInvalid(): \Iterator { + yield 'invalid_json' => [ + '{invalid json}', + 'Invalid configuration JSON string provided.', + ]; + yield 'non_object_json' => [ + '"just a string"', + 'Invalid configuration JSON string provided.', + ]; + yield 'array_json' => [ + '[1, 2, 3]', + 'Invalid key "0" in JSON string provided.', + ]; + yield 'numeric_json' => [ + '42', + 'Invalid configuration JSON string provided.', + ]; + yield 'boolean_json' => [ + 'true', + 'Invalid configuration JSON string provided.', + ]; + yield 'null_json' => [ + 'null', + 'Invalid configuration JSON string provided.', + ]; + yield 'numeric_key' => [ + '{"123": "value"}', + 'Invalid key "123" in JSON string provided.', ]; } @@ -149,16 +145,14 @@ public function testGetAndSet(string $name, mixed $value, mixed $default, mixed $this->assertEquals($expected, $config->get($name)); } - public static function dataProviderGetAndSet(): array { - return [ - 'string_value' => ['TEST_STRING', 'test_value', 'default', 'test_value'], - 'integer_value' => ['TEST_INT', 42, 0, 42], - 'boolean_true' => ['TEST_BOOL_TRUE', TRUE, FALSE, TRUE], - 'boolean_false' => ['TEST_BOOL_FALSE', FALSE, TRUE, FALSE], - 'null_value' => ['TEST_NULL', NULL, 'default', NULL], - 'array_value' => ['TEST_ARRAY', ['a', 'b', 'c'], [], ['a', 'b', 'c']], - 'object_value' => ['TEST_OBJECT', (object) ['key' => 'value'], NULL, (object) ['key' => 'value']], - ]; + public static function dataProviderGetAndSet(): \Iterator { + yield 'string_value' => ['TEST_STRING', 'test_value', 'default', 'test_value']; + yield 'integer_value' => ['TEST_INT', 42, 0, 42]; + yield 'boolean_true' => ['TEST_BOOL_TRUE', TRUE, FALSE, TRUE]; + yield 'boolean_false' => ['TEST_BOOL_FALSE', FALSE, TRUE, FALSE]; + yield 'null_value' => ['TEST_NULL', NULL, 'default', NULL]; + yield 'array_value' => ['TEST_ARRAY', ['a', 'b', 'c'], [], ['a', 'b', 'c']]; + yield 'object_value' => ['TEST_OBJECT', (object) ['key' => 'value'], NULL, (object) ['key' => 'value']]; } public function testSetWithEnvironmentVariable(): void { @@ -213,18 +207,16 @@ public function testIsQuiet(mixed $value, bool $expected): void { $this->assertEquals($expected, $config->isQuiet()); } - public static function dataProviderIsQuiet(): array { - return [ - 'boolean_true' => [TRUE, TRUE], - 'boolean_false' => [FALSE, FALSE], - 'string_true' => ['true', TRUE], - // Non-empty string is truthy. - 'string_false' => ['false', TRUE], - 'string_empty' => ['', FALSE], - 'integer_zero' => [0, FALSE], - 'integer_non_zero' => [1, TRUE], - 'null' => [NULL, FALSE], - ]; + public static function dataProviderIsQuiet(): \Iterator { + yield 'boolean_true' => [TRUE, TRUE]; + yield 'boolean_false' => [FALSE, FALSE]; + yield 'string_true' => ['true', TRUE]; + // Non-empty string is truthy. + yield 'string_false' => ['false', TRUE]; + yield 'string_empty' => ['', FALSE]; + yield 'integer_zero' => [0, FALSE]; + yield 'integer_non_zero' => [1, TRUE]; + yield 'null' => [NULL, FALSE]; } public function testSetQuiet(): void { @@ -251,18 +243,16 @@ public function testGetNoInteraction(mixed $value, bool $expected): void { $this->assertEquals($expected, $config->getNoInteraction()); } - public static function dataProviderGetNoInteraction(): array { - return [ - 'boolean_true' => [TRUE, TRUE], - 'boolean_false' => [FALSE, FALSE], - 'string_true' => ['true', TRUE], - // Non-empty string is truthy. - 'string_false' => ['false', TRUE], - 'string_empty' => ['', FALSE], - 'integer_zero' => [0, FALSE], - 'integer_non_zero' => [1, TRUE], - 'null' => [NULL, FALSE], - ]; + public static function dataProviderGetNoInteraction(): \Iterator { + yield 'boolean_true' => [TRUE, TRUE]; + yield 'boolean_false' => [FALSE, FALSE]; + yield 'string_true' => ['true', TRUE]; + // Non-empty string is truthy. + yield 'string_false' => ['false', TRUE]; + yield 'string_empty' => ['', FALSE]; + yield 'integer_zero' => [0, FALSE]; + yield 'integer_non_zero' => [1, TRUE]; + yield 'null' => [NULL, FALSE]; } public function testSetNoInteraction(): void { @@ -289,18 +279,16 @@ public function testIsVortexProject(mixed $value, bool $expected): void { $this->assertEquals($expected, $config->isVortexProject()); } - public static function dataProviderIsVortexProject(): array { - return [ - 'boolean_true' => [TRUE, TRUE], - 'boolean_false' => [FALSE, FALSE], - 'string_true' => ['true', TRUE], - // Non-empty string is truthy. - 'string_false' => ['false', TRUE], - 'string_empty' => ['', FALSE], - 'integer_zero' => [0, FALSE], - 'integer_non_zero' => [1, TRUE], - 'null' => [NULL, FALSE], - ]; + public static function dataProviderIsVortexProject(): \Iterator { + yield 'boolean_true' => [TRUE, TRUE]; + yield 'boolean_false' => [FALSE, FALSE]; + yield 'string_true' => ['true', TRUE]; + // Non-empty string is truthy. + yield 'string_false' => ['false', TRUE]; + yield 'string_empty' => ['', FALSE]; + yield 'integer_zero' => [0, FALSE]; + yield 'integer_non_zero' => [1, TRUE]; + yield 'null' => [NULL, FALSE]; } public function testConstants(): void { diff --git a/.vortex/installer/tests/Unit/ConverterTest.php b/.vortex/installer/tests/Unit/ConverterTest.php index f42a2ed68..3669212f8 100644 --- a/.vortex/installer/tests/Unit/ConverterTest.php +++ b/.vortex/installer/tests/Unit/ConverterTest.php @@ -19,70 +19,56 @@ public function testMachineExtended(string $input, string $expected): void { $this->assertEquals($expected, Converter::machineExtended($input)); } - public static function dataProviderMachineExtended(): array { - return [ - // Basic cases. - ['hello world', 'hello_world'], - ['Hello World', 'hello_world'], - ['HELLO WORLD', 'hello_world'], - - // Multiple spaces. - ['hello world', 'hello__world'], - ['hello world', 'hello___world'], - - // Mixed case with spaces. - ['My Project Name', 'my_project_name'], - ['YOUR_SITE_NAME', 'your_site_name'], - - // Already underscored. - ['hello_world', 'hello_world'], - ['Hello_World', 'hello_world'], - - // Special characters (should be removed by strict()) - ['hello@world!', 'helloworld'], - ['my-project#name$', 'my-projectname'], - ['test%^&*()project', 'testproject'], - - // Numbers. - ['project 123', 'project_123'], - ['Project2024 Name', 'project2024_name'], - - // Unicode characters (should be replaced by strict()) - ['café münü', 'cafe_munu'], - ['project 😀 name', 'project__name'], - - // Hyphens and underscores mixed. - ['my-project_name', 'my-project_name'], - ['test-case_example', 'test-case_example'], - - // Empty and edge cases. - ['', ''], - [' ', '_'], - [' ', '__'], - ['_', '_'], - ['-', '-'], - - // Single word. - ['project', 'project'], - ['PROJECT', 'project'], - ['Project', 'project'], - - // Leading/trailing spaces. - [' hello world ', '_hello_world_'], - [' test ', '__test__'], - - // Only special characters. - ['@#$%', ''], - ['!!!', ''], - ['***', ''], - - // Real-world examples. - ['My Awesome Project', 'my_awesome_project'], - ['DrevOps Vortex', 'drevops_vortex'], - ['Site Name 2024', 'site_name_2024'], - ['your_site_theme', 'your_site_theme'], - ['YourSiteTheme', 'yoursitetheme'], - ]; + public static function dataProviderMachineExtended(): \Iterator { + // Basic cases. + yield ['hello world', 'hello_world']; + yield ['Hello World', 'hello_world']; + yield ['HELLO WORLD', 'hello_world']; + // Multiple spaces. + yield ['hello world', 'hello__world']; + yield ['hello world', 'hello___world']; + // Mixed case with spaces. + yield ['My Project Name', 'my_project_name']; + yield ['YOUR_SITE_NAME', 'your_site_name']; + // Already underscored. + yield ['hello_world', 'hello_world']; + yield ['Hello_World', 'hello_world']; + // Special characters (should be removed by strict()) + yield ['hello@world!', 'helloworld']; + yield ['my-project#name$', 'my-projectname']; + yield ['test%^&*()project', 'testproject']; + // Numbers. + yield ['project 123', 'project_123']; + yield ['Project2024 Name', 'project2024_name']; + // Unicode characters (should be replaced by strict()) + yield ['café münü', 'cafe_munu']; + yield ['project 😀 name', 'project__name']; + // Hyphens and underscores mixed. + yield ['my-project_name', 'my-project_name']; + yield ['test-case_example', 'test-case_example']; + // Empty and edge cases. + yield ['', '']; + yield [' ', '_']; + yield [' ', '__']; + yield ['_', '_']; + yield ['-', '-']; + // Single word. + yield ['project', 'project']; + yield ['PROJECT', 'project']; + yield ['Project', 'project']; + // Leading/trailing spaces. + yield [' hello world ', '_hello_world_']; + yield [' test ', '__test__']; + // Only special characters. + yield ['@#$%', '']; + yield ['!!!', '']; + yield ['***', '']; + // Real-world examples. + yield ['My Awesome Project', 'my_awesome_project']; + yield ['DrevOps Vortex', 'drevops_vortex']; + yield ['Site Name 2024', 'site_name_2024']; + yield ['your_site_theme', 'your_site_theme']; + yield ['YourSiteTheme', 'yoursitetheme']; } } diff --git a/.vortex/installer/tests/Unit/Downloader/ArchiverTest.php b/.vortex/installer/tests/Unit/Downloader/ArchiverTest.php index ebeda9a99..b6529c218 100644 --- a/.vortex/installer/tests/Unit/Downloader/ArchiverTest.php +++ b/.vortex/installer/tests/Unit/Downloader/ArchiverTest.php @@ -98,136 +98,126 @@ public function testExtractErrors(?string $extension, ?string $content, bool $st /** * Data provider for testDetectFormat(). * - * @return array> + * @return \Iterator> * Test data. */ - public static function dataProviderDetectFormat(): array { - return [ - 'tar.gz' => [ - 'creator' => 'createTestTarGz', - 'expected' => 'tar.gz', - ], - 'tar' => [ - 'creator' => 'createTestTar', - 'expected' => 'tar', - ], - 'zip' => [ - 'creator' => 'createTestZip', - 'expected' => 'zip', - ], + public static function dataProviderDetectFormat(): \Iterator { + yield 'tar.gz' => [ + 'creator' => 'createTestTarGz', + 'expected' => 'tar.gz', + ]; + yield 'tar' => [ + 'creator' => 'createTestTar', + 'expected' => 'tar', + ]; + yield 'zip' => [ + 'creator' => 'createTestZip', + 'expected' => 'zip', ]; } /** * Data provider for testValidateValidArchive(). * - * @return array> + * @return \Iterator> * Test data. */ - public static function dataProviderValidateValidArchive(): array { - return [ - 'tar.gz' => [ - 'creator' => 'createTestTarGz', - ], - 'zip' => [ - 'creator' => 'createTestZip', - ], + public static function dataProviderValidateValidArchive(): \Iterator { + yield 'tar.gz' => [ + 'creator' => 'createTestTarGz', + ]; + yield 'zip' => [ + 'creator' => 'createTestZip', ]; } /** * Data provider for testValidateInvalid(). * - * @return array> + * @return \Iterator> * Test data. */ - public static function dataProviderValidateInvalid(): array { - return [ - 'non-existent file' => [ - 'path' => '/non/existent/file.tar.gz', - 'content' => NULL, - 'expectedMessage' => 'Archive file does not exist', - ], - 'empty file' => [ - 'path' => NULL, - 'content' => '', - 'expectedMessage' => 'Archive is empty', - ], - 'invalid archive' => [ - 'path' => NULL, - 'content' => 'This is not an archive', - 'expectedMessage' => 'File does not appear to be a valid archive', - ], + public static function dataProviderValidateInvalid(): \Iterator { + yield 'non-existent file' => [ + 'path' => '/non/existent/file.tar.gz', + 'content' => NULL, + 'expectedMessage' => 'Archive file does not exist', + ]; + yield 'empty file' => [ + 'path' => NULL, + 'content' => '', + 'expectedMessage' => 'Archive is empty', + ]; + yield 'invalid archive' => [ + 'path' => NULL, + 'content' => 'This is not an archive', + 'expectedMessage' => 'File does not appear to be a valid archive', ]; } /** * Data provider for testExtract(). * - * @return array> + * @return \Iterator> * Test data. */ - public static function dataProviderExtract(): array { - return [ - 'tar.gz without strip' => [ - 'creator' => 'createTestTarGz', - 'strip' => FALSE, - 'expectedPath' => '/test_archive/test_file.txt', - ], - 'tar.gz with strip' => [ - 'creator' => 'createTestTarGz', - 'strip' => TRUE, - 'expectedPath' => '/test_file.txt', - ], - 'zip without strip' => [ - 'creator' => 'createTestZip', - 'strip' => FALSE, - 'expectedPath' => '/test_archive/test_file.txt', - ], - 'zip with strip' => [ - 'creator' => 'createTestZip', - 'strip' => TRUE, - 'expectedPath' => '/test_file.txt', - ], + public static function dataProviderExtract(): \Iterator { + yield 'tar.gz without strip' => [ + 'creator' => 'createTestTarGz', + 'strip' => FALSE, + 'expectedPath' => '/test_archive/test_file.txt', + ]; + yield 'tar.gz with strip' => [ + 'creator' => 'createTestTarGz', + 'strip' => TRUE, + 'expectedPath' => '/test_file.txt', + ]; + yield 'zip without strip' => [ + 'creator' => 'createTestZip', + 'strip' => FALSE, + 'expectedPath' => '/test_archive/test_file.txt', + ]; + yield 'zip with strip' => [ + 'creator' => 'createTestZip', + 'strip' => TRUE, + 'expectedPath' => '/test_file.txt', ]; } /** * Data provider for testExtractErrors(). * - * @return array> + * @return \Iterator> * Test data. */ - public static function dataProviderExtractErrors(): array { - return [ - 'unsupported format' => [ - 'extension' => '.rar', - 'content' => 'Rar! fake content', - 'strip' => FALSE, - 'creator' => NULL, - 'expectedMessage' => 'Unsupported archive format', - ], - 'invalid tar.gz archive' => [ - 'extension' => '.tar.gz', - 'content' => "\x1f\x8b" . 'invalid tar content', - 'strip' => FALSE, - 'creator' => NULL, - 'expectedMessage' => 'Failed to extract tar archive', - ], - 'invalid zip archive' => [ - 'extension' => '.zip', - 'content' => "\x50\x4b\x03\x04invalid zip content", - 'strip' => FALSE, - 'creator' => NULL, - 'expectedMessage' => 'Failed to extract ZIP archive', - ], - 'multiple top-level directories with strip' => [ - 'extension' => NULL, - 'content' => NULL, - 'strip' => TRUE, - 'creator' => 'createTestMultipleTopLevel', - 'expectedMessage' => 'Expected single top-level directory in archive', - ], + public static function dataProviderExtractErrors(): \Iterator { + yield 'unsupported format' => [ + 'extension' => '.rar', + 'content' => 'Rar! fake content', + 'strip' => FALSE, + 'creator' => NULL, + 'expectedMessage' => 'Unsupported archive format', + ]; + yield 'invalid tar.gz archive' => [ + 'extension' => '.tar.gz', + 'content' => "\x1f\x8b" . 'invalid tar content', + 'strip' => FALSE, + 'creator' => NULL, + 'expectedMessage' => 'Failed to extract tar archive', + ]; + yield 'invalid zip archive' => [ + 'extension' => '.zip', + 'content' => "\x50\x4b\x03\x04invalid zip content", + 'strip' => FALSE, + 'creator' => NULL, + 'expectedMessage' => 'Failed to extract ZIP archive', + ]; + yield 'multiple top-level directories with strip' => [ + 'extension' => NULL, + 'content' => NULL, + 'strip' => TRUE, + 'creator' => 'createTestMultipleTopLevel', + 'expectedMessage' => 'Expected single top-level directory in archive', ]; } diff --git a/.vortex/installer/tests/Unit/Downloader/ArtifactTest.php b/.vortex/installer/tests/Unit/Downloader/ArtifactTest.php index 7240fa37a..de018772f 100644 --- a/.vortex/installer/tests/Unit/Downloader/ArtifactTest.php +++ b/.vortex/installer/tests/Unit/Downloader/ArtifactTest.php @@ -35,197 +35,188 @@ public function testFromUri(?string $uri, string $expectedRepo, string $expected /** * Data provider for testFromUri(). */ - public static function dataProviderFromUri(): array { - return [ - // Default URI cases. - 'null uri defaults to default repo and stable ref' => [ - NULL, - RepositoryDownloader::DEFAULT_REPO, - RepositoryDownloader::REF_STABLE, - ], - 'empty string defaults to default repo and stable ref' => [ - '', - RepositoryDownloader::DEFAULT_REPO, - RepositoryDownloader::REF_STABLE, - ], - - // GitHub HTTPS patterns. - 'https url with #ref' => [ - 'https://github.com/drevops/vortex.git#1.0.0', - 'https://github.com/drevops/vortex.git', - '1.0.0', - ], - 'https url without #ref defaults to HEAD' => [ - 'https://github.com/drevops/vortex.git', - 'https://github.com/drevops/vortex.git', - 'HEAD', - ], - 'https url with release tag pattern' => [ - 'https://github.com/drevops/vortex/releases/tag/25.11.0', - 'https://github.com/drevops/vortex', - '25.11.0', - ], - 'https url with tree pattern' => [ - 'https://github.com/drevops/vortex/tree/feature-branch', - 'https://github.com/drevops/vortex', - 'feature-branch', - ], - 'https url with commit pattern' => [ - 'https://github.com/drevops/vortex/commit/abc123def', - 'https://github.com/drevops/vortex', - 'abc123def', - ], - - // Git SSH patterns. - 'git@ scp-style with #ref' => [ - 'git@github.com:drevops/vortex#stable', - 'git@github.com:drevops/vortex', - 'stable', - ], - 'git@ scp-style without #ref defaults to HEAD' => [ - 'git@github.com:drevops/vortex', - 'git@github.com:drevops/vortex', - 'HEAD', - ], - - // SSH and Git protocol URLs. - 'ssh:// url with #ref' => [ - 'ssh://git@github.com/drevops/vortex#develop', - 'ssh://git@github.com/drevops/vortex', - 'develop', - ], - 'ssh:// url without #ref defaults to HEAD' => [ - 'ssh://git@github.com/drevops/vortex', - 'ssh://git@github.com/drevops/vortex', - 'HEAD', - ], - 'git:// url with #ref' => [ - 'git://github.com/drevops/vortex#main', - 'git://github.com/drevops/vortex', - 'main', - ], - 'git:// url without #ref defaults to HEAD' => [ - 'git://github.com/drevops/vortex', - 'git://github.com/drevops/vortex', - 'HEAD', - ], - 'http:// url with #ref' => [ - 'http://github.com/drevops/vortex#feature', - 'http://github.com/drevops/vortex', - 'feature', - ], - 'http:// url without #ref defaults to HEAD' => [ - 'http://github.com/drevops/vortex', - 'http://github.com/drevops/vortex', - 'HEAD', - ], - - // Local path patterns. - 'local path with #ref' => [ - '/path/to/repo#develop', - '/path/to/repo', - 'develop', - ], - 'local path without #ref defaults to HEAD' => [ - '/path/to/repo', - '/path/to/repo', - 'HEAD', - ], - 'local path with trailing slash removed' => [ - '/path/to/repo/', - '/path/to/repo', - 'HEAD', - ], - 'file:// url with #ref' => [ - 'file:///path/to/repo#main', - '/path/to/repo', - 'main', - ], - 'file:// url without #ref' => [ - 'file:///path/to/repo', - '/path/to/repo', - 'HEAD', - ], - - // Invalid ref format. - 'invalid ref with space' => [ - 'https://github.com/drevops/vortex.git#invalid ref', - '', - '', - \RuntimeException::class, - 'Invalid git reference: "invalid ref"', - ], - 'invalid ref with trailing slash' => [ - 'https://github.com/drevops/vortex.git#feature/', - '', - '', - \RuntimeException::class, - 'Invalid git reference: "feature/"', - ], - 'invalid ref with consecutive slashes' => [ - 'https://github.com/drevops/vortex.git#feature//name', - '', - '', - \RuntimeException::class, - 'Invalid git reference: "feature//name"', - ], - - // Invalid URI formats. - 'invalid https format - missing path structure' => [ - 'https://github.com', - '', - '', - \RuntimeException::class, - 'Invalid remote repository format', - ], - 'invalid ssh format - missing colon' => [ - 'git@github.com', - '', - '', - \RuntimeException::class, - 'Invalid remote repository format', - ], - 'invalid file:// format - empty path' => [ - 'file://', - '', - '', - \RuntimeException::class, - 'Invalid local repository format', - ], - 'non-github https with invalid ref' => [ - 'https://gitlab.com/user/repo#invalid ref', - '', - '', - \RuntimeException::class, - 'Invalid git reference: "invalid ref"', - ], - - // Deprecated @ref syntax (supported until 1.1.0). - 'deprecated @ref with https' => [ - 'https://github.com/drevops/vortex.git@1.0.0', - 'https://github.com/drevops/vortex.git', - '1.0.0', - ], - 'deprecated @ref with http' => [ - 'http://github.com/drevops/vortex.git@stable', - 'http://github.com/drevops/vortex.git', - 'stable', - ], - 'deprecated @ref with ssh://' => [ - 'ssh://git@github.com/drevops/vortex@main', - 'ssh://git@github.com/drevops/vortex', - 'main', - ], - 'deprecated @ref with git://' => [ - 'git://github.com/drevops/vortex@develop', - 'git://github.com/drevops/vortex', - 'develop', - ], - 'deprecated @ref with git@ scp-style' => [ - 'git@github.com:drevops/vortex@feature', - 'git@github.com:drevops/vortex', - 'feature', - ], + public static function dataProviderFromUri(): \Iterator { + // Default URI cases. + yield 'null uri defaults to default repo and stable ref' => [ + NULL, + RepositoryDownloader::DEFAULT_REPO, + RepositoryDownloader::REF_STABLE, + ]; + yield 'empty string defaults to default repo and stable ref' => [ + '', + RepositoryDownloader::DEFAULT_REPO, + RepositoryDownloader::REF_STABLE, + ]; + // GitHub HTTPS patterns. + yield 'https url with #ref' => [ + 'https://github.com/drevops/vortex.git#1.0.0', + 'https://github.com/drevops/vortex.git', + '1.0.0', + ]; + yield 'https url without #ref defaults to HEAD' => [ + 'https://github.com/drevops/vortex.git', + 'https://github.com/drevops/vortex.git', + 'HEAD', + ]; + yield 'https url with release tag pattern' => [ + 'https://github.com/drevops/vortex/releases/tag/25.11.0', + 'https://github.com/drevops/vortex', + '25.11.0', + ]; + yield 'https url with tree pattern' => [ + 'https://github.com/drevops/vortex/tree/feature-branch', + 'https://github.com/drevops/vortex', + 'feature-branch', + ]; + yield 'https url with commit pattern' => [ + 'https://github.com/drevops/vortex/commit/abc123def', + 'https://github.com/drevops/vortex', + 'abc123def', + ]; + // Git SSH patterns. + yield 'git@ scp-style with #ref' => [ + 'git@github.com:drevops/vortex#stable', + 'git@github.com:drevops/vortex', + 'stable', + ]; + yield 'git@ scp-style without #ref defaults to HEAD' => [ + 'git@github.com:drevops/vortex', + 'git@github.com:drevops/vortex', + 'HEAD', + ]; + // SSH and Git protocol URLs. + yield 'ssh:// url with #ref' => [ + 'ssh://git@github.com/drevops/vortex#develop', + 'ssh://git@github.com/drevops/vortex', + 'develop', + ]; + yield 'ssh:// url without #ref defaults to HEAD' => [ + 'ssh://git@github.com/drevops/vortex', + 'ssh://git@github.com/drevops/vortex', + 'HEAD', + ]; + yield 'git:// url with #ref' => [ + 'git://github.com/drevops/vortex#main', + 'git://github.com/drevops/vortex', + 'main', + ]; + yield 'git:// url without #ref defaults to HEAD' => [ + 'git://github.com/drevops/vortex', + 'git://github.com/drevops/vortex', + 'HEAD', + ]; + yield 'http:// url with #ref' => [ + 'http://github.com/drevops/vortex#feature', + 'http://github.com/drevops/vortex', + 'feature', + ]; + yield 'http:// url without #ref defaults to HEAD' => [ + 'http://github.com/drevops/vortex', + 'http://github.com/drevops/vortex', + 'HEAD', + ]; + // Local path patterns. + yield 'local path with #ref' => [ + '/path/to/repo#develop', + '/path/to/repo', + 'develop', + ]; + yield 'local path without #ref defaults to HEAD' => [ + '/path/to/repo', + '/path/to/repo', + 'HEAD', + ]; + yield 'local path with trailing slash removed' => [ + '/path/to/repo/', + '/path/to/repo', + 'HEAD', + ]; + yield 'file:// url with #ref' => [ + 'file:///path/to/repo#main', + '/path/to/repo', + 'main', + ]; + yield 'file:// url without #ref' => [ + 'file:///path/to/repo', + '/path/to/repo', + 'HEAD', + ]; + // Invalid ref format. + yield 'invalid ref with space' => [ + 'https://github.com/drevops/vortex.git#invalid ref', + '', + '', + \RuntimeException::class, + 'Invalid git reference: "invalid ref"', + ]; + yield 'invalid ref with trailing slash' => [ + 'https://github.com/drevops/vortex.git#feature/', + '', + '', + \RuntimeException::class, + 'Invalid git reference: "feature/"', + ]; + yield 'invalid ref with consecutive slashes' => [ + 'https://github.com/drevops/vortex.git#feature//name', + '', + '', + \RuntimeException::class, + 'Invalid git reference: "feature//name"', + ]; + // Invalid URI formats. + yield 'invalid https format - missing path structure' => [ + 'https://github.com', + '', + '', + \RuntimeException::class, + 'Invalid remote repository format', + ]; + yield 'invalid ssh format - missing colon' => [ + 'git@github.com', + '', + '', + \RuntimeException::class, + 'Invalid remote repository format', + ]; + yield 'invalid file:// format - empty path' => [ + 'file://', + '', + '', + \RuntimeException::class, + 'Invalid local repository format', + ]; + yield 'non-github https with invalid ref' => [ + 'https://gitlab.com/user/repo#invalid ref', + '', + '', + \RuntimeException::class, + 'Invalid git reference: "invalid ref"', + ]; + // Deprecated @ref syntax (supported until 1.1.0). + yield 'deprecated @ref with https' => [ + 'https://github.com/drevops/vortex.git@1.0.0', + 'https://github.com/drevops/vortex.git', + '1.0.0', + ]; + yield 'deprecated @ref with http' => [ + 'http://github.com/drevops/vortex.git@stable', + 'http://github.com/drevops/vortex.git', + 'stable', + ]; + yield 'deprecated @ref with ssh://' => [ + 'ssh://git@github.com/drevops/vortex@main', + 'ssh://git@github.com/drevops/vortex', + 'main', + ]; + yield 'deprecated @ref with git://' => [ + 'git://github.com/drevops/vortex@develop', + 'git://github.com/drevops/vortex', + 'develop', + ]; + yield 'deprecated @ref with git@ scp-style' => [ + 'git@github.com:drevops/vortex@feature', + 'git@github.com:drevops/vortex', + 'feature', ]; } @@ -248,28 +239,26 @@ public function testCreate(string $repo, string $ref, ?string $expectedException /** * Data provider for testCreate(). */ - public static function dataProviderCreate(): array { - return [ - 'valid remote repo and ref' => [ - 'https://github.com/drevops/vortex.git', - '1.0.0', - ], - 'valid local repo and ref' => [ - '/path/to/repo', - 'main', - ], - 'invalid ref with space' => [ - 'https://github.com/drevops/vortex.git', - 'invalid ref', - \RuntimeException::class, - 'Invalid git reference: "invalid ref"', - ], - 'invalid ref with trailing slash' => [ - '/path/to/repo', - 'feature/', - \RuntimeException::class, - 'Invalid git reference: "feature/"', - ], + public static function dataProviderCreate(): \Iterator { + yield 'valid remote repo and ref' => [ + 'https://github.com/drevops/vortex.git', + '1.0.0', + ]; + yield 'valid local repo and ref' => [ + '/path/to/repo', + 'main', + ]; + yield 'invalid ref with space' => [ + 'https://github.com/drevops/vortex.git', + 'invalid ref', + \RuntimeException::class, + 'Invalid git reference: "invalid ref"', + ]; + yield 'invalid ref with trailing slash' => [ + '/path/to/repo', + 'feature/', + \RuntimeException::class, + 'Invalid git reference: "feature/"', ]; } @@ -282,17 +271,15 @@ public function testIsRemote(string $repo, bool $expected): void { /** * Data provider for testIsRemote(). */ - public static function dataProviderIsRemote(): array { - return [ - 'https url' => ['https://github.com/drevops/vortex.git', TRUE], - 'http url' => ['http://github.com/drevops/vortex.git', TRUE], - 'ssh:// url' => ['ssh://git@github.com/drevops/vortex.git', TRUE], - 'git:// url' => ['git://github.com/drevops/vortex.git', TRUE], - 'git@ scp-style url' => ['git@github.com:drevops/vortex', TRUE], - 'local absolute path' => ['/path/to/repo', FALSE], - 'local relative path' => ['./repo', FALSE], - 'file:// url treated as local' => ['file:///path/to/repo', FALSE], - ]; + public static function dataProviderIsRemote(): \Iterator { + yield 'https url' => ['https://github.com/drevops/vortex.git', TRUE]; + yield 'http url' => ['http://github.com/drevops/vortex.git', TRUE]; + yield 'ssh:// url' => ['ssh://git@github.com/drevops/vortex.git', TRUE]; + yield 'git:// url' => ['git://github.com/drevops/vortex.git', TRUE]; + yield 'git@ scp-style url' => ['git@github.com:drevops/vortex', TRUE]; + yield 'local absolute path' => ['/path/to/repo', FALSE]; + yield 'local relative path' => ['./repo', FALSE]; + yield 'file:// url treated as local' => ['file:///path/to/repo', FALSE]; } #[DataProvider('dataProviderIsLocal')] @@ -304,17 +291,15 @@ public function testIsLocal(string $repo, bool $expected): void { /** * Data provider for testIsLocal(). */ - public static function dataProviderIsLocal(): array { - return [ - 'https url' => ['https://github.com/drevops/vortex.git', FALSE], - 'http url' => ['http://github.com/drevops/vortex.git', FALSE], - 'ssh:// url' => ['ssh://git@github.com/drevops/vortex.git', FALSE], - 'git:// url' => ['git://github.com/drevops/vortex.git', FALSE], - 'git@ scp-style url' => ['git@github.com:drevops/vortex', FALSE], - 'local absolute path' => ['/path/to/repo', TRUE], - 'local relative path' => ['./repo', TRUE], - 'file:// url treated as local' => ['file:///path/to/repo', TRUE], - ]; + public static function dataProviderIsLocal(): \Iterator { + yield 'https url' => ['https://github.com/drevops/vortex.git', FALSE]; + yield 'http url' => ['http://github.com/drevops/vortex.git', FALSE]; + yield 'ssh:// url' => ['ssh://git@github.com/drevops/vortex.git', FALSE]; + yield 'git:// url' => ['git://github.com/drevops/vortex.git', FALSE]; + yield 'git@ scp-style url' => ['git@github.com:drevops/vortex', FALSE]; + yield 'local absolute path' => ['/path/to/repo', TRUE]; + yield 'local relative path' => ['./repo', TRUE]; + yield 'file:// url treated as local' => ['file:///path/to/repo', TRUE]; } #[DataProvider('dataProviderIsDefault')] @@ -326,38 +311,36 @@ public function testIsDefault(string $repo, string $ref, bool $expected): void { /** * Data provider for testIsDefault(). */ - public static function dataProviderIsDefault(): array { - return [ - 'default repo with stable ref' => [ - RepositoryDownloader::DEFAULT_REPO, - RepositoryDownloader::REF_STABLE, - TRUE, - ], - 'default repo without .git with stable ref' => [ - 'https://github.com/drevops/vortex', - RepositoryDownloader::REF_STABLE, - TRUE, - ], - 'default repo with HEAD ref' => [ - RepositoryDownloader::DEFAULT_REPO, - RepositoryDownloader::REF_HEAD, - TRUE, - ], - 'default repo with custom ref' => [ - RepositoryDownloader::DEFAULT_REPO, - 'custom-branch', - FALSE, - ], - 'custom repo with stable ref' => [ - 'https://github.com/custom/repo.git', - RepositoryDownloader::REF_STABLE, - FALSE, - ], - 'custom repo with custom ref' => [ - 'https://github.com/custom/repo.git', - 'custom-branch', - FALSE, - ], + public static function dataProviderIsDefault(): \Iterator { + yield 'default repo with stable ref' => [ + RepositoryDownloader::DEFAULT_REPO, + RepositoryDownloader::REF_STABLE, + TRUE, + ]; + yield 'default repo without .git with stable ref' => [ + 'https://github.com/drevops/vortex', + RepositoryDownloader::REF_STABLE, + TRUE, + ]; + yield 'default repo with HEAD ref' => [ + RepositoryDownloader::DEFAULT_REPO, + RepositoryDownloader::REF_HEAD, + TRUE, + ]; + yield 'default repo with custom ref' => [ + RepositoryDownloader::DEFAULT_REPO, + 'custom-branch', + FALSE, + ]; + yield 'custom repo with stable ref' => [ + 'https://github.com/custom/repo.git', + RepositoryDownloader::REF_STABLE, + FALSE, + ]; + yield 'custom repo with custom ref' => [ + 'https://github.com/custom/repo.git', + 'custom-branch', + FALSE, ]; } @@ -370,24 +353,22 @@ public function testGetRepoUrl(string $repo, string $expectedUrl): void { /** * Data provider for testGetRepoUrl(). */ - public static function dataProviderGetRepoUrl(): array { - return [ - 'https url with .git' => [ - 'https://github.com/drevops/vortex.git', - 'https://github.com/drevops/vortex', - ], - 'https url without .git' => [ - 'https://github.com/drevops/vortex', - 'https://github.com/drevops/vortex', - ], - 'ssh url with .git' => [ - 'git@github.com:drevops/vortex.git', - 'git@github.com:drevops/vortex', - ], - 'local path not affected' => [ - '/path/to/repo', - '/path/to/repo', - ], + public static function dataProviderGetRepoUrl(): \Iterator { + yield 'https url with .git' => [ + 'https://github.com/drevops/vortex.git', + 'https://github.com/drevops/vortex', + ]; + yield 'https url without .git' => [ + 'https://github.com/drevops/vortex', + 'https://github.com/drevops/vortex', + ]; + yield 'ssh url with .git' => [ + 'git@github.com:drevops/vortex.git', + 'git@github.com:drevops/vortex', + ]; + yield 'local path not affected' => [ + '/path/to/repo', + '/path/to/repo', ]; } @@ -400,13 +381,11 @@ public function testIsStable(string $repo, string $ref, bool $expected): void { /** * Data provider for testIsStable(). */ - public static function dataProviderIsStable(): array { - return [ - 'stable ref' => ['https://github.com/drevops/vortex.git', 'stable', TRUE], - 'HEAD ref' => ['https://github.com/drevops/vortex.git', 'HEAD', FALSE], - 'custom ref' => ['https://github.com/drevops/vortex.git', '1.0.0', FALSE], - 'branch ref' => ['https://github.com/drevops/vortex.git', 'feature-branch', FALSE], - ]; + public static function dataProviderIsStable(): \Iterator { + yield 'stable ref' => ['https://github.com/drevops/vortex.git', 'stable', TRUE]; + yield 'HEAD ref' => ['https://github.com/drevops/vortex.git', 'HEAD', FALSE]; + yield 'custom ref' => ['https://github.com/drevops/vortex.git', '1.0.0', FALSE]; + yield 'branch ref' => ['https://github.com/drevops/vortex.git', 'feature-branch', FALSE]; } #[DataProvider('dataProviderIsDevelopment')] @@ -418,13 +397,11 @@ public function testIsDevelopment(string $repo, string $ref, bool $expected): vo /** * Data provider for testIsDevelopment(). */ - public static function dataProviderIsDevelopment(): array { - return [ - 'HEAD ref' => ['https://github.com/drevops/vortex.git', 'HEAD', TRUE], - 'stable ref' => ['https://github.com/drevops/vortex.git', 'stable', FALSE], - 'custom ref' => ['https://github.com/drevops/vortex.git', '1.0.0', FALSE], - 'branch ref' => ['https://github.com/drevops/vortex.git', 'feature-branch', FALSE], - ]; + public static function dataProviderIsDevelopment(): \Iterator { + yield 'HEAD ref' => ['https://github.com/drevops/vortex.git', 'HEAD', TRUE]; + yield 'stable ref' => ['https://github.com/drevops/vortex.git', 'stable', FALSE]; + yield 'custom ref' => ['https://github.com/drevops/vortex.git', '1.0.0', FALSE]; + yield 'branch ref' => ['https://github.com/drevops/vortex.git', 'feature-branch', FALSE]; } } diff --git a/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php b/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php index 213eecdc9..170c2a5fd 100644 --- a/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php +++ b/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php @@ -273,162 +273,156 @@ public function testDownloadArchiveWithGithubToken(): void { /** * Data provider for testDiscoverLatestReleaseRemote(). * - * @return array> + * @return \Iterator> * Test data. */ - public static function dataProviderDiscoverLatestReleaseRemote(): array { - return [ - 'valid releases' => [ - 'repo' => 'https://github.com/user/repo', - 'releaseData' => [ + public static function dataProviderDiscoverLatestReleaseRemote(): \Iterator { + yield 'valid releases' => [ + 'repo' => 'https://github.com/user/repo', + 'releaseData' => [ ['tag_name' => 'v2.0.0', 'draft' => FALSE], ['tag_name' => 'v1.0.0', 'draft' => FALSE], - ], - 'throwException' => FALSE, - 'skipMockSetup' => FALSE, - 'expectedVersion' => 'v2.0.0', - 'expectedException' => NULL, - 'expectedMessage' => NULL, ], - 'skips drafts' => [ - 'repo' => 'https://github.com/user/repo', - 'releaseData' => [ + 'throwException' => FALSE, + 'skipMockSetup' => FALSE, + 'expectedVersion' => 'v2.0.0', + 'expectedException' => NULL, + 'expectedMessage' => NULL, + ]; + yield 'skips drafts' => [ + 'repo' => 'https://github.com/user/repo', + 'releaseData' => [ ['tag_name' => 'v3.0.0', 'draft' => TRUE], ['tag_name' => 'v2.0.0', 'draft' => FALSE], - ], - 'throwException' => FALSE, - 'skipMockSetup' => FALSE, - 'expectedVersion' => 'v2.0.0', - 'expectedException' => NULL, - 'expectedMessage' => NULL, - ], - 'no releases' => [ - 'repo' => 'https://github.com/user/repo', - 'releaseData' => [], - 'throwException' => FALSE, - 'skipMockSetup' => FALSE, - 'expectedVersion' => NULL, - 'expectedException' => \RuntimeException::class, - 'expectedMessage' => 'Unable to discover the latest release', - ], - 'request exception' => [ - 'repo' => 'https://github.com/user/repo', - 'releaseData' => NULL, - 'throwException' => TRUE, - 'skipMockSetup' => FALSE, - 'expectedVersion' => NULL, - 'expectedException' => \RuntimeException::class, - 'expectedMessage' => 'Unable to access repository', ], - 'empty response' => [ - 'repo' => 'https://github.com/user/repo', - 'releaseData' => '', - 'throwException' => FALSE, - 'skipMockSetup' => FALSE, - 'expectedVersion' => NULL, - 'expectedException' => \RuntimeException::class, - 'expectedMessage' => 'Unable to download release information from', - ], - 'invalid url' => [ - 'repo' => 'https://', - 'releaseData' => NULL, - 'throwException' => FALSE, - 'skipMockSetup' => TRUE, - 'expectedVersion' => NULL, - 'expectedException' => \RuntimeException::class, - 'expectedMessage' => 'Local repository path does not exist', - ], - 'SemVer+CalVer format - single release' => [ - 'repo' => str_replace('.git', '', RepositoryDownloader::DEFAULT_REPO), - 'releaseData' => [ + 'throwException' => FALSE, + 'skipMockSetup' => FALSE, + 'expectedVersion' => 'v2.0.0', + 'expectedException' => NULL, + 'expectedMessage' => NULL, + ]; + yield 'no releases' => [ + 'repo' => 'https://github.com/user/repo', + 'releaseData' => [], + 'throwException' => FALSE, + 'skipMockSetup' => FALSE, + 'expectedVersion' => NULL, + 'expectedException' => \RuntimeException::class, + 'expectedMessage' => 'Unable to discover the latest release', + ]; + yield 'request exception' => [ + 'repo' => 'https://github.com/user/repo', + 'releaseData' => NULL, + 'throwException' => TRUE, + 'skipMockSetup' => FALSE, + 'expectedVersion' => NULL, + 'expectedException' => \RuntimeException::class, + 'expectedMessage' => 'Unable to access repository', + ]; + yield 'empty response' => [ + 'repo' => 'https://github.com/user/repo', + 'releaseData' => '', + 'throwException' => FALSE, + 'skipMockSetup' => FALSE, + 'expectedVersion' => NULL, + 'expectedException' => \RuntimeException::class, + 'expectedMessage' => 'Unable to download release information from', + ]; + yield 'invalid url' => [ + 'repo' => 'https://', + 'releaseData' => NULL, + 'throwException' => FALSE, + 'skipMockSetup' => TRUE, + 'expectedVersion' => NULL, + 'expectedException' => \RuntimeException::class, + 'expectedMessage' => 'Local repository path does not exist', + ]; + yield 'SemVer+CalVer format - single release' => [ + 'repo' => str_replace('.git', '', RepositoryDownloader::DEFAULT_REPO), + 'releaseData' => [ ['tag_name' => '1.0.0+2025.11.0', 'draft' => FALSE], - ], - 'throwException' => FALSE, - 'skipMockSetup' => FALSE, - 'expectedVersion' => '1.0.0+2025.11.0', - 'expectedException' => NULL, - 'expectedMessage' => NULL, ], - 'SemVer+CalVer format - multiple releases' => [ - 'repo' => str_replace('.git', '', RepositoryDownloader::DEFAULT_REPO), - 'releaseData' => [ + 'throwException' => FALSE, + 'skipMockSetup' => FALSE, + 'expectedVersion' => '1.0.0+2025.11.0', + 'expectedException' => NULL, + 'expectedMessage' => NULL, + ]; + yield 'SemVer+CalVer format - multiple releases' => [ + 'repo' => str_replace('.git', '', RepositoryDownloader::DEFAULT_REPO), + 'releaseData' => [ ['tag_name' => '1.2.0+2025.12.0', 'draft' => FALSE], ['tag_name' => '1.1.0+2025.11.0', 'draft' => FALSE], ['tag_name' => '1.0.0+2025.10.0', 'draft' => FALSE], - ], - 'throwException' => FALSE, - 'skipMockSetup' => FALSE, - 'expectedVersion' => '1.2.0+2025.12.0', - 'expectedException' => NULL, - 'expectedMessage' => NULL, ], - 'SemVer+CalVer format - skip draft' => [ - 'repo' => str_replace('.git', '', RepositoryDownloader::DEFAULT_REPO), - 'releaseData' => [ + 'throwException' => FALSE, + 'skipMockSetup' => FALSE, + 'expectedVersion' => '1.2.0+2025.12.0', + 'expectedException' => NULL, + 'expectedMessage' => NULL, + ]; + yield 'SemVer+CalVer format - skip draft' => [ + 'repo' => str_replace('.git', '', RepositoryDownloader::DEFAULT_REPO), + 'releaseData' => [ ['tag_name' => '2.0.0+2026.01.0', 'draft' => TRUE], ['tag_name' => '1.0.0+2025.11.0', 'draft' => FALSE], - ], - 'throwException' => FALSE, - 'skipMockSetup' => FALSE, - 'expectedVersion' => '1.0.0+2025.11.0', - 'expectedException' => NULL, - 'expectedMessage' => NULL, ], - 'Mixed format - SemVer+CalVer and CalVer' => [ - 'repo' => str_replace('.git', '', RepositoryDownloader::DEFAULT_REPO), - 'releaseData' => [ + 'throwException' => FALSE, + 'skipMockSetup' => FALSE, + 'expectedVersion' => '1.0.0+2025.11.0', + 'expectedException' => NULL, + 'expectedMessage' => NULL, + ]; + yield 'Mixed format - SemVer+CalVer and CalVer' => [ + 'repo' => str_replace('.git', '', RepositoryDownloader::DEFAULT_REPO), + 'releaseData' => [ ['tag_name' => '1.0.0+2025.11.0', 'draft' => FALSE], ['tag_name' => '25.10.0', 'draft' => FALSE], ['tag_name' => '25.9.0', 'draft' => FALSE], - ], - 'throwException' => FALSE, - 'skipMockSetup' => FALSE, - 'expectedVersion' => '1.0.0+2025.11.0', - 'expectedException' => NULL, - 'expectedMessage' => NULL, ], + 'throwException' => FALSE, + 'skipMockSetup' => FALSE, + 'expectedVersion' => '1.0.0+2025.11.0', + 'expectedException' => NULL, + 'expectedMessage' => NULL, ]; } /** * Data provider for testDownloadWithNullDestination(). * - * @return array> + * @return \Iterator> * Test data. */ - public static function dataProviderDownloadWithNullDestination(): array { - return [ - 'remote repository' => [ - 'repo' => 'https://github.com/user/repo', - 'expectedMessage' => 'Destination cannot be null for remote downloads', - ], - 'local repository' => [ - 'repo' => '/path/to/repo', - 'expectedMessage' => 'Destination cannot be null for local downloads', - ], + public static function dataProviderDownloadWithNullDestination(): \Iterator { + yield 'remote repository' => [ + 'repo' => 'https://github.com/user/repo', + 'expectedMessage' => 'Destination cannot be null for remote downloads', + ]; + yield 'local repository' => [ + 'repo' => '/path/to/repo', + 'expectedMessage' => 'Destination cannot be null for local downloads', ]; } /** * Data provider for testDownloadFromLocal(). * - * @return array> + * @return \Iterator> * Test data. */ - public static function dataProviderDownloadFromLocal(): array { - return [ - 'HEAD ref' => [ - 'ref' => 'HEAD', - 'expectedVersion' => 'develop', - ], - 'stable ref' => [ - 'ref' => 'stable', - 'expectedVersion' => 'develop', - ], - 'commit hash' => [ - 'ref' => 'COMMIT_HASH', - 'expectedVersion' => 'COMMIT_HASH', - ], + public static function dataProviderDownloadFromLocal(): \Iterator { + yield 'HEAD ref' => [ + 'ref' => 'HEAD', + 'expectedVersion' => 'develop', + ]; + yield 'stable ref' => [ + 'ref' => 'stable', + 'expectedVersion' => 'develop', + ]; + yield 'commit hash' => [ + 'ref' => 'COMMIT_HASH', + 'expectedVersion' => 'COMMIT_HASH', ]; } diff --git a/.vortex/installer/tests/Unit/EnvTest.php b/.vortex/installer/tests/Unit/EnvTest.php index 0e6a849cf..f333b82fe 100644 --- a/.vortex/installer/tests/Unit/EnvTest.php +++ b/.vortex/installer/tests/Unit/EnvTest.php @@ -54,15 +54,13 @@ public function testGet(string $name, string $value, ?string $default, ?string $ $this->assertSame($expected, Env::get($name, $default)); } - public static function dataProviderGet(): array { - return [ - ['VAR', 'VAL1', 'DEF1', 'VAL1'], - ['VAR', 'VAL1', NULL, 'VAL1'], - ['VAR', 'VAL1', 'VAL2', 'VAL1'], - ['VAR', '', 'DEF1', 'DEF1'], - ['VAR', '', NULL, ''], - ['VAR', '', 'VAL2', 'VAL2'], - ]; + public static function dataProviderGet(): \Iterator { + yield ['VAR', 'VAL1', 'DEF1', 'VAL1']; + yield ['VAR', 'VAL1', NULL, 'VAL1']; + yield ['VAR', 'VAL1', 'VAL2', 'VAL1']; + yield ['VAR', '', 'DEF1', 'DEF1']; + yield ['VAR', '', NULL, '']; + yield ['VAR', '', 'VAL2', 'VAL2']; } #[DataProvider('dataProviderGetFromDotenv')] @@ -85,13 +83,11 @@ public function testGetFromDotenv(string $name, ?string $value, ?string $value_d $this->assertEquals($expected, $actual); } - public static function dataProviderGetFromDotenv(): array { - return [ - ['VAR', 'VAL1', NULL, 'VAL1'], - ['VAR', 'VAL1', 'VALDOTENV1', 'VAL1'], - ['VAR', NULL, 'VALDOTENV1', 'VALDOTENV1'], - ['VAR', NULL, NULL, NULL], - ]; + public static function dataProviderGetFromDotenv(): \Iterator { + yield ['VAR', 'VAL1', NULL, 'VAL1']; + yield ['VAR', 'VAL1', 'VALDOTENV1', 'VAL1']; + yield ['VAR', NULL, 'VALDOTENV1', 'VALDOTENV1']; + yield ['VAR', NULL, NULL, NULL]; } #[DataProvider('dataProviderPutFromDotenv')] @@ -115,18 +111,15 @@ public function testPutFromDotenv(string $name, ?string $value, ?string $value_d $this->assertEquals($GLOBALS['_SERVER'][$name], $expected); } - public static function dataProviderPutFromDotenv(): array { - return [ - ['VAR', 'VAL1', NULL, FALSE, 'VAL1'], - ['VAR', 'VAL1', 'VALDOTENV1', FALSE, 'VAL1'], - ['VAR', NULL, 'VALDOTENV1', FALSE, 'VALDOTENV1'], - ['VAR', NULL, NULL, FALSE, NULL], - - ['VAR', 'VAL1', NULL, TRUE, 'VAL1'], - ['VAR', 'VAL1', 'VALDOTENV1', TRUE, 'VALDOTENV1'], - ['VAR', NULL, 'VALDOTENV1', TRUE, 'VALDOTENV1'], - ['VAR', NULL, NULL, TRUE, NULL], - ]; + public static function dataProviderPutFromDotenv(): \Iterator { + yield ['VAR', 'VAL1', NULL, FALSE, 'VAL1']; + yield ['VAR', 'VAL1', 'VALDOTENV1', FALSE, 'VAL1']; + yield ['VAR', NULL, 'VALDOTENV1', FALSE, 'VALDOTENV1']; + yield ['VAR', NULL, NULL, FALSE, NULL]; + yield ['VAR', 'VAL1', NULL, TRUE, 'VAL1']; + yield ['VAR', 'VAL1', 'VALDOTENV1', TRUE, 'VALDOTENV1']; + yield ['VAR', NULL, 'VALDOTENV1', TRUE, 'VALDOTENV1']; + yield ['VAR', NULL, NULL, TRUE, NULL]; } public function testWriteValueDotenv(): void { @@ -165,61 +158,55 @@ public function testFormatValueForDotenv(string $input, string $expected): void $this->assertEquals($expected, $result); } - public static function dataProviderFormatValueForDotenv(): array { - return [ - // Values without special characters or whitespace - should not be quoted. - ['simple_value', 'simple_value'], - ['123', '123'], - ['true', 'true'], - ['path/to/file', 'path/to/file'], - ['with-dashes', 'with-dashes'], - ['with_underscores', 'with_underscores'], - ['UPPERCASE', 'UPPERCASE'], - ['mixedCase', 'mixedCase'], - ['email@domain.com', 'email@domain.com'], - ['https://example.com', 'https://example.com'], - ['', ''], - - // Values with whitespace - should be quoted. - ['value with spaces', '"value with spaces"'], - [' leading space', '" leading space"'], - ['trailing space ', '"trailing space "'], - [' both spaces ', '" both spaces "'], - ['multiple spaces', '"multiple spaces"'], - ["tab\tcharacter", "\"tab\tcharacter\""], - ["new\nline", "\"new\nline\""], - ['path with spaces/to/file', '"path with spaces/to/file"'], - ['sentence with multiple words', '"sentence with multiple words"'], - - // Values with shell special characters - should be quoted. - ['value#comment', '"value#comment"'], - ['value$variable', '"value$variable"'], - ['value!history', '"value!history"'], - ['command;another', '"command;another"'], - ['background&process', '"background&process"'], - ['pipe|value', '"pipe|value"'], - ['redirect>output', '"redirect>output"'], - ['inputoutput', '"redirect>output"']; + yield ['input 'value1'], NULL], - ["VAR1=value1\nVAR2=value2", ['VAR1' => 'value1', 'VAR2' => 'value2'], NULL], - ['VAR="quoted value"', ['VAR' => 'quoted value'], NULL], - ['VAR=', ['VAR' => ''], NULL], - ['', [], NULL], - - // Valid content with comments. - ["VAR1=value1\n# This is a comment\nVAR2=value2", ['VAR1' => 'value1', 'VAR2' => 'value2'], NULL], - ['VAR="value with # in quotes"', ['VAR' => 'value with # in quotes'], NULL], - - // Invalid .env content that should throw exceptions. - ['VAR[invalid', NULL, 'Unable to parse file'], - ['VAR=value1' . "\n" . 'INVALID[bracket', NULL, 'Unable to parse file'], - ["VAR1=value1\nVAR2[invalid=value2", NULL, 'Unable to parse file'], - ]; + public static function dataProviderParseDotenv(): \Iterator { + // Valid .env content. + yield ['VAR1=value1', ['VAR1' => 'value1'], NULL]; + yield ["VAR1=value1\nVAR2=value2", ['VAR1' => 'value1', 'VAR2' => 'value2'], NULL]; + yield ['VAR="quoted value"', ['VAR' => 'quoted value'], NULL]; + yield ['VAR=', ['VAR' => ''], NULL]; + yield ['', [], NULL]; + // Valid content with comments. + yield ["VAR1=value1\n# This is a comment\nVAR2=value2", ['VAR1' => 'value1', 'VAR2' => 'value2'], NULL]; + yield ['VAR="value with # in quotes"', ['VAR' => 'value with # in quotes'], NULL]; + // Invalid .env content that should throw exceptions. + yield ['VAR[invalid', NULL, 'Unable to parse file']; + yield ['VAR=value1' . "\n" . 'INVALID[bracket', NULL, 'Unable to parse file']; + yield ["VAR1=value1\nVAR2[invalid=value2", NULL, 'Unable to parse file']; } public function testParseDotenvFileNotReadable(): void { @@ -284,26 +267,21 @@ public function testToValue(string $input, mixed $expected): void { $this->assertSame($expected, $result); } - public static function dataProviderToValue(): array { - return [ - // String constants. - ['true', TRUE], - ['false', FALSE], - ['null', NULL], - - // Numeric values. - ['123', 123], - ['0', 0], - ['-456', -456], - - // Regular strings. - ['regular_string', 'regular_string'], - ['non-numeric', 'non-numeric'], - - // List values (contains comma). - ['item1,item2,item3', ['item1', 'item2', 'item3']], - ['single,item', ['single', 'item']], - ]; + public static function dataProviderToValue(): \Iterator { + // String constants. + yield ['true', TRUE]; + yield ['false', FALSE]; + yield ['null', NULL]; + // Numeric values. + yield ['123', 123]; + yield ['0', 0]; + yield ['-456', -456]; + // Regular strings. + yield ['regular_string', 'regular_string']; + yield ['non-numeric', 'non-numeric']; + // List values (contains comma). + yield ['item1,item2,item3', ['item1', 'item2', 'item3']]; + yield ['single,item', ['single', 'item']]; } public function testPut(): void { @@ -431,124 +409,110 @@ public function testWriteValueDotenvWithEnabled(string $initial_content, string File::remove($filename); } - public static function dataProviderWriteValueDotenvWithEnabled(): array { - return [ - // Test commenting out an active variable. - 'disable active variable' => [ - "VAR=active_value\n", - 'VAR', - 'active_value', - FALSE, - "# VAR=active_value\n", - ], - - // Test activating a commented variable. - 'enable commented variable' => [ - "# VAR=commented_value\n", - 'VAR', - 'new_value', - TRUE, - "VAR=new_value\n", - ], - - // Test updating and commenting out an active variable. - 'disable and update active variable' => [ - "VAR=old_value\n", - 'VAR', - 'new_value', - FALSE, - "# VAR=new_value\n", - ], - - // Test updating and activating a commented variable. - 'enable and update commented variable' => [ - "# VAR=old_value\n", - 'VAR', - 'new_value', - TRUE, - "VAR=new_value\n", - ], - - // Test adding new disabled variable. - 'add new disabled variable' => [ - "EXISTING=value\n", - 'NEW_VAR', - 'new_value', - FALSE, - "EXISTING=value\n# NEW_VAR=new_value\n", - ], - - // Test adding new active variable (default behavior). - 'add new active variable' => [ - "EXISTING=value\n", - 'NEW_VAR', - 'new_value', - TRUE, - "EXISTING=value\nNEW_VAR=new_value\n", - ], - - // Test with commented variable with spaces after #. - 'update variable commented with spaces' => [ - "# VAR=old_value\n", - 'VAR', - 'new_value', - TRUE, - "VAR=new_value\n", - ], - - // Test disabled with NULL value (empty). - 'disabled empty variable' => [ - "EXISTING=value\n", - 'NEW_VAR', - NULL, - FALSE, - "EXISTING=value\n# NEW_VAR=\n", - ], - - // Test active with NULL value (empty). - 'active empty variable' => [ - "EXISTING=value\n", - 'NEW_VAR', - NULL, - TRUE, - "EXISTING=value\nNEW_VAR=\n", - ], - - // Test disabling variable with special characters. - 'disable variable with special chars' => [ - "VAR=value\n", - 'VAR', - 'value with spaces', - FALSE, - "# VAR=\"value with spaces\"\n", - ], - - // Test enabling variable with special characters. - 'enable variable with special chars' => [ - "# VAR=old\n", - 'VAR', - 'value with spaces', - TRUE, - "VAR=\"value with spaces\"\n", - ], - - // Test with multiple variables, disable one. - 'disable one among multiple variables' => [ - "VAR1=value1\nVAR2=value2\nVAR3=value3\n", - 'VAR2', - 'new_value2', - FALSE, - "VAR1=value1\n# VAR2=new_value2\nVAR3=value3\n", - ], - - // Test with multiple variables, enable commented one. - 'enable one among multiple variables' => [ - "VAR1=value1\n# VAR2=value2\nVAR3=value3\n", - 'VAR2', - 'new_value2', - TRUE, - "VAR1=value1\nVAR2=new_value2\nVAR3=value3\n", - ], + public static function dataProviderWriteValueDotenvWithEnabled(): \Iterator { + // Test commenting out an active variable. + yield 'disable active variable' => [ + "VAR=active_value\n", + 'VAR', + 'active_value', + FALSE, + "# VAR=active_value\n", + ]; + // Test activating a commented variable. + yield 'enable commented variable' => [ + "# VAR=commented_value\n", + 'VAR', + 'new_value', + TRUE, + "VAR=new_value\n", + ]; + // Test updating and commenting out an active variable. + yield 'disable and update active variable' => [ + "VAR=old_value\n", + 'VAR', + 'new_value', + FALSE, + "# VAR=new_value\n", + ]; + // Test updating and activating a commented variable. + yield 'enable and update commented variable' => [ + "# VAR=old_value\n", + 'VAR', + 'new_value', + TRUE, + "VAR=new_value\n", + ]; + // Test adding new disabled variable. + yield 'add new disabled variable' => [ + "EXISTING=value\n", + 'NEW_VAR', + 'new_value', + FALSE, + "EXISTING=value\n# NEW_VAR=new_value\n", + ]; + // Test adding new active variable (default behavior). + yield 'add new active variable' => [ + "EXISTING=value\n", + 'NEW_VAR', + 'new_value', + TRUE, + "EXISTING=value\nNEW_VAR=new_value\n", + ]; + // Test with commented variable with spaces after #. + yield 'update variable commented with spaces' => [ + "# VAR=old_value\n", + 'VAR', + 'new_value', + TRUE, + "VAR=new_value\n", + ]; + // Test disabled with NULL value (empty). + yield 'disabled empty variable' => [ + "EXISTING=value\n", + 'NEW_VAR', + NULL, + FALSE, + "EXISTING=value\n# NEW_VAR=\n", + ]; + // Test active with NULL value (empty). + yield 'active empty variable' => [ + "EXISTING=value\n", + 'NEW_VAR', + NULL, + TRUE, + "EXISTING=value\nNEW_VAR=\n", + ]; + // Test disabling variable with special characters. + yield 'disable variable with special chars' => [ + "VAR=value\n", + 'VAR', + 'value with spaces', + FALSE, + "# VAR=\"value with spaces\"\n", + ]; + // Test enabling variable with special characters. + yield 'enable variable with special chars' => [ + "# VAR=old\n", + 'VAR', + 'value with spaces', + TRUE, + "VAR=\"value with spaces\"\n", + ]; + // Test with multiple variables, disable one. + yield 'disable one among multiple variables' => [ + "VAR1=value1\nVAR2=value2\nVAR3=value3\n", + 'VAR2', + 'new_value2', + FALSE, + "VAR1=value1\n# VAR2=new_value2\nVAR3=value3\n", + ]; + // Test with multiple variables, enable commented one. + yield 'enable one among multiple variables' => [ + "VAR1=value1\n# VAR2=value2\nVAR3=value3\n", + 'VAR2', + 'new_value2', + TRUE, + "VAR1=value1\nVAR2=new_value2\nVAR3=value3\n", ]; } diff --git a/.vortex/installer/tests/Unit/FileTest.php b/.vortex/installer/tests/Unit/FileTest.php index e4611addf..c02833fae 100644 --- a/.vortex/installer/tests/Unit/FileTest.php +++ b/.vortex/installer/tests/Unit/FileTest.php @@ -17,19 +17,17 @@ public function testIsInternal(string $path, bool $expected): void { $this->assertSame($expected, $result); } - public static function dataProviderIsInternal(): array { - return [ - 'exact match - LICENSE' => ['/LICENSE', TRUE], - 'exact match - CODE_OF_CONDUCT.md' => ['/CODE_OF_CONDUCT.md', TRUE], - 'exact match - CONTRIBUTING.md' => ['/CONTRIBUTING.md', TRUE], - 'exact match - SECURITY.md' => ['/SECURITY.md', TRUE], - 'directory match - docs' => ['/.vortex/docs', TRUE], - 'directory match - tests' => ['/.vortex/tests', TRUE], - 'relative path stripped' => ['./LICENSE', TRUE], - 'relative path in subdir' => ['docs/LICENSE', FALSE], - 'non-internal path' => ['/some/other/path', FALSE], - 'hidden file not matched' => ['/.gitignore', FALSE], - ]; + public static function dataProviderIsInternal(): \Iterator { + yield 'exact match - LICENSE' => ['/LICENSE', TRUE]; + yield 'exact match - CODE_OF_CONDUCT.md' => ['/CODE_OF_CONDUCT.md', TRUE]; + yield 'exact match - CONTRIBUTING.md' => ['/CONTRIBUTING.md', TRUE]; + yield 'exact match - SECURITY.md' => ['/SECURITY.md', TRUE]; + yield 'directory match - docs' => ['/.vortex/docs', TRUE]; + yield 'directory match - tests' => ['/.vortex/tests', TRUE]; + yield 'relative path stripped' => ['./LICENSE', TRUE]; + yield 'relative path in subdir' => ['docs/LICENSE', FALSE]; + yield 'non-internal path' => ['/some/other/path', FALSE]; + yield 'hidden file not matched' => ['/.gitignore', FALSE]; } #[DataProvider('dataProviderToRelative')] @@ -38,111 +36,106 @@ public function testToRelative(string $path, ?string $base, string $expected): v $this->assertSame($expected, $result); } - public static function dataProviderToRelative(): array { + public static function dataProviderToRelative(): \Iterator { // Get the current working directory for test cases. $cwd = getcwd(); - - return [ - // Test cases with explicit base path. - 'absolute path with base' => [ - '/var/www/project/file.txt', - '/var/www', - 'project/file.txt', - ], - 'absolute path same as base' => [ - '/var/www', - '/var/www', - '/var/www', - ], - 'nested absolute path' => [ - '/var/www/project/src/utils/file.php', - '/var/www/project', - 'src/utils/file.php', - ], - 'relative path with base' => [ - 'src/file.php', - '/var/www/project', - 'src/file.php', - ], - 'dot relative path with base' => [ - './src/file.php', - '/var/www/project', - 'src/file.php', - ], - 'parent directory path with base' => [ - '../other/file.php', - '/var/www/project', - '/var/www/other/file.php', - ], - - // Test cases with NULL base (should use current working directory). - 'absolute path with null base' => [ - $cwd . '/test/file.txt', - NULL, - 'test/file.txt', - ], - 'current directory with null base' => [ - $cwd, - NULL, - $cwd, - ], - 'relative path with null base' => [ - 'test/file.txt', - NULL, - 'test/file.txt', - ], - 'dot path with null base' => [ - './test/file.txt', - NULL, - 'test/file.txt', - ], - - // Edge cases. - 'empty path with base - resolves to base' => [ - '', - '/var/www', - '/var/www', - ], - 'root path - no base match' => [ - '/', - '/var', - '/', - ], - 'base is child of path - no match' => [ - '/var/www', - '/var/www/project', - '/var/www', - ], - 'windows-style path on unix' => [ - '/c/Users/project/file.txt', - '/c/Users', - 'project/file.txt', - ], - 'path with special characters' => [ - '/var/www/project with spaces/file-name_test.php', - '/var/www', - 'project with spaces/file-name_test.php', - ], - 'path with dots in filename' => [ - '/var/www/project/.env.local', - '/var/www', - 'project/.env.local', - ], - 'complex nested structure' => [ - '/var/www/html/project/src/Utils/File.php', - '/var/www/html', - 'project/src/Utils/File.php', - ], - 'same directory level' => [ - '/var/www/project1/file.txt', - '/var/www/project2', - '/var/www/project1/file.txt', - ], - 'deep nesting from base' => [ - '/var/www/a/b/c/d/e/file.txt', - '/var/www', - 'a/b/c/d/e/file.txt', - ], + // Test cases with explicit base path. + yield 'absolute path with base' => [ + '/var/www/project/file.txt', + '/var/www', + 'project/file.txt', + ]; + yield 'absolute path same as base' => [ + '/var/www', + '/var/www', + '/var/www', + ]; + yield 'nested absolute path' => [ + '/var/www/project/src/utils/file.php', + '/var/www/project', + 'src/utils/file.php', + ]; + yield 'relative path with base' => [ + 'src/file.php', + '/var/www/project', + 'src/file.php', + ]; + yield 'dot relative path with base' => [ + './src/file.php', + '/var/www/project', + 'src/file.php', + ]; + yield 'parent directory path with base' => [ + '../other/file.php', + '/var/www/project', + '/var/www/other/file.php', + ]; + // Test cases with NULL base (should use current working directory). + yield 'absolute path with null base' => [ + $cwd . '/test/file.txt', + NULL, + 'test/file.txt', + ]; + yield 'current directory with null base' => [ + $cwd, + NULL, + $cwd, + ]; + yield 'relative path with null base' => [ + 'test/file.txt', + NULL, + 'test/file.txt', + ]; + yield 'dot path with null base' => [ + './test/file.txt', + NULL, + 'test/file.txt', + ]; + // Edge cases. + yield 'empty path with base - resolves to base' => [ + '', + '/var/www', + '/var/www', + ]; + yield 'root path - no base match' => [ + '/', + '/var', + '/', + ]; + yield 'base is child of path - no match' => [ + '/var/www', + '/var/www/project', + '/var/www', + ]; + yield 'windows-style path on unix' => [ + '/c/Users/project/file.txt', + '/c/Users', + 'project/file.txt', + ]; + yield 'path with special characters' => [ + '/var/www/project with spaces/file-name_test.php', + '/var/www', + 'project with spaces/file-name_test.php', + ]; + yield 'path with dots in filename' => [ + '/var/www/project/.env.local', + '/var/www', + 'project/.env.local', + ]; + yield 'complex nested structure' => [ + '/var/www/html/project/src/Utils/File.php', + '/var/www/html', + 'project/src/Utils/File.php', + ]; + yield 'same directory level' => [ + '/var/www/project1/file.txt', + '/var/www/project2', + '/var/www/project1/file.txt', + ]; + yield 'deep nesting from base' => [ + '/var/www/a/b/c/d/e/file.txt', + '/var/www', + 'a/b/c/d/e/file.txt', ]; } diff --git a/.vortex/installer/tests/Unit/GitTest.php b/.vortex/installer/tests/Unit/GitTest.php index 40745803e..d35797421 100644 --- a/.vortex/installer/tests/Unit/GitTest.php +++ b/.vortex/installer/tests/Unit/GitTest.php @@ -77,20 +77,18 @@ public function testExtractOwnerRepo(string $uri, ?string $expected): void { $this->assertSame($expected, Git::extractOwnerRepo($uri)); } - public static function dataProviderExtractOwnerRepo(): array { - return [ - ['git@github.com:owner/repo.git', 'owner/repo'], - ['ssh://git@github.com/owner/repo.git', 'owner/repo'], - ['https://github.com/owner/repo.git', 'owner/repo'], - ['git://github.com/owner/repo.git', 'owner/repo'], - ['https://github.com/owner/repo', 'owner/repo'], - ['git@bitbucket.org:myteam/myproject.git', 'myteam/myproject'], - ['ssh://git@gitlab.com/mygroup/myrepo.git', 'mygroup/myrepo'], - ['https://gitlab.com/mygroup/myrepo.git', 'mygroup/myrepo'], - ['file:///local/path/to/repo.git', NULL], - ['/absolute/path/to/repo', NULL], - ['invalid_string', NULL], - ]; + public static function dataProviderExtractOwnerRepo(): \Iterator { + yield ['git@github.com:owner/repo.git', 'owner/repo']; + yield ['ssh://git@github.com/owner/repo.git', 'owner/repo']; + yield ['https://github.com/owner/repo.git', 'owner/repo']; + yield ['git://github.com/owner/repo.git', 'owner/repo']; + yield ['https://github.com/owner/repo', 'owner/repo']; + yield ['git@bitbucket.org:myteam/myproject.git', 'myteam/myproject']; + yield ['ssh://git@gitlab.com/mygroup/myrepo.git', 'mygroup/myrepo']; + yield ['https://gitlab.com/mygroup/myrepo.git', 'mygroup/myrepo']; + yield ['file:///local/path/to/repo.git', NULL]; + yield ['/absolute/path/to/repo', NULL]; + yield ['invalid_string', NULL]; } public function testInit(): void { diff --git a/.vortex/installer/tests/Unit/Handlers/AbstractHandlerDiscoveryTestCase.php b/.vortex/installer/tests/Unit/Handlers/AbstractHandlerDiscoveryTestCase.php index ae222c625..8ffff020e 100644 --- a/.vortex/installer/tests/Unit/Handlers/AbstractHandlerDiscoveryTestCase.php +++ b/.vortex/installer/tests/Unit/Handlers/AbstractHandlerDiscoveryTestCase.php @@ -117,7 +117,7 @@ public function testRunPrompts( /** * Abstract data provider that must be implemented by handler test classes. */ - abstract public static function dataProviderRunPrompts(): array; + abstract public static function dataProviderRunPrompts(): \Iterator; /** * Get expected defaults for a new project. diff --git a/.vortex/installer/tests/Unit/Handlers/AbstractHandlerTypeTest.php b/.vortex/installer/tests/Unit/Handlers/AbstractHandlerTypeTest.php index a162cefd5..143bcb242 100644 --- a/.vortex/installer/tests/Unit/Handlers/AbstractHandlerTypeTest.php +++ b/.vortex/installer/tests/Unit/Handlers/AbstractHandlerTypeTest.php @@ -66,51 +66,45 @@ public function testTypeInference(string $handler_id, PromptType $expected_type) /** * Data provider for testTypeInference. */ - public static function dataProviderTypeInference(): array { - return [ - // Text handlers. - 'name' => [Name::id(), PromptType::Text], - 'machine_name' => [MachineName::id(), PromptType::Text], - 'org' => [Org::id(), PromptType::Text], - 'org_machine_name' => [OrgMachineName::id(), PromptType::Text], - 'domain' => [Domain::id(), PromptType::Text], - 'profile_custom' => [ProfileCustom::id(), PromptType::Text], - 'module_prefix' => [ModulePrefix::id(), PromptType::Text], - 'theme_custom' => [ThemeCustom::id(), PromptType::Text], - 'hosting_project_name' => [HostingProjectName::id(), PromptType::Text], - 'webroot' => [Webroot::id(), PromptType::Text], - 'database_image' => [DatabaseImage::id(), PromptType::Text], - - // Select handlers. - 'starter' => [Starter::id(), PromptType::Select], - 'profile' => [Profile::id(), PromptType::Select], - 'theme' => [Theme::id(), PromptType::Select], - 'code_provider' => [CodeProvider::id(), PromptType::Select], - 'version_scheme' => [VersionScheme::id(), PromptType::Select], - 'hosting_provider' => [HostingProvider::id(), PromptType::Select], - 'provision_type' => [ProvisionType::id(), PromptType::Select], - 'database_download_source' => [DatabaseDownloadSource::id(), PromptType::Select], - 'migration_download_source' => [MigrationDownloadSource::id(), PromptType::Select], - 'ci_provider' => [CiProvider::id(), PromptType::Select], - 'dependency_updates_provider' => [DependencyUpdatesProvider::id(), PromptType::Select], - - // MultiSelect handlers. - 'modules' => [Modules::id(), PromptType::MultiSelect], - 'services' => [Services::id(), PromptType::MultiSelect], - 'tools' => [Tools::id(), PromptType::MultiSelect], - 'deploy_types' => [DeployTypes::id(), PromptType::MultiSelect], - 'notification_channels' => [NotificationChannels::id(), PromptType::MultiSelect], - - // Confirm handlers. - 'migration' => [Migration::id(), PromptType::Confirm], - 'assign_author_pr' => [AssignAuthorPr::id(), PromptType::Confirm], - 'label_merge_conflicts_pr' => [LabelMergeConflictsPr::id(), PromptType::Confirm], - 'preserve_docs_project' => [PreserveDocsProject::id(), PromptType::Confirm], - 'ai_code_instructions' => [AiCodeInstructions::id(), PromptType::Confirm], - - // Suggest handlers. - 'timezone' => [Timezone::id(), PromptType::Suggest], - ]; + public static function dataProviderTypeInference(): \Iterator { + // Text handlers. + yield 'name' => [Name::id(), PromptType::Text]; + yield 'machine_name' => [MachineName::id(), PromptType::Text]; + yield 'org' => [Org::id(), PromptType::Text]; + yield 'org_machine_name' => [OrgMachineName::id(), PromptType::Text]; + yield 'domain' => [Domain::id(), PromptType::Text]; + yield 'profile_custom' => [ProfileCustom::id(), PromptType::Text]; + yield 'module_prefix' => [ModulePrefix::id(), PromptType::Text]; + yield 'theme_custom' => [ThemeCustom::id(), PromptType::Text]; + yield 'hosting_project_name' => [HostingProjectName::id(), PromptType::Text]; + yield 'webroot' => [Webroot::id(), PromptType::Text]; + yield 'database_image' => [DatabaseImage::id(), PromptType::Text]; + // Select handlers. + yield 'starter' => [Starter::id(), PromptType::Select]; + yield 'profile' => [Profile::id(), PromptType::Select]; + yield 'theme' => [Theme::id(), PromptType::Select]; + yield 'code_provider' => [CodeProvider::id(), PromptType::Select]; + yield 'version_scheme' => [VersionScheme::id(), PromptType::Select]; + yield 'hosting_provider' => [HostingProvider::id(), PromptType::Select]; + yield 'provision_type' => [ProvisionType::id(), PromptType::Select]; + yield 'database_download_source' => [DatabaseDownloadSource::id(), PromptType::Select]; + yield 'migration_download_source' => [MigrationDownloadSource::id(), PromptType::Select]; + yield 'ci_provider' => [CiProvider::id(), PromptType::Select]; + yield 'dependency_updates_provider' => [DependencyUpdatesProvider::id(), PromptType::Select]; + // MultiSelect handlers. + yield 'modules' => [Modules::id(), PromptType::MultiSelect]; + yield 'services' => [Services::id(), PromptType::MultiSelect]; + yield 'tools' => [Tools::id(), PromptType::MultiSelect]; + yield 'deploy_types' => [DeployTypes::id(), PromptType::MultiSelect]; + yield 'notification_channels' => [NotificationChannels::id(), PromptType::MultiSelect]; + // Confirm handlers. + yield 'migration' => [Migration::id(), PromptType::Confirm]; + yield 'assign_author_pr' => [AssignAuthorPr::id(), PromptType::Confirm]; + yield 'label_merge_conflicts_pr' => [LabelMergeConflictsPr::id(), PromptType::Confirm]; + yield 'preserve_docs_project' => [PreserveDocsProject::id(), PromptType::Confirm]; + yield 'ai_code_instructions' => [AiCodeInstructions::id(), PromptType::Confirm]; + // Suggest handlers. + yield 'timezone' => [Timezone::id(), PromptType::Suggest]; } } diff --git a/.vortex/installer/tests/Unit/Handlers/AiCodeInstructionsHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/AiCodeInstructionsHandlerDiscoveryTest.php index 1386fa95f..a7863787d 100644 --- a/.vortex/installer/tests/Unit/Handlers/AiCodeInstructionsHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/AiCodeInstructionsHandlerDiscoveryTest.php @@ -13,57 +13,49 @@ #[CoversClass(AiCodeInstructions::class)] class AiCodeInstructionsHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'ai instructions - prompt' => [ - [AiCodeInstructions::id() => Key::ENTER], - [AiCodeInstructions::id() => TRUE] + $expected_defaults, - ], - - 'ai instructions - discovery' => [ - [], - [AiCodeInstructions::id() => TRUE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/AGENTS.md'); - }, - ], - - 'ai instructions - discovery - claude only' => [ - [], - [AiCodeInstructions::id() => TRUE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/CLAUDE.md'); - }, - ], - - 'ai instructions - discovery - removed' => [ - [], - [AiCodeInstructions::id() => FALSE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - }, - ], - - 'ai instructions - discovery - non-Vortex' => [ - [], - [AiCodeInstructions::id() => TRUE] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/AGENTS.md'); - }, - ], - - 'ai instructions - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No AGENTS.md and not installed - should fall back to default. - }, - ], + yield 'ai instructions - prompt' => [ + [AiCodeInstructions::id() => Key::ENTER], + [AiCodeInstructions::id() => TRUE] + $expected_defaults, + ]; + yield 'ai instructions - discovery' => [ + [], + [AiCodeInstructions::id() => TRUE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/AGENTS.md'); + }, + ]; + yield 'ai instructions - discovery - claude only' => [ + [], + [AiCodeInstructions::id() => TRUE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/CLAUDE.md'); + }, + ]; + yield 'ai instructions - discovery - removed' => [ + [], + [AiCodeInstructions::id() => FALSE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + }, + ]; + yield 'ai instructions - discovery - non-Vortex' => [ + [], + [AiCodeInstructions::id() => TRUE] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/AGENTS.md'); + }, + ]; + yield 'ai instructions - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No AGENTS.md and not installed - should fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/BaselineHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/BaselineHandlerDiscoveryTest.php index 0a93fab6b..7023933d7 100644 --- a/.vortex/installer/tests/Unit/Handlers/BaselineHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/BaselineHandlerDiscoveryTest.php @@ -25,34 +25,29 @@ #[CoversClass(Tui::class)] class BaselineHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'defaults' => [ - [], - $expected_defaults, - ], - - 'installed project' => [ - [], - $expected_installed, - function (BaselineHandlerDiscoveryTest $test, Config $config): void { - $test->stubComposerJsonValue('type', 'drupal-project'); - $test->stubComposerJsonValue('name', 'myproject_org/myproject'); - $test->stubVortexProject($config); - }, - ], - - 'installed project - minimal' => [ - [], - $expected_installed, - function (BaselineHandlerDiscoveryTest $test, Config $config): void { - $test->stubComposerJsonValue('name', 'myproject_org/myproject'); - $test->stubVortexProject($config); - }, - ], + yield 'defaults' => [ + [], + $expected_defaults, + ]; + yield 'installed project' => [ + [], + $expected_installed, + function (BaselineHandlerDiscoveryTest $test, Config $config): void { + $test->stubComposerJsonValue('type', 'drupal-project'); + $test->stubComposerJsonValue('name', 'myproject_org/myproject'); + $test->stubVortexProject($config); + }, + ]; + yield 'installed project - minimal' => [ + [], + $expected_installed, + function (BaselineHandlerDiscoveryTest $test, Config $config): void { + $test->stubComposerJsonValue('name', 'myproject_org/myproject'); + $test->stubVortexProject($config); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/CiProviderHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/CiProviderHandlerDiscoveryTest.php index 93dc176b4..6295ee67c 100644 --- a/.vortex/installer/tests/Unit/Handlers/CiProviderHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/CiProviderHandlerDiscoveryTest.php @@ -13,49 +13,42 @@ #[CoversClass(CiProvider::class)] class CiProviderHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'ci provider - prompt' => [ - [CiProvider::id() => Key::ENTER], - [CiProvider::id() => CiProvider::GITHUB_ACTIONS] + $expected_defaults, - ], - - 'ci provider - discovery - gha' => [ - [], - [CiProvider::id() => CiProvider::GITHUB_ACTIONS] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/.github/workflows/build-test-deploy.yml'); - }, - ], - - 'ci provider - discovery - circleci' => [ - [], - [CiProvider::id() => CiProvider::CIRCLECI] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/.circleci/config.yml'); - }, - ], - - 'ci provider - discovery - none' => [ - [], - [CiProvider::id() => CiProvider::NONE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - }, - ], - - 'ci provider - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No CI files and not installed - should fall back to default. - }, - ], + yield 'ci provider - prompt' => [ + [CiProvider::id() => Key::ENTER], + [CiProvider::id() => CiProvider::GITHUB_ACTIONS] + $expected_defaults, + ]; + yield 'ci provider - discovery - gha' => [ + [], + [CiProvider::id() => CiProvider::GITHUB_ACTIONS] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/.github/workflows/build-test-deploy.yml'); + }, + ]; + yield 'ci provider - discovery - circleci' => [ + [], + [CiProvider::id() => CiProvider::CIRCLECI] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/.circleci/config.yml'); + }, + ]; + yield 'ci provider - discovery - none' => [ + [], + [CiProvider::id() => CiProvider::NONE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + }, + ]; + yield 'ci provider - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No CI files and not installed - should fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/CodeProviderHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/CodeProviderHandlerDiscoveryTest.php index 59becd06a..94f1cea98 100644 --- a/.vortex/installer/tests/Unit/Handlers/CodeProviderHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/CodeProviderHandlerDiscoveryTest.php @@ -15,49 +15,41 @@ #[CoversClass(CodeProvider::class)] class CodeProviderHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'code repo - prompt' => [ - [CodeProvider::id() => Key::ENTER], - [CodeProvider::id() => CodeProvider::GITHUB] + $expected_defaults, - ], - - 'code repo - prompt - other' => [ - [CodeProvider::id() => Key::DOWN . Key::ENTER], - [ - CodeProvider::id() => CodeProvider::OTHER, - CiProvider::id() => CiProvider::CIRCLECI, - ] + $expected_defaults, - ], - - 'code repo - discovery' => [ - [], - [CodeProvider::id() => CodeProvider::GITHUB] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - File::dump(static::$sut . '/.github/workflows/ci.yml'); - }, - ], - - 'code repo - discovery - other' => [ - [], - [CodeProvider::id() => CodeProvider::OTHER] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - Git::init(static::$sut); - }, - ], - - 'code repo - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No .github directory and no .git directory - fall back to default. - }, - ], - + yield 'code repo - prompt' => [ + [CodeProvider::id() => Key::ENTER], + [CodeProvider::id() => CodeProvider::GITHUB] + $expected_defaults, + ]; + yield 'code repo - prompt - other' => [ + [CodeProvider::id() => Key::DOWN . Key::ENTER], + [ + CodeProvider::id() => CodeProvider::OTHER, + CiProvider::id() => CiProvider::CIRCLECI, + ] + $expected_defaults, + ]; + yield 'code repo - discovery' => [ + [], + [CodeProvider::id() => CodeProvider::GITHUB] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + File::dump(static::$sut . '/.github/workflows/ci.yml'); + }, + ]; + yield 'code repo - discovery - other' => [ + [], + [CodeProvider::id() => CodeProvider::OTHER] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + Git::init(static::$sut); + }, + ]; + yield 'code repo - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No .github directory and no .git directory - fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/CustomModulesHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/CustomModulesHandlerDiscoveryTest.php index 58760dcf3..179206d60 100644 --- a/.vortex/installer/tests/Unit/Handlers/CustomModulesHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/CustomModulesHandlerDiscoveryTest.php @@ -13,75 +13,66 @@ #[CoversClass(CustomModules::class)] class CustomModulesHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'custom_modules - prompt' => [ - [CustomModules::id() => Key::ENTER], - [CustomModules::id() => [CustomModules::BASE, CustomModules::SEARCH, CustomModules::DEMO]] + $expected_defaults, - ], - - 'custom_modules - discovery - all' => [ - [], - [CustomModules::id() => [CustomModules::BASE, CustomModules::DEMO, CustomModules::SEARCH]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::mkdir(static::$sut . '/web/modules/custom/mypr_base'); - File::mkdir(static::$sut . '/web/modules/custom/mypr_demo'); - File::mkdir(static::$sut . '/web/modules/custom/mypr_search'); - }, - ], - - 'custom_modules - discovery - base only' => [ - [], - [CustomModules::id() => [CustomModules::BASE]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::mkdir(static::$sut . '/web/modules/custom/mypr_base'); - }, - ], - - 'custom_modules - discovery - base and demo' => [ - [], - [CustomModules::id() => [CustomModules::BASE, CustomModules::DEMO]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::mkdir(static::$sut . '/web/modules/custom/mypr_base'); - File::mkdir(static::$sut . '/web/modules/custom/mypr_demo'); - }, - ], - - 'custom_modules - discovery - base and search' => [ - [], - [CustomModules::id() => [CustomModules::BASE, CustomModules::SEARCH]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::mkdir(static::$sut . '/web/modules/custom/mypr_base'); - File::mkdir(static::$sut . '/web/modules/custom/mypr_search'); - }, - ], - - 'custom_modules - discovery - no prefix found' => [ - [], - [CustomModules::id() => [CustomModules::BASE, CustomModules::SEARCH, CustomModules::DEMO]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - // No *_base or *_core directory exists, so prefix cannot be - // discovered and discover() returns NULL, falling back to defaults. - }, - ], - - 'custom_modules - discovery - non-Vortex project' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - // Not a Vortex project - discovery should not run, defaults apply. - File::mkdir(static::$sut . '/web/modules/custom/mypr_base'); - File::mkdir(static::$sut . '/web/modules/custom/mypr_demo'); - }, - ], + yield 'custom_modules - prompt' => [ + [CustomModules::id() => Key::ENTER], + [CustomModules::id() => [CustomModules::BASE, CustomModules::SEARCH, CustomModules::DEMO]] + $expected_defaults, + ]; + yield 'custom_modules - discovery - all' => [ + [], + [CustomModules::id() => [CustomModules::BASE, CustomModules::DEMO, CustomModules::SEARCH]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::mkdir(static::$sut . '/web/modules/custom/mypr_base'); + File::mkdir(static::$sut . '/web/modules/custom/mypr_demo'); + File::mkdir(static::$sut . '/web/modules/custom/mypr_search'); + }, + ]; + yield 'custom_modules - discovery - base only' => [ + [], + [CustomModules::id() => [CustomModules::BASE]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::mkdir(static::$sut . '/web/modules/custom/mypr_base'); + }, + ]; + yield 'custom_modules - discovery - base and demo' => [ + [], + [CustomModules::id() => [CustomModules::BASE, CustomModules::DEMO]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::mkdir(static::$sut . '/web/modules/custom/mypr_base'); + File::mkdir(static::$sut . '/web/modules/custom/mypr_demo'); + }, + ]; + yield 'custom_modules - discovery - base and search' => [ + [], + [CustomModules::id() => [CustomModules::BASE, CustomModules::SEARCH]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::mkdir(static::$sut . '/web/modules/custom/mypr_base'); + File::mkdir(static::$sut . '/web/modules/custom/mypr_search'); + }, + ]; + yield 'custom_modules - discovery - no prefix found' => [ + [], + [CustomModules::id() => [CustomModules::BASE, CustomModules::SEARCH, CustomModules::DEMO]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + // No *_base or *_core directory exists, so prefix cannot be + // discovered and discover() returns NULL, falling back to defaults. + }, + ]; + yield 'custom_modules - discovery - non-Vortex project' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + // Not a Vortex project - discovery should not run, defaults apply. + File::mkdir(static::$sut . '/web/modules/custom/mypr_base'); + File::mkdir(static::$sut . '/web/modules/custom/mypr_demo'); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/DatabaseDownloadSourceHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/DatabaseDownloadSourceHandlerDiscoveryTest.php index 2363c6b2c..fccdb920c 100644 --- a/.vortex/installer/tests/Unit/Handlers/DatabaseDownloadSourceHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/DatabaseDownloadSourceHandlerDiscoveryTest.php @@ -11,39 +11,32 @@ #[CoversClass(DatabaseDownloadSource::class)] class DatabaseDownloadSourceHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); - - return [ - 'database download source - prompt' => [ - [DatabaseDownloadSource::id() => Key::ENTER], - [DatabaseDownloadSource::id() => DatabaseDownloadSource::URL] + $expected_defaults, - ], - - 'database download source - discovery' => [ - [], - [DatabaseDownloadSource::id() => DatabaseDownloadSource::FTP] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubDotenvValue('VORTEX_DOWNLOAD_DB_SOURCE', DatabaseDownloadSource::FTP); - }, - ], - - 'database download source - discovery - s3' => [ - [], - [DatabaseDownloadSource::id() => DatabaseDownloadSource::S3] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubDotenvValue('VORTEX_DOWNLOAD_DB_SOURCE', DatabaseDownloadSource::S3); - }, - ], - - 'database download source - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubDotenvValue('VORTEX_DOWNLOAD_DB_SOURCE', 'invalid_source'); - }, - ], - + yield 'database download source - prompt' => [ + [DatabaseDownloadSource::id() => Key::ENTER], + [DatabaseDownloadSource::id() => DatabaseDownloadSource::URL] + $expected_defaults, + ]; + yield 'database download source - discovery' => [ + [], + [DatabaseDownloadSource::id() => DatabaseDownloadSource::FTP] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubDotenvValue('VORTEX_DOWNLOAD_DB_SOURCE', DatabaseDownloadSource::FTP); + }, + ]; + yield 'database download source - discovery - s3' => [ + [], + [DatabaseDownloadSource::id() => DatabaseDownloadSource::S3] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubDotenvValue('VORTEX_DOWNLOAD_DB_SOURCE', DatabaseDownloadSource::S3); + }, + ]; + yield 'database download source - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubDotenvValue('VORTEX_DOWNLOAD_DB_SOURCE', 'invalid_source'); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/DatabaseImageHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/DatabaseImageHandlerDiscoveryTest.php index e0ee67e38..d161787c5 100644 --- a/.vortex/installer/tests/Unit/Handlers/DatabaseImageHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/DatabaseImageHandlerDiscoveryTest.php @@ -13,46 +13,40 @@ #[CoversClass(DatabaseImage::class)] class DatabaseImageHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); - - return [ - 'database image - prompt' => [ - [ - DatabaseDownloadSource::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, - DatabaseImage::id() => 'myregistry/myimage:mytag', - ], - [DatabaseDownloadSource::id() => DatabaseDownloadSource::CONTAINER_REGISTRY, DatabaseImage::id() => 'myregistry/myimage:mytag'] + $expected_defaults, + yield 'database image - prompt' => [ + [ + DatabaseDownloadSource::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, + DatabaseImage::id() => 'myregistry/myimage:mytag', ], - - 'database image - invalid' => [ - [ - DatabaseDownloadSource::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, - DatabaseImage::id() => 'myregistry:myimage:mytag', - ], - 'Please enter a valid container image name with an optional tag.', + [DatabaseDownloadSource::id() => DatabaseDownloadSource::CONTAINER_REGISTRY, DatabaseImage::id() => 'myregistry/myimage:mytag'] + $expected_defaults, + ]; + yield 'database image - invalid' => [ + [ + DatabaseDownloadSource::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, + DatabaseImage::id() => 'myregistry:myimage:mytag', ], - - 'database image - invalid - capitalization' => [ - [ - DatabaseDownloadSource::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, - DatabaseImage::id() => 'MyRegistry/MyImage:mytag', - ], - 'Please enter a valid container image name with an optional tag.', + 'Please enter a valid container image name with an optional tag.', + ]; + yield 'database image - invalid - capitalization' => [ + [ + DatabaseDownloadSource::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, + DatabaseImage::id() => 'MyRegistry/MyImage:mytag', ], - - 'database image - discovery' => [ - [ - DatabaseDownloadSource::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, - ], - [ - DatabaseDownloadSource::id() => DatabaseDownloadSource::CONTAINER_REGISTRY, - DatabaseImage::id() => 'discovered_owner/discovered_image:tag', - ] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubDotenvValue('VORTEX_DB_IMAGE', 'discovered_owner/discovered_image:tag'); - }, + 'Please enter a valid container image name with an optional tag.', + ]; + yield 'database image - discovery' => [ + [ + DatabaseDownloadSource::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, ], + [ + DatabaseDownloadSource::id() => DatabaseDownloadSource::CONTAINER_REGISTRY, + DatabaseImage::id() => 'discovered_owner/discovered_image:tag', + ] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubDotenvValue('VORTEX_DB_IMAGE', 'discovered_owner/discovered_image:tag'); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/DependencyUpdatesProviderHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/DependencyUpdatesProviderHandlerDiscoveryTest.php index a5bae6392..1e50e4d8e 100644 --- a/.vortex/installer/tests/Unit/Handlers/DependencyUpdatesProviderHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/DependencyUpdatesProviderHandlerDiscoveryTest.php @@ -14,63 +14,55 @@ #[CoversClass(DependencyUpdatesProvider::class)] class DependencyUpdatesProviderHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'dependency updates provider - prompt' => [ - [DependencyUpdatesProvider::id() => Key::ENTER], - [DependencyUpdatesProvider::id() => DependencyUpdatesProvider::RENOVATEBOT_APP] + $expected_defaults, - ], - - 'dependency updates provider - discovery - renovate self-hosted - gha' => [ - [], - [DependencyUpdatesProvider::id() => DependencyUpdatesProvider::RENOVATEBOT_CI] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/renovate.json'); - File::dump(static::$sut . '/.github/workflows/update-dependencies.yml'); - }, - ], - - 'dependency updates provider - discovery - renovate self-hosted - circleci' => [ - [], - [ - CiProvider::id() => CiProvider::CIRCLECI, - DependencyUpdatesProvider::id() => DependencyUpdatesProvider::RENOVATEBOT_CI, - ] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/renovate.json'); - File::dump(static::$sut . '/.circleci/config.yml', 'update-dependencies'); - }, - ], - - 'dependency updates provider - discovery - renovate app' => [ - [], - [DependencyUpdatesProvider::id() => DependencyUpdatesProvider::RENOVATEBOT_APP] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/renovate.json'); - }, - ], - - 'dependency updates provider - discovery - none' => [ - [], - [DependencyUpdatesProvider::id() => DependencyUpdatesProvider::NONE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - }, - ], - - 'dependency updates provider - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No renovate.json and not installed - should fall back to default. - }, - ], + yield 'dependency updates provider - prompt' => [ + [DependencyUpdatesProvider::id() => Key::ENTER], + [DependencyUpdatesProvider::id() => DependencyUpdatesProvider::RENOVATEBOT_APP] + $expected_defaults, + ]; + yield 'dependency updates provider - discovery - renovate self-hosted - gha' => [ + [], + [DependencyUpdatesProvider::id() => DependencyUpdatesProvider::RENOVATEBOT_CI] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/renovate.json'); + File::dump(static::$sut . '/.github/workflows/update-dependencies.yml'); + }, + ]; + yield 'dependency updates provider - discovery - renovate self-hosted - circleci' => [ + [], + [ + CiProvider::id() => CiProvider::CIRCLECI, + DependencyUpdatesProvider::id() => DependencyUpdatesProvider::RENOVATEBOT_CI, + ] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/renovate.json'); + File::dump(static::$sut . '/.circleci/config.yml', 'update-dependencies'); + }, + ]; + yield 'dependency updates provider - discovery - renovate app' => [ + [], + [DependencyUpdatesProvider::id() => DependencyUpdatesProvider::RENOVATEBOT_APP] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/renovate.json'); + }, + ]; + yield 'dependency updates provider - discovery - none' => [ + [], + [DependencyUpdatesProvider::id() => DependencyUpdatesProvider::NONE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + }, + ]; + yield 'dependency updates provider - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No renovate.json and not installed - should fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/DeployTypesHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/DeployTypesHandlerDiscoveryTest.php index f667cb9d3..4a99272bb 100644 --- a/.vortex/installer/tests/Unit/Handlers/DeployTypesHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/DeployTypesHandlerDiscoveryTest.php @@ -13,38 +13,32 @@ #[CoversClass(DeployTypes::class)] class DeployTypesHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); - - return [ - 'deploy types - prompt' => [ - [DeployTypes::id() => Key::ENTER], - [DeployTypes::id() => [DeployTypes::WEBHOOK]] + $expected_defaults, - ], - - 'deploy types - discovery' => [ - [], - [DeployTypes::id() => [DeployTypes::ARTIFACT, DeployTypes::WEBHOOK]] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubDotenvValue('VORTEX_DEPLOY_TYPES', Converter::toList([DeployTypes::ARTIFACT, DeployTypes::WEBHOOK])); - }, - ], - - 'deploy types - discovery - order' => [ - [], - [DeployTypes::id() => [DeployTypes::ARTIFACT, DeployTypes::WEBHOOK]] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubDotenvValue('VORTEX_DEPLOY_TYPES', Converter::toList([DeployTypes::WEBHOOK, DeployTypes::ARTIFACT])); - }, - ], - - 'deploy types - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No VORTEX_DEPLOY_TYPES in .env - should fall back to default. - }, - ], + yield 'deploy types - prompt' => [ + [DeployTypes::id() => Key::ENTER], + [DeployTypes::id() => [DeployTypes::WEBHOOK]] + $expected_defaults, + ]; + yield 'deploy types - discovery' => [ + [], + [DeployTypes::id() => [DeployTypes::ARTIFACT, DeployTypes::WEBHOOK]] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubDotenvValue('VORTEX_DEPLOY_TYPES', Converter::toList([DeployTypes::ARTIFACT, DeployTypes::WEBHOOK])); + }, + ]; + yield 'deploy types - discovery - order' => [ + [], + [DeployTypes::id() => [DeployTypes::ARTIFACT, DeployTypes::WEBHOOK]] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubDotenvValue('VORTEX_DEPLOY_TYPES', Converter::toList([DeployTypes::WEBHOOK, DeployTypes::ARTIFACT])); + }, + ]; + yield 'deploy types - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No VORTEX_DEPLOY_TYPES in .env - should fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/DocsHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/DocsHandlerDiscoveryTest.php index 31b13636e..5ca75b4c8 100644 --- a/.vortex/installer/tests/Unit/Handlers/DocsHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/DocsHandlerDiscoveryTest.php @@ -13,49 +13,41 @@ #[CoversClass(PreserveDocsProject::class)] class DocsHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'preserve project documentation - prompt' => [ - [PreserveDocsProject::id() => Key::ENTER], - [PreserveDocsProject::id() => TRUE] + $expected_defaults, - ], - - 'preserve project documentation - discovery' => [ - [], - [PreserveDocsProject::id() => TRUE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/docs/README.md'); - }, - ], - - 'preserve project documentation - discovery - removed' => [ - [], - [PreserveDocsProject::id() => FALSE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - }, - ], - - 'preserve project documentation - discovery - non-Vortex' => [ - [], - [PreserveDocsProject::id() => TRUE] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/docs/README.md'); - }, - ], - - 'preserve project documentation - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No docs/README.md and not installed - should fall back to default. - }, - ], - + yield 'preserve project documentation - prompt' => [ + [PreserveDocsProject::id() => Key::ENTER], + [PreserveDocsProject::id() => TRUE] + $expected_defaults, + ]; + yield 'preserve project documentation - discovery' => [ + [], + [PreserveDocsProject::id() => TRUE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/docs/README.md'); + }, + ]; + yield 'preserve project documentation - discovery - removed' => [ + [], + [PreserveDocsProject::id() => FALSE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + }, + ]; + yield 'preserve project documentation - discovery - non-Vortex' => [ + [], + [PreserveDocsProject::id() => TRUE] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/docs/README.md'); + }, + ]; + yield 'preserve project documentation - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No docs/README.md and not installed - should fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/DomainHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/DomainHandlerDiscoveryTest.php index 0b7a9fe0e..36ce0579b 100644 --- a/.vortex/installer/tests/Unit/Handlers/DomainHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/DomainHandlerDiscoveryTest.php @@ -10,63 +10,52 @@ #[CoversClass(Domain::class)] class DomainHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); - - return [ - 'domain - prompt' => [ - [Domain::id() => 'myproject.com'], - [Domain::id() => 'myproject.com'] + $expected_defaults, - ], - - 'domain - prompt - www prefix' => [ - [Domain::id() => 'www.myproject.com'], - [Domain::id() => 'myproject.com'] + $expected_defaults, - ], - - 'domain - prompt - secure protocol' => [ - [Domain::id() => 'https://www.myproject.com'], - [Domain::id() => 'myproject.com'] + $expected_defaults, - ], - - 'domain - prompt - unsecure protocol' => [ - [Domain::id() => 'http://www.myproject.com'], - [Domain::id() => 'myproject.com'] + $expected_defaults, - ], - - 'domain - invalid - missing TLD' => [ - [Domain::id() => 'myproject'], - 'Please enter a valid domain name.', - ], - - 'domain - invalid - incorrect protocol' => [ - [Domain::id() => 'htt://myproject.com'], - 'Please enter a valid domain name.', - ], - - 'domain - discovery' => [ - [], - [Domain::id() => 'discovered-project-dotenv.com'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubDotenvValue('DRUPAL_STAGE_FILE_PROXY_ORIGIN', 'https://discovered-project-dotenv.com'); - }, - ], - - 'domain - discovery - www' => [ - [], - [Domain::id() => 'discovered-project-dotenv.com'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubDotenvValue('DRUPAL_STAGE_FILE_PROXY_ORIGIN', 'https://www.discovered-project-dotenv.com'); - }, - ], - - 'domain - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubDotenvValue('DRUPAL_STAGE_FILE_PROXY_ORIGIN', ''); - }, - ], + yield 'domain - prompt' => [ + [Domain::id() => 'myproject.com'], + [Domain::id() => 'myproject.com'] + $expected_defaults, + ]; + yield 'domain - prompt - www prefix' => [ + [Domain::id() => 'www.myproject.com'], + [Domain::id() => 'myproject.com'] + $expected_defaults, + ]; + yield 'domain - prompt - secure protocol' => [ + [Domain::id() => 'https://www.myproject.com'], + [Domain::id() => 'myproject.com'] + $expected_defaults, + ]; + yield 'domain - prompt - unsecure protocol' => [ + [Domain::id() => 'http://www.myproject.com'], + [Domain::id() => 'myproject.com'] + $expected_defaults, + ]; + yield 'domain - invalid - missing TLD' => [ + [Domain::id() => 'myproject'], + 'Please enter a valid domain name.', + ]; + yield 'domain - invalid - incorrect protocol' => [ + [Domain::id() => 'htt://myproject.com'], + 'Please enter a valid domain name.', + ]; + yield 'domain - discovery' => [ + [], + [Domain::id() => 'discovered-project-dotenv.com'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubDotenvValue('DRUPAL_STAGE_FILE_PROXY_ORIGIN', 'https://discovered-project-dotenv.com'); + }, + ]; + yield 'domain - discovery - www' => [ + [], + [Domain::id() => 'discovered-project-dotenv.com'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubDotenvValue('DRUPAL_STAGE_FILE_PROXY_ORIGIN', 'https://www.discovered-project-dotenv.com'); + }, + ]; + yield 'domain - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubDotenvValue('DRUPAL_STAGE_FILE_PROXY_ORIGIN', ''); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/HostingProjectNameHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/HostingProjectNameHandlerDiscoveryTest.php index 69d3b5a34..56c7c9d5c 100644 --- a/.vortex/installer/tests/Unit/Handlers/HostingProjectNameHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/HostingProjectNameHandlerDiscoveryTest.php @@ -17,119 +17,109 @@ #[CoversClass(HostingProjectName::class)] class HostingProjectNameHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $clear_keys = implode('', array_fill(0, 20, Key::BACKSPACE)); - - return [ - 'hosting project name - acquia - prompt' => [ - [ - HostingProvider::id() => Key::DOWN . Key::ENTER . $clear_keys . 'my_acquia-project', - ], - [ - HostingProvider::id() => HostingProvider::ACQUIA, - HostingProjectName::id() => 'my_acquia-project', - DeployTypes::id() => [DeployTypes::ARTIFACT], - DatabaseDownloadSource::id() => DatabaseDownloadSource::ACQUIA, - Webroot::id() => Webroot::DOCROOT, - ] + $expected_defaults, + yield 'hosting project name - acquia - prompt' => [ + [ + HostingProvider::id() => Key::DOWN . Key::ENTER . $clear_keys . 'my_acquia-project', ], - - 'hosting project name - acquia - prompt - invalid' => [ - [HostingProvider::id() => Key::DOWN . Key::ENTER . $clear_keys . 'my_acquia project'], - 'Please enter a valid machine name: only lowercase letters, numbers, hyphens and underscores are allowed.', + [ + HostingProvider::id() => HostingProvider::ACQUIA, + HostingProjectName::id() => 'my_acquia-project', + DeployTypes::id() => [DeployTypes::ARTIFACT], + DatabaseDownloadSource::id() => DatabaseDownloadSource::ACQUIA, + Webroot::id() => Webroot::DOCROOT, + ] + $expected_defaults, + ]; + yield 'hosting project name - acquia - prompt - invalid' => [ + [HostingProvider::id() => Key::DOWN . Key::ENTER . $clear_keys . 'my_acquia project'], + 'Please enter a valid machine name: only lowercase letters, numbers, hyphens and underscores are allowed.', + ]; + yield 'hosting project name - acquia - discovery from .env' => [ + [ + HostingProvider::id() => Key::DOWN . Key::ENTER, ], - - 'hosting project name - acquia - discovery from .env' => [ - [ - HostingProvider::id() => Key::DOWN . Key::ENTER, - ], - [ - HostingProvider::id() => HostingProvider::ACQUIA, - HostingProjectName::id() => 'discovered_acquia-project', - DeployTypes::id() => [DeployTypes::ARTIFACT], - DatabaseDownloadSource::id() => DatabaseDownloadSource::ACQUIA, - Webroot::id() => Webroot::DOCROOT, - ] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubDotenvValue('VORTEX_ACQUIA_APP_NAME', 'discovered_acquia-project'); - }, + [ + HostingProvider::id() => HostingProvider::ACQUIA, + HostingProjectName::id() => 'discovered_acquia-project', + DeployTypes::id() => [DeployTypes::ARTIFACT], + DatabaseDownloadSource::id() => DatabaseDownloadSource::ACQUIA, + Webroot::id() => Webroot::DOCROOT, + ] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubDotenvValue('VORTEX_ACQUIA_APP_NAME', 'discovered_acquia-project'); + }, + ]; + yield 'hosting project name - acquia - discovery from settings.acquia.php' => [ + [ + HostingProvider::id() => Key::DOWN . Key::ENTER, ], - - 'hosting project name - acquia - discovery from settings.acquia.php' => [ - [ - HostingProvider::id() => Key::DOWN . Key::ENTER, - ], - [ - HostingProvider::id() => HostingProvider::ACQUIA, - HostingProjectName::id() => 'discovered_from_settings', - DeployTypes::id() => [DeployTypes::ARTIFACT], - DatabaseDownloadSource::id() => DatabaseDownloadSource::ACQUIA, - Webroot::id() => Webroot::DOCROOT, - ] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/web/sites/default/includes/providers/settings.acquia.php', << HostingProvider::ACQUIA, + HostingProjectName::id() => 'discovered_from_settings', + DeployTypes::id() => [DeployTypes::ARTIFACT], + DatabaseDownloadSource::id() => DatabaseDownloadSource::ACQUIA, + Webroot::id() => Webroot::DOCROOT, + ] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/web/sites/default/includes/providers/settings.acquia.php', << [ - [ - HostingProvider::id() => Key::DOWN . Key::DOWN . Key::ENTER . $clear_keys . 'my_lagoon-project', - ], - [ - HostingProvider::id() => HostingProvider::LAGOON, - HostingProjectName::id() => 'my_lagoon-project', - DeployTypes::id() => [DeployTypes::LAGOON], - DatabaseDownloadSource::id() => DatabaseDownloadSource::LAGOON, - ] + $expected_defaults, + ); + }, + ]; + yield 'hosting project name - lagoon - prompt' => [ + [ + HostingProvider::id() => Key::DOWN . Key::DOWN . Key::ENTER . $clear_keys . 'my_lagoon-project', ], - - 'hosting project name - lagoon - prompt - invalid' => [ - [HostingProvider::id() => Key::DOWN . Key::DOWN . Key::ENTER . $clear_keys . 'my_lagoon project'], - 'Please enter a valid machine name: only lowercase letters, numbers, hyphens and underscores are allowed.', + [ + HostingProvider::id() => HostingProvider::LAGOON, + HostingProjectName::id() => 'my_lagoon-project', + DeployTypes::id() => [DeployTypes::LAGOON], + DatabaseDownloadSource::id() => DatabaseDownloadSource::LAGOON, + ] + $expected_defaults, + ]; + yield 'hosting project name - lagoon - prompt - invalid' => [ + [HostingProvider::id() => Key::DOWN . Key::DOWN . Key::ENTER . $clear_keys . 'my_lagoon project'], + 'Please enter a valid machine name: only lowercase letters, numbers, hyphens and underscores are allowed.', + ]; + yield 'hosting project name - lagoon - discovery from .env' => [ + [ + HostingProvider::id() => Key::DOWN . Key::DOWN . Key::ENTER, ], - - 'hosting project name - lagoon - discovery from .env' => [ - [ - HostingProvider::id() => Key::DOWN . Key::DOWN . Key::ENTER, - ], - [ - HostingProvider::id() => HostingProvider::LAGOON, - HostingProjectName::id() => 'discovered_lagoon-project', - DeployTypes::id() => [DeployTypes::LAGOON], - DatabaseDownloadSource::id() => DatabaseDownloadSource::LAGOON, - ] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubDotenvValue('LAGOON_PROJECT', 'discovered_lagoon-project'); - }, + [ + HostingProvider::id() => HostingProvider::LAGOON, + HostingProjectName::id() => 'discovered_lagoon-project', + DeployTypes::id() => [DeployTypes::LAGOON], + DatabaseDownloadSource::id() => DatabaseDownloadSource::LAGOON, + ] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubDotenvValue('LAGOON_PROJECT', 'discovered_lagoon-project'); + }, + ]; + yield 'hosting project name - lagoon - discovery from drush lagoon.site.yml' => [ + [ + HostingProvider::id() => Key::DOWN . Key::DOWN . Key::ENTER, ], - - 'hosting project name - lagoon - discovery from drush lagoon.site.yml' => [ - [ - HostingProvider::id() => Key::DOWN . Key::DOWN . Key::ENTER, - ], - [ - HostingProvider::id() => HostingProvider::LAGOON, - HostingProjectName::id() => 'discovered_from_drush', - DeployTypes::id() => [DeployTypes::LAGOON], - DatabaseDownloadSource::id() => DatabaseDownloadSource::LAGOON, - ] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/drush/sites/lagoon.site.yml', << HostingProvider::LAGOON, + HostingProjectName::id() => 'discovered_from_drush', + DeployTypes::id() => [DeployTypes::LAGOON], + DatabaseDownloadSource::id() => DatabaseDownloadSource::LAGOON, + ] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/drush/sites/lagoon.site.yml', << [ - [HostingProvider::id() => Key::ENTER], - [HostingProvider::id() => HostingProvider::NONE] + $expected_defaults, - ], - - 'hosting provider - discovery - Acquia' => [ - [], - [ - HostingProvider::id() => HostingProvider::ACQUIA, - HostingProjectName::id() => 'myproject', - Webroot::id() => Webroot::DOCROOT, - DeployTypes::id() => [DeployTypes::ARTIFACT], - DatabaseDownloadSource::id() => DatabaseDownloadSource::ACQUIA, - ] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/hooks/somehook'); - }, - ], - - 'hosting provider - discovery - Acquia from env' => [ - [], - [ - HostingProvider::id() => HostingProvider::ACQUIA, - HostingProjectName::id() => 'myproject', - Webroot::id() => Webroot::DOCROOT, - DeployTypes::id() => [DeployTypes::ARTIFACT], - DatabaseDownloadSource::id() => DatabaseDownloadSource::ACQUIA, - ] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubDotenvValue('VORTEX_DOWNLOAD_DB_SOURCE', DatabaseDownloadSource::ACQUIA); - }, - ], - - 'hosting provider - discovery - Lagoon' => [ - [], - [ - HostingProvider::id() => HostingProvider::LAGOON, - HostingProjectName::id() => 'myproject', - DeployTypes::id() => [DeployTypes::LAGOON], - DatabaseDownloadSource::id() => DatabaseDownloadSource::LAGOON, - ] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/.lagoon.yml'); - }, - ], - - 'hosting provider - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No hooks, .lagoon.yml, or ACQUIA env var - fall back to default. - }, - ], + yield 'hosting provider - prompt' => [ + [HostingProvider::id() => Key::ENTER], + [HostingProvider::id() => HostingProvider::NONE] + $expected_defaults, + ]; + yield 'hosting provider - discovery - Acquia' => [ + [], + [ + HostingProvider::id() => HostingProvider::ACQUIA, + HostingProjectName::id() => 'myproject', + Webroot::id() => Webroot::DOCROOT, + DeployTypes::id() => [DeployTypes::ARTIFACT], + DatabaseDownloadSource::id() => DatabaseDownloadSource::ACQUIA, + ] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/hooks/somehook'); + }, + ]; + yield 'hosting provider - discovery - Acquia from env' => [ + [], + [ + HostingProvider::id() => HostingProvider::ACQUIA, + HostingProjectName::id() => 'myproject', + Webroot::id() => Webroot::DOCROOT, + DeployTypes::id() => [DeployTypes::ARTIFACT], + DatabaseDownloadSource::id() => DatabaseDownloadSource::ACQUIA, + ] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubDotenvValue('VORTEX_DOWNLOAD_DB_SOURCE', DatabaseDownloadSource::ACQUIA); + }, + ]; + yield 'hosting provider - discovery - Lagoon' => [ + [], + [ + HostingProvider::id() => HostingProvider::LAGOON, + HostingProjectName::id() => 'myproject', + DeployTypes::id() => [DeployTypes::LAGOON], + DatabaseDownloadSource::id() => DatabaseDownloadSource::LAGOON, + ] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/.lagoon.yml'); + }, + ]; + yield 'hosting provider - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No hooks, .lagoon.yml, or ACQUIA env var - fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/MigrationDownloadSourceHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/MigrationDownloadSourceHandlerDiscoveryTest.php index 134be061a..adf432c42 100644 --- a/.vortex/installer/tests/Unit/Handlers/MigrationDownloadSourceHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/MigrationDownloadSourceHandlerDiscoveryTest.php @@ -12,56 +12,49 @@ #[CoversClass(MigrationDownloadSource::class)] class MigrationDownloadSourceHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); - - return [ - 'migration download source - prompt' => [ - [ - Migration::id() => Key::LEFT . Key::ENTER, - MigrationDownloadSource::id() => Key::ENTER, - ], - [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::URL] + $expected_defaults, + yield 'migration download source - prompt' => [ + [ + Migration::id() => Key::LEFT . Key::ENTER, + MigrationDownloadSource::id() => Key::ENTER, ], - - 'migration download source - prompt - ftp' => [ - [ - Migration::id() => Key::LEFT . Key::ENTER, - MigrationDownloadSource::id() => Key::DOWN . Key::ENTER, - ], - [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::FTP] + $expected_defaults, + [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::URL] + $expected_defaults, + ]; + yield 'migration download source - prompt - ftp' => [ + [ + Migration::id() => Key::LEFT . Key::ENTER, + MigrationDownloadSource::id() => Key::DOWN . Key::ENTER, ], - - 'migration download source - discovery' => [ - [ - Migration::id() => Key::LEFT . Key::ENTER, - ], - [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::FTP] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubDotenvValue('VORTEX_DOWNLOAD_DB2_SOURCE', MigrationDownloadSource::FTP); - }, + [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::FTP] + $expected_defaults, + ]; + yield 'migration download source - discovery' => [ + [ + Migration::id() => Key::LEFT . Key::ENTER, ], - - 'migration download source - discovery - s3' => [ - [ - Migration::id() => Key::LEFT . Key::ENTER, - ], - [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::S3] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubDotenvValue('VORTEX_DOWNLOAD_DB2_SOURCE', MigrationDownloadSource::S3); - }, + [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::FTP] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubDotenvValue('VORTEX_DOWNLOAD_DB2_SOURCE', MigrationDownloadSource::FTP); + }, + ]; + yield 'migration download source - discovery - s3' => [ + [ + Migration::id() => Key::LEFT . Key::ENTER, ], - - 'migration download source - discovery - invalid' => [ - [ - Migration::id() => Key::LEFT . Key::ENTER, - MigrationDownloadSource::id() => Key::ENTER, - ], - [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::URL] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubDotenvValue('VORTEX_DOWNLOAD_DB2_SOURCE', 'invalid_source'); - }, + [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::S3] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubDotenvValue('VORTEX_DOWNLOAD_DB2_SOURCE', MigrationDownloadSource::S3); + }, + ]; + yield 'migration download source - discovery - invalid' => [ + [ + Migration::id() => Key::LEFT . Key::ENTER, + MigrationDownloadSource::id() => Key::ENTER, ], + [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::URL] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubDotenvValue('VORTEX_DOWNLOAD_DB2_SOURCE', 'invalid_source'); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/MigrationHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/MigrationHandlerDiscoveryTest.php index 9fc973011..b92310667 100644 --- a/.vortex/installer/tests/Unit/Handlers/MigrationHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/MigrationHandlerDiscoveryTest.php @@ -16,59 +16,51 @@ #[CoversClass(Migration::class)] class MigrationHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'migration - prompt - disabled' => [ - [Migration::id() => Key::ENTER], - [Migration::id() => FALSE] + $expected_defaults, - ], - - 'migration - prompt - enabled' => [ - [ - Migration::id() => Key::LEFT . Key::ENTER, - MigrationDownloadSource::id() => Key::ENTER, - ], - [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::URL] + $expected_defaults, - ], - - 'migration - discovery - database2 exists' => [ - [ - MigrationDownloadSource::id() => Key::ENTER, - ], - [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::URL] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => ['database2' => [], Services::CLAMAV => [], Services::REDIS => [], Services::SOLR => []]])); - }, - ], - - 'migration - discovery - no database2 service' => [ - [], - [Migration::id() => FALSE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => ['database' => [], Services::CLAMAV => [], Services::REDIS => [], Services::SOLR => []]])); - }, - ], - - 'migration - discovery - no docker-compose' => [ - [], - $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - }, + yield 'migration - prompt - disabled' => [ + [Migration::id() => Key::ENTER], + [Migration::id() => FALSE] + $expected_defaults, + ]; + yield 'migration - prompt - enabled' => [ + [ + Migration::id() => Key::LEFT . Key::ENTER, + MigrationDownloadSource::id() => Key::ENTER, ], - - 'migration - discovery - non-Vortex' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => ['database2' => [], Services::CLAMAV => [], Services::REDIS => [], Services::SOLR => []]])); - }, + [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::URL] + $expected_defaults, + ]; + yield 'migration - discovery - database2 exists' => [ + [ + MigrationDownloadSource::id() => Key::ENTER, ], + [Migration::id() => TRUE, MigrationDownloadSource::id() => MigrationDownloadSource::URL] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => ['database2' => [], Services::CLAMAV => [], Services::REDIS => [], Services::SOLR => []]])); + }, + ]; + yield 'migration - discovery - no database2 service' => [ + [], + [Migration::id() => FALSE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => ['database' => [], Services::CLAMAV => [], Services::REDIS => [], Services::SOLR => []]])); + }, + ]; + yield 'migration - discovery - no docker-compose' => [ + [], + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + }, + ]; + yield 'migration - discovery - non-Vortex' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => ['database2' => [], Services::CLAMAV => [], Services::REDIS => [], Services::SOLR => []]])); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/ModulePrefixHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/ModulePrefixHandlerDiscoveryTest.php index 28eda6b00..092595122 100644 --- a/.vortex/installer/tests/Unit/Handlers/ModulePrefixHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/ModulePrefixHandlerDiscoveryTest.php @@ -12,72 +12,61 @@ #[CoversClass(ModulePrefix::class)] class ModulePrefixHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); - - return [ - 'module prefix - prompt' => [ - [ModulePrefix::id() => 'myprefix'], - [ModulePrefix::id() => 'myprefix'] + $expected_defaults, - ], - - 'module prefix - prompt - override' => [ - [ModulePrefix::id() => 'myprefix'], - [ModulePrefix::id() => 'myprefix'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/web/profiles/custom/discovered_profile/modules/custom/dp_base/dp_base.info'); - }, - ], - - 'module prefix - prompt - invalid' => [ - [ModulePrefix::id() => 'my prefix'], - 'Please enter a valid module prefix: only lowercase letters, numbers, and underscores are allowed.', - ], - - 'module prefix - prompt - invalid - capitalization' => [ - [ModulePrefix::id() => 'MyPrefix'], - 'Please enter a valid module prefix: only lowercase letters, numbers, and underscores are allowed.', - ], - - 'module prefix - discovery' => [ - [], - [ModulePrefix::id() => 'dp'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/web/modules/custom/dp_base/dp_base.info'); - }, - ], - - 'module prefix - discovery - core' => [ - [], - [ModulePrefix::id() => 'dp'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/web/modules/custom/dp_core/dp_core.info'); - }, - ], - - 'module prefix - discovery - within profile' => [ - [], - [ModulePrefix::id() => 'dp'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/web/profiles/custom/discovered_profile/modules/custom/dp_base/dp_base.info'); - }, - ], - - 'module prefix - discovery - within profile - core' => [ - [], - [ModulePrefix::id() => 'dp'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/web/profiles/custom/discovered_profile/modules/custom/dp_core/dp_core.info'); - }, - ], - - 'module prefix - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No *_base or *_core modules exist - should fall back to default. - }, - ], + yield 'module prefix - prompt' => [ + [ModulePrefix::id() => 'myprefix'], + [ModulePrefix::id() => 'myprefix'] + $expected_defaults, + ]; + yield 'module prefix - prompt - override' => [ + [ModulePrefix::id() => 'myprefix'], + [ModulePrefix::id() => 'myprefix'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/web/profiles/custom/discovered_profile/modules/custom/dp_base/dp_base.info'); + }, + ]; + yield 'module prefix - prompt - invalid' => [ + [ModulePrefix::id() => 'my prefix'], + 'Please enter a valid module prefix: only lowercase letters, numbers, and underscores are allowed.', + ]; + yield 'module prefix - prompt - invalid - capitalization' => [ + [ModulePrefix::id() => 'MyPrefix'], + 'Please enter a valid module prefix: only lowercase letters, numbers, and underscores are allowed.', + ]; + yield 'module prefix - discovery' => [ + [], + [ModulePrefix::id() => 'dp'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/web/modules/custom/dp_base/dp_base.info'); + }, + ]; + yield 'module prefix - discovery - core' => [ + [], + [ModulePrefix::id() => 'dp'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/web/modules/custom/dp_core/dp_core.info'); + }, + ]; + yield 'module prefix - discovery - within profile' => [ + [], + [ModulePrefix::id() => 'dp'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/web/profiles/custom/discovered_profile/modules/custom/dp_base/dp_base.info'); + }, + ]; + yield 'module prefix - discovery - within profile - core' => [ + [], + [ModulePrefix::id() => 'dp'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/web/profiles/custom/discovered_profile/modules/custom/dp_core/dp_core.info'); + }, + ]; + yield 'module prefix - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No *_base or *_core modules exist - should fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/ModulesHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/ModulesHandlerDiscoveryTest.php index 27876dd81..6d1638a9d 100644 --- a/.vortex/installer/tests/Unit/Handlers/ModulesHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/ModulesHandlerDiscoveryTest.php @@ -13,122 +13,111 @@ #[CoversClass(Modules::class)] class ModulesHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'modules - prompt' => [ - [Modules::id() => Key::ENTER], - [Modules::id() => array_keys(Modules::getAvailableModules())] + $expected_defaults, - ], - - 'modules - discovery - some modules' => [ - [], - [Modules::id() => ['config_split', 'pathauto', 'shield']] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies([ - 'drupal/config_split' => '^2.0.2', - 'drupal/pathauto' => '^1.14', - 'drupal/shield' => '^1.8', - ]); - }, - ], - - 'modules - discovery - all modules' => [ - [], - [Modules::id() => array_keys(Modules::getAvailableModules())] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies([ - 'drupal/admin_toolbar' => '^3.6.2', - 'drupal/coffee' => '^2.0.1', - 'drupal/config_split' => '^2.0.2', - 'drupal/config_update' => '^2@alpha', - 'drupal/environment_indicator' => '^4.0.25', - 'drupal/pathauto' => '^1.14', - 'drupal/redirect' => '^1.12', - 'drupal/robotstxt' => '^1.6', - 'drupal/seckit' => '^2.0.3', - 'drupal/shield' => '^1.8', - 'drupal/stage_file_proxy' => '^3.1.6', - 'drupal/xmlsitemap' => '^2.0', - ]); - }, - ], - - 'modules - discovery - none' => [ - [], - [Modules::id() => []] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies([ - 'drupal/core-recommended' => '~11.2.5', - ]); - }, - ], - - 'modules - discovery - filters out core packages' => [ - [], - [Modules::id() => ['admin_toolbar', 'pathauto']] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies([ - 'drupal/core-recommended' => '~11.2.5', - 'drupal/core-composer-scaffold' => '~11.2.5', - 'drupal/core-dev' => '~11.2.5', - 'drupal/admin_toolbar' => '^3.6.2', - 'drupal/pathauto' => '^1.14', - ]); - }, - ], - - 'modules - discovery - filters out service modules' => [ - [], - [Modules::id() => ['admin_toolbar', 'pathauto']] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies([ - 'drupal/admin_toolbar' => '^3.6.2', - 'drupal/clamav' => '^2.1', - 'drupal/pathauto' => '^1.14', - 'drupal/redis' => '^1.10', - 'drupal/search_api' => '^1.40', - 'drupal/search_api_solr' => '^4.3.10', - ]); - }, - ], - - 'modules - discovery - invalid composer.json' => [ - [], - $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - // Invalid JSON causes discovery to fail and fall back to defaults. - File::dump(static::$sut . '/composer.json', 'invalid json content'); - }, - ], - - 'modules - discovery - non-Vortex project' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubComposerJsonDependencies([ - 'drupal/admin_toolbar' => '^3.6.2', - 'drupal/pathauto' => '^1.14', - ]); - }, - ], - - 'modules - discovery - non-Vortex project, invalid composer.json' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - // Invalid JSON causes discovery to fail and fall back to defaults. - File::dump(static::$sut . '/composer.json', 'invalid json content'); - }, - ], + yield 'modules - prompt' => [ + [Modules::id() => Key::ENTER], + [Modules::id() => array_keys(Modules::getAvailableModules())] + $expected_defaults, + ]; + yield 'modules - discovery - some modules' => [ + [], + [Modules::id() => ['config_split', 'pathauto', 'shield']] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies([ + 'drupal/config_split' => '^2.0.2', + 'drupal/pathauto' => '^1.14', + 'drupal/shield' => '^1.8', + ]); + }, + ]; + yield 'modules - discovery - all modules' => [ + [], + [Modules::id() => array_keys(Modules::getAvailableModules())] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies([ + 'drupal/admin_toolbar' => '^3.6.2', + 'drupal/coffee' => '^2.0.1', + 'drupal/config_split' => '^2.0.2', + 'drupal/config_update' => '^2@alpha', + 'drupal/environment_indicator' => '^4.0.25', + 'drupal/pathauto' => '^1.14', + 'drupal/redirect' => '^1.12', + 'drupal/robotstxt' => '^1.6', + 'drupal/seckit' => '^2.0.3', + 'drupal/shield' => '^1.8', + 'drupal/stage_file_proxy' => '^3.1.6', + 'drupal/xmlsitemap' => '^2.0', + ]); + }, + ]; + yield 'modules - discovery - none' => [ + [], + [Modules::id() => []] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies([ + 'drupal/core-recommended' => '~11.2.5', + ]); + }, + ]; + yield 'modules - discovery - filters out core packages' => [ + [], + [Modules::id() => ['admin_toolbar', 'pathauto']] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies([ + 'drupal/core-recommended' => '~11.2.5', + 'drupal/core-composer-scaffold' => '~11.2.5', + 'drupal/core-dev' => '~11.2.5', + 'drupal/admin_toolbar' => '^3.6.2', + 'drupal/pathauto' => '^1.14', + ]); + }, + ]; + yield 'modules - discovery - filters out service modules' => [ + [], + [Modules::id() => ['admin_toolbar', 'pathauto']] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies([ + 'drupal/admin_toolbar' => '^3.6.2', + 'drupal/clamav' => '^2.1', + 'drupal/pathauto' => '^1.14', + 'drupal/redis' => '^1.10', + 'drupal/search_api' => '^1.40', + 'drupal/search_api_solr' => '^4.3.10', + ]); + }, + ]; + yield 'modules - discovery - invalid composer.json' => [ + [], + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + // Invalid JSON causes discovery to fail and fall back to defaults. + File::dump(static::$sut . '/composer.json', 'invalid json content'); + }, + ]; + yield 'modules - discovery - non-Vortex project' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubComposerJsonDependencies([ + 'drupal/admin_toolbar' => '^3.6.2', + 'drupal/pathauto' => '^1.14', + ]); + }, + ]; + yield 'modules - discovery - non-Vortex project, invalid composer.json' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + // Invalid JSON causes discovery to fail and fall back to defaults. + File::dump(static::$sut . '/composer.json', 'invalid json content'); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/NamesHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/NamesHandlerDiscoveryTest.php index ad415f704..fe8374510 100644 --- a/.vortex/installer/tests/Unit/Handlers/NamesHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/NamesHandlerDiscoveryTest.php @@ -21,180 +21,158 @@ #[CoversClass(ModulePrefix::class)] class NamesHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_discovered = static::getExpectedDiscovered(); - - return [ - 'project name - prompt' => [ - [Name::id() => 'Prompted project'], - [ - Name::id() => 'Prompted project', - MachineName::id() => 'prompted_project', - Org::id() => 'Prompted project Org', - OrgMachineName::id() => 'prompted_project_org', - Domain::id() => 'prompted-project.com', - ModulePrefix::id() => 'pp', - Theme::id() => 'prompted_project', - ] + $expected_defaults, - ], - - 'project name - prompt - invalid' => [ - [Name::id() => 'a_word'], - 'Please enter a valid project name.', - ], - - 'project name - discovery - dotenv' => [ - [], - $expected_discovered, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubDotenvValue('VORTEX_PROJECT', 'discovered_project'); - $test->stubComposerJsonValue('description', 'Drupal 11 Standard installation of Discovered project for Discovered project Org'); - }, - ], - - 'project name - discovery - description' => [ - [], - $expected_discovered, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('description', 'Drupal 11 Standard installation of Discovered project for Discovered project Org'); - }, - ], - - 'project name - discovery - description short' => [ - [], - $expected_discovered, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('description', 'Drupal 11 Standard installation of Discovered project.'); - }, - ], - - 'project name - discovery - description unmatched' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('description', 'Some other description'); - }, - ], - - 'project machine name - prompt' => [ - [MachineName::id() => 'prompted_project'], - [ - MachineName::id() => 'prompted_project', - Domain::id() => 'prompted-project.com', - ModulePrefix::id() => 'pp', - Theme::id() => 'prompted_project', - ] + $expected_defaults, - ], - - 'project machine name - prompt - invalid' => [ - [MachineName::id() => 'a word'], - 'Please enter a valid machine name: only lowercase letters, numbers, and underscores are allowed.', - ], - - 'project machine name - discovery' => [ - [], - [ - Name::id() => 'myproject', - MachineName::id() => 'discovered_project', - Org::id() => 'myproject Org', - ] + $expected_discovered, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('name', 'discovered_project_org/discovered_project'); - }, - ], - - 'project machine name - discovery - hyphenated' => [ - [], - [ - Name::id() => 'myproject', - MachineName::id() => 'discovered-project', - Org::id() => 'myproject Org', - ] + $expected_discovered, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('name', 'discovered_project_org/discovered-project'); - }, - ], - - 'project machine name - discovery - unmatched' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('name', 'invalid_composer_name_format'); - }, - ], - - 'org name - prompt' => [ - [Org::id() => 'Prompted Org'], - [ - Org::id() => 'Prompted Org', - OrgMachineName::id() => 'prompted_org', - ] + $expected_defaults, - ], - - 'org name - invalid' => [ - [Org::id() => 'a_word'], - 'Please enter a valid organization name.', - ], - - 'org name - discovery' => [ - [], - $expected_discovered, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('description', 'Drupal 11 Standard installation of Discovered project for Discovered project Org'); - }, - ], - - 'org name - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('description', 'Some other description that does not match the expected pattern'); - }, - ], - - 'org machine name - prompt' => [ - [OrgMachineName::id() => 'prompted_org'], - [OrgMachineName::id() => 'prompted_org'] + $expected_defaults, - ], - - 'org machine name - invalid ' => [ - [OrgMachineName::id() => 'a word'], - 'Please enter a valid organisation machine name: only lowercase letters, numbers, and underscores are allowed.', - ], - - 'org machine name - discovery' => [ - [], - [ - Name::id() => 'myproject', - MachineName::id() => 'discovered_project', - Org::id() => 'myproject Org', - ] + $expected_discovered, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('name', 'discovered_project_org/discovered_project'); - }, - ], - - 'org machine name - discovery - hyphenated' => [ - [], - [ - Name::id() => 'myproject', - MachineName::id() => 'discovered_project', - Org::id() => 'myproject Org', - OrgMachineName::id() => 'discovered-project-org', - ] + $expected_discovered, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('name', 'discovered-project-org/discovered_project'); - }, - ], - - 'org machine name - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - $test->stubComposerJsonValue('name', 'invalid_format'); - }, - ], + yield 'project name - prompt' => [ + [Name::id() => 'Prompted project'], + [ + Name::id() => 'Prompted project', + MachineName::id() => 'prompted_project', + Org::id() => 'Prompted project Org', + OrgMachineName::id() => 'prompted_project_org', + Domain::id() => 'prompted-project.com', + ModulePrefix::id() => 'pp', + Theme::id() => 'prompted_project', + ] + $expected_defaults, + ]; + yield 'project name - prompt - invalid' => [ + [Name::id() => 'a_word'], + 'Please enter a valid project name.', + ]; + yield 'project name - discovery - dotenv' => [ + [], + $expected_discovered, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubDotenvValue('VORTEX_PROJECT', 'discovered_project'); + $test->stubComposerJsonValue('description', 'Drupal 11 Standard installation of Discovered project for Discovered project Org'); + }, + ]; + yield 'project name - discovery - description' => [ + [], + $expected_discovered, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('description', 'Drupal 11 Standard installation of Discovered project for Discovered project Org'); + }, + ]; + yield 'project name - discovery - description short' => [ + [], + $expected_discovered, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('description', 'Drupal 11 Standard installation of Discovered project.'); + }, + ]; + yield 'project name - discovery - description unmatched' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('description', 'Some other description'); + }, + ]; + yield 'project machine name - prompt' => [ + [MachineName::id() => 'prompted_project'], + [ + MachineName::id() => 'prompted_project', + Domain::id() => 'prompted-project.com', + ModulePrefix::id() => 'pp', + Theme::id() => 'prompted_project', + ] + $expected_defaults, + ]; + yield 'project machine name - prompt - invalid' => [ + [MachineName::id() => 'a word'], + 'Please enter a valid machine name: only lowercase letters, numbers, and underscores are allowed.', + ]; + yield 'project machine name - discovery' => [ + [], + [ + Name::id() => 'myproject', + MachineName::id() => 'discovered_project', + Org::id() => 'myproject Org', + ] + $expected_discovered, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('name', 'discovered_project_org/discovered_project'); + }, + ]; + yield 'project machine name - discovery - hyphenated' => [ + [], + [ + Name::id() => 'myproject', + MachineName::id() => 'discovered-project', + Org::id() => 'myproject Org', + ] + $expected_discovered, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('name', 'discovered_project_org/discovered-project'); + }, + ]; + yield 'project machine name - discovery - unmatched' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('name', 'invalid_composer_name_format'); + }, + ]; + yield 'org name - prompt' => [ + [Org::id() => 'Prompted Org'], + [ + Org::id() => 'Prompted Org', + OrgMachineName::id() => 'prompted_org', + ] + $expected_defaults, + ]; + yield 'org name - invalid' => [ + [Org::id() => 'a_word'], + 'Please enter a valid organization name.', + ]; + yield 'org name - discovery' => [ + [], + $expected_discovered, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('description', 'Drupal 11 Standard installation of Discovered project for Discovered project Org'); + }, + ]; + yield 'org name - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('description', 'Some other description that does not match the expected pattern'); + }, + ]; + yield 'org machine name - prompt' => [ + [OrgMachineName::id() => 'prompted_org'], + [OrgMachineName::id() => 'prompted_org'] + $expected_defaults, + ]; + yield 'org machine name - invalid ' => [ + [OrgMachineName::id() => 'a word'], + 'Please enter a valid organisation machine name: only lowercase letters, numbers, and underscores are allowed.', + ]; + yield 'org machine name - discovery' => [ + [], + [ + Name::id() => 'myproject', + MachineName::id() => 'discovered_project', + Org::id() => 'myproject Org', + ] + $expected_discovered, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('name', 'discovered_project_org/discovered_project'); + }, + ]; + yield 'org machine name - discovery - hyphenated' => [ + [], + [ + Name::id() => 'myproject', + MachineName::id() => 'discovered_project', + Org::id() => 'myproject Org', + OrgMachineName::id() => 'discovered-project-org', + ] + $expected_discovered, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('name', 'discovered-project-org/discovered_project'); + }, + ]; + yield 'org machine name - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + $test->stubComposerJsonValue('name', 'invalid_format'); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/NotificationChannelsHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/NotificationChannelsHandlerDiscoveryTest.php index 4b275fa06..ae58938d0 100644 --- a/.vortex/installer/tests/Unit/Handlers/NotificationChannelsHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/NotificationChannelsHandlerDiscoveryTest.php @@ -13,86 +13,77 @@ #[CoversClass(NotificationChannels::class)] class NotificationChannelsHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'notification channels - prompt' => [ - [NotificationChannels::id() => Key::ENTER], - $expected_defaults, - ], - - 'notification channels - discovery - email only' => [ - [], - [NotificationChannels::id() => [NotificationChannels::EMAIL]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('VORTEX_NOTIFY_CHANNELS', Converter::toList([NotificationChannels::EMAIL])); - }, - ], - - 'notification channels - discovery - slack only' => [ - [], - [NotificationChannels::id() => [NotificationChannels::SLACK]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('VORTEX_NOTIFY_CHANNELS', Converter::toList([NotificationChannels::SLACK])); - }, - ], - - 'notification channels - discovery - multiple' => [ - [], - [NotificationChannels::id() => [NotificationChannels::EMAIL, NotificationChannels::GITHUB, NotificationChannels::SLACK]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('VORTEX_NOTIFY_CHANNELS', Converter::toList([NotificationChannels::EMAIL, NotificationChannels::SLACK, NotificationChannels::GITHUB])); - }, - ], - - 'notification channels - discovery - all channels' => [ - [], - [ - NotificationChannels::id() => [ - NotificationChannels::EMAIL, - NotificationChannels::GITHUB, - NotificationChannels::JIRA, - NotificationChannels::NEWRELIC, - NotificationChannels::SLACK, - NotificationChannels::WEBHOOK, - ], - ] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('VORTEX_NOTIFY_CHANNELS', Converter::toList([ - NotificationChannels::EMAIL, - NotificationChannels::SLACK, - NotificationChannels::WEBHOOK, - NotificationChannels::NEWRELIC, - NotificationChannels::JIRA, - NotificationChannels::GITHUB, - ])); - }, - ], - - 'notification channels - discovery - order' => [ - [], - [NotificationChannels::id() => [NotificationChannels::EMAIL, NotificationChannels::SLACK]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - // Test that order is normalized (alphabetically sorted). - $test->stubDotenvValue('VORTEX_NOTIFY_CHANNELS', Converter::toList([NotificationChannels::SLACK, NotificationChannels::EMAIL])); - }, - ], - - 'notification channels - discovery - invalid' => [ - [], - [NotificationChannels::id() => [NotificationChannels::EMAIL]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - // No VORTEX_NOTIFY_CHANNELS in .env - should fall back to default. - }, - ], + yield 'notification channels - prompt' => [ + [NotificationChannels::id() => Key::ENTER], + $expected_defaults, + ]; + yield 'notification channels - discovery - email only' => [ + [], + [NotificationChannels::id() => [NotificationChannels::EMAIL]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('VORTEX_NOTIFY_CHANNELS', Converter::toList([NotificationChannels::EMAIL])); + }, + ]; + yield 'notification channels - discovery - slack only' => [ + [], + [NotificationChannels::id() => [NotificationChannels::SLACK]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('VORTEX_NOTIFY_CHANNELS', Converter::toList([NotificationChannels::SLACK])); + }, + ]; + yield 'notification channels - discovery - multiple' => [ + [], + [NotificationChannels::id() => [NotificationChannels::EMAIL, NotificationChannels::GITHUB, NotificationChannels::SLACK]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('VORTEX_NOTIFY_CHANNELS', Converter::toList([NotificationChannels::EMAIL, NotificationChannels::SLACK, NotificationChannels::GITHUB])); + }, + ]; + yield 'notification channels - discovery - all channels' => [ + [], + [ + NotificationChannels::id() => [ + NotificationChannels::EMAIL, + NotificationChannels::GITHUB, + NotificationChannels::JIRA, + NotificationChannels::NEWRELIC, + NotificationChannels::SLACK, + NotificationChannels::WEBHOOK, + ], + ] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('VORTEX_NOTIFY_CHANNELS', Converter::toList([ + NotificationChannels::EMAIL, + NotificationChannels::SLACK, + NotificationChannels::WEBHOOK, + NotificationChannels::NEWRELIC, + NotificationChannels::JIRA, + NotificationChannels::GITHUB, + ])); + }, + ]; + yield 'notification channels - discovery - order' => [ + [], + [NotificationChannels::id() => [NotificationChannels::EMAIL, NotificationChannels::SLACK]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + // Test that order is normalized (alphabetically sorted). + $test->stubDotenvValue('VORTEX_NOTIFY_CHANNELS', Converter::toList([NotificationChannels::SLACK, NotificationChannels::EMAIL])); + }, + ]; + yield 'notification channels - discovery - invalid' => [ + [], + [NotificationChannels::id() => [NotificationChannels::EMAIL]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + // No VORTEX_NOTIFY_CHANNELS in .env - should fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/ProfileHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/ProfileHandlerDiscoveryTest.php index 583a7e7ad..b716a22b1 100644 --- a/.vortex/installer/tests/Unit/Handlers/ProfileHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/ProfileHandlerDiscoveryTest.php @@ -13,50 +13,42 @@ #[CoversClass(Profile::class)] class ProfileHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'profile - prompt' => [ - [Profile::id() => Key::DOWN . Key::ENTER], - [Profile::id() => 'minimal'] + $expected_defaults, - ], - - 'profile - prompt - custom' => [ - [Profile::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER . 'myprofile'], - [Profile::id() => 'myprofile'] + $expected_defaults, - ], - - 'profile - prompt - invalid' => [ - [Profile::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER . 'my profile'], - 'Please enter a valid profile name: only lowercase letters, numbers, and underscores are allowed.', - ], - - 'profile - discovery' => [ - [], - [Profile::id() => Profile::MINIMAL] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('DRUPAL_PROFILE', Profile::MINIMAL); - }, - ], - - 'profile - discovery - non-Vortex project' => [ - [], - [Profile::id() => 'discovered_profile'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/web/profiles/discovered_profile/discovered_profile.info'); - }, - ], - - 'profile - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No .env file and no profile info files - fall back to default. - }, - ], + yield 'profile - prompt' => [ + [Profile::id() => Key::DOWN . Key::ENTER], + [Profile::id() => 'minimal'] + $expected_defaults, + ]; + yield 'profile - prompt - custom' => [ + [Profile::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER . 'myprofile'], + [Profile::id() => 'myprofile'] + $expected_defaults, + ]; + yield 'profile - prompt - invalid' => [ + [Profile::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER . 'my profile'], + 'Please enter a valid profile name: only lowercase letters, numbers, and underscores are allowed.', + ]; + yield 'profile - discovery' => [ + [], + [Profile::id() => Profile::MINIMAL] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('DRUPAL_PROFILE', Profile::MINIMAL); + }, + ]; + yield 'profile - discovery - non-Vortex project' => [ + [], + [Profile::id() => 'discovered_profile'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/web/profiles/discovered_profile/discovered_profile.info'); + }, + ]; + yield 'profile - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No .env file and no profile info files - fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/ProvisionTypeHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/ProvisionTypeHandlerDiscoveryTest.php index d4a8a0305..622fd9571 100644 --- a/.vortex/installer/tests/Unit/Handlers/ProvisionTypeHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/ProvisionTypeHandlerDiscoveryTest.php @@ -13,38 +13,32 @@ #[CoversClass(ProvisionType::class)] class ProvisionTypeHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); - - return [ - 'provision type - prompt' => [ - [ProvisionType::id() => Key::ENTER], - [ProvisionType::id() => ProvisionType::DATABASE] + $expected_defaults, - ], - - 'provision type - discovery - database' => [ - [], - [ProvisionType::id() => ProvisionType::DATABASE] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubDotenvValue('VORTEX_PROVISION_TYPE', ProvisionType::DATABASE); - }, - ], - - 'provision type - discovery - profile' => [ - [], - [ProvisionType::id() => ProvisionType::PROFILE, DatabaseDownloadSource::id() => DatabaseDownloadSource::NONE] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubDotenvValue('VORTEX_PROVISION_TYPE', ProvisionType::PROFILE); - }, - ], - - 'provision type - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No VORTEX_PROVISION_TYPE in .env - should fall back to default. - }, - ], + yield 'provision type - prompt' => [ + [ProvisionType::id() => Key::ENTER], + [ProvisionType::id() => ProvisionType::DATABASE] + $expected_defaults, + ]; + yield 'provision type - discovery - database' => [ + [], + [ProvisionType::id() => ProvisionType::DATABASE] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubDotenvValue('VORTEX_PROVISION_TYPE', ProvisionType::DATABASE); + }, + ]; + yield 'provision type - discovery - profile' => [ + [], + [ProvisionType::id() => ProvisionType::PROFILE, DatabaseDownloadSource::id() => DatabaseDownloadSource::NONE] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubDotenvValue('VORTEX_PROVISION_TYPE', ProvisionType::PROFILE); + }, + ]; + yield 'provision type - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No VORTEX_PROVISION_TYPE in .env - should fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/PullRequestHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/PullRequestHandlerDiscoveryTest.php index 1c0da9a53..2d259c06a 100644 --- a/.vortex/installer/tests/Unit/Handlers/PullRequestHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/PullRequestHandlerDiscoveryTest.php @@ -15,86 +15,74 @@ #[CoversClass(LabelMergeConflictsPr::class)] class PullRequestHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'auto assign pr - prompt' => [ - [AssignAuthorPr::id() => Key::ENTER], - [AssignAuthorPr::id() => TRUE] + $expected_defaults, - ], - - 'auto assign pr - discovery' => [ - [], - [AssignAuthorPr::id() => TRUE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/.github/workflows/assign-author.yml'); - }, - ], - - 'auto assign pr - discovery - removed' => [ - [], - [AssignAuthorPr::id() => FALSE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - }, - ], - - 'auto assign pr - discovery - non-Vortex' => [ - [], - [AssignAuthorPr::id() => TRUE] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/.github/workflows/assign-author.yml'); - }, - ], - - 'auto assign pr - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No assign-author.yml workflow and not installed - fall back. - }, - ], - - 'label merge conflicts - prompt' => [ - [LabelMergeConflictsPr::id() => Key::ENTER], - [LabelMergeConflictsPr::id() => TRUE] + $expected_defaults, - ], - - 'label merge conflicts - discovery' => [ - [], - [LabelMergeConflictsPr::id() => TRUE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/.github/workflows/label-merge-conflict.yml'); - }, - ], - - 'label merge conflicts - discovery - removed' => [ - [], - [LabelMergeConflictsPr::id() => FALSE] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - }, - ], - - 'label merge conflicts - discovery - non-Vortex' => [ - [], - [LabelMergeConflictsPr::id() => TRUE] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/.github/workflows/label-merge-conflict.yml'); - }, - ], - - 'label merge conflicts - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No label-merge-conflict.yml workflow and not installed - fall back. - }, - ], + yield 'auto assign pr - prompt' => [ + [AssignAuthorPr::id() => Key::ENTER], + [AssignAuthorPr::id() => TRUE] + $expected_defaults, + ]; + yield 'auto assign pr - discovery' => [ + [], + [AssignAuthorPr::id() => TRUE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/.github/workflows/assign-author.yml'); + }, + ]; + yield 'auto assign pr - discovery - removed' => [ + [], + [AssignAuthorPr::id() => FALSE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + }, + ]; + yield 'auto assign pr - discovery - non-Vortex' => [ + [], + [AssignAuthorPr::id() => TRUE] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/.github/workflows/assign-author.yml'); + }, + ]; + yield 'auto assign pr - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No assign-author.yml workflow and not installed - fall back. + }, + ]; + yield 'label merge conflicts - prompt' => [ + [LabelMergeConflictsPr::id() => Key::ENTER], + [LabelMergeConflictsPr::id() => TRUE] + $expected_defaults, + ]; + yield 'label merge conflicts - discovery' => [ + [], + [LabelMergeConflictsPr::id() => TRUE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/.github/workflows/label-merge-conflict.yml'); + }, + ]; + yield 'label merge conflicts - discovery - removed' => [ + [], + [LabelMergeConflictsPr::id() => FALSE] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + }, + ]; + yield 'label merge conflicts - discovery - non-Vortex' => [ + [], + [LabelMergeConflictsPr::id() => TRUE] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/.github/workflows/label-merge-conflict.yml'); + }, + ]; + yield 'label merge conflicts - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No label-merge-conflict.yml workflow and not installed - fall back. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/ServicesHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/ServicesHandlerDiscoveryTest.php index 46d3c56a1..966b8a67d 100644 --- a/.vortex/installer/tests/Unit/Handlers/ServicesHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/ServicesHandlerDiscoveryTest.php @@ -14,83 +14,73 @@ #[CoversClass(Services::class)] class ServicesHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'services - prompt' => [ - [Services::id() => Key::ENTER], - [Services::id() => [Services::CLAMAV, Services::REDIS, Services::SOLR]] + $expected_defaults, - ], - - 'services - discovery - solr' => [ - [], - [Services::id() => [Services::SOLR]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => [Services::SOLR => []]])); - }, - ], - - 'services - discovery - redis' => [ - [], - [Services::id() => [Services::REDIS]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => [Services::REDIS => []]])); - }, - ], - - 'services - discovery - clamav' => [ - [], - [Services::id() => [Services::CLAMAV]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => [Services::CLAMAV => []]])); - }, - ], - - 'services - discovery - all' => [ - [], - [ - Services::id() => [Services::CLAMAV, Services::REDIS, Services::SOLR], - ] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => [Services::CLAMAV => [], Services::REDIS => [], Services::SOLR => []]])); - }, - ], - - 'services - discovery - none' => [ - [], - [Services::id() => []] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => ['other_service' => []]])); - }, - ], - - 'services - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // Invalid YAML causes discovery to fail and fall back to defaults. - File::dump(static::$sut . '/docker-compose.yml', <<<'YAML' + yield 'services - prompt' => [ + [Services::id() => Key::ENTER], + [Services::id() => [Services::CLAMAV, Services::REDIS, Services::SOLR]] + $expected_defaults, + ]; + yield 'services - discovery - solr' => [ + [], + [Services::id() => [Services::SOLR]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => [Services::SOLR => []]])); + }, + ]; + yield 'services - discovery - redis' => [ + [], + [Services::id() => [Services::REDIS]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => [Services::REDIS => []]])); + }, + ]; + yield 'services - discovery - clamav' => [ + [], + [Services::id() => [Services::CLAMAV]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => [Services::CLAMAV => []]])); + }, + ]; + yield 'services - discovery - all' => [ + [], + [ + Services::id() => [Services::CLAMAV, Services::REDIS, Services::SOLR], + ] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => [Services::CLAMAV => [], Services::REDIS => [], Services::SOLR => []]])); + }, + ]; + yield 'services - discovery - none' => [ + [], + [Services::id() => []] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => ['other_service' => []]])); + }, + ]; + yield 'services - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // Invalid YAML causes discovery to fail and fall back to defaults. + File::dump(static::$sut . '/docker-compose.yml', <<<'YAML' - !text | first line YAML - ); - }, - ], - - 'services - discovery - non-Vortex project' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => [Services::REDIS => [], Services::CLAMAV => [], Services::SOLR => []]])); - }, - ], + ); + }, + ]; + yield 'services - discovery - non-Vortex project' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/docker-compose.yml', Yaml::dump(['services' => [Services::REDIS => [], Services::CLAMAV => [], Services::SOLR => []]])); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/StarterHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/StarterHandlerDiscoveryTest.php index 399c5cbab..5e1c40c61 100644 --- a/.vortex/installer/tests/Unit/Handlers/StarterHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/StarterHandlerDiscoveryTest.php @@ -13,43 +13,37 @@ #[CoversClass(Starter::class)] class StarterHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); + yield 'starter - prompt' => [ + [Starter::id() => Key::ENTER], + [Starter::id() => Starter::LOAD_DATABASE_DEMO] + $expected_defaults, + ]; + yield 'starter - prompt - Drupal profile' => [ + [Starter::id() => Key::DOWN . Key::ENTER], + [Starter::id() => Starter::INSTALL_PROFILE_CORE] + $expected_defaults, + ]; + yield 'starter - prompt - Drupal CMS profile' => [ + [Starter::id() => Key::DOWN . Key::DOWN . Key::ENTER], + [ + Starter::id() => Starter::INSTALL_PROFILE_DRUPALCMS, + Profile::id() => Starter::INSTALL_PROFILE_DRUPALCMS_PATH, + ] + $expected_defaults, - return [ - 'starter - prompt' => [ - [Starter::id() => Key::ENTER], - [Starter::id() => Starter::LOAD_DATABASE_DEMO] + $expected_defaults, - ], - - 'starter - prompt - Drupal profile' => [ - [Starter::id() => Key::DOWN . Key::ENTER], - [Starter::id() => Starter::INSTALL_PROFILE_CORE] + $expected_defaults, - ], - 'starter - prompt - Drupal CMS profile' => [ - [Starter::id() => Key::DOWN . Key::DOWN . Key::ENTER], - [ - Starter::id() => Starter::INSTALL_PROFILE_DRUPALCMS, - Profile::id() => Starter::INSTALL_PROFILE_DRUPALCMS_PATH, - ] + $expected_defaults, - - ], - - 'starter - discovery' => [ - [], - [Starter::id() => Starter::LOAD_DATABASE_DEMO] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // Noop. - }, - ], - - 'starter - installed project - skipped' => [ - [], - [Starter::id() => Starter::LOAD_DATABASE_DEMO] + static::getExpectedInstalled(), - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - }, - ], + ]; + yield 'starter - discovery' => [ + [], + [Starter::id() => Starter::LOAD_DATABASE_DEMO] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // Noop. + }, + ]; + yield 'starter - installed project - skipped' => [ + [], + [Starter::id() => Starter::LOAD_DATABASE_DEMO] + static::getExpectedInstalled(), + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/ThemeHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/ThemeHandlerDiscoveryTest.php index ab788567a..65313a9bd 100644 --- a/.vortex/installer/tests/Unit/Handlers/ThemeHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/ThemeHandlerDiscoveryTest.php @@ -13,94 +13,80 @@ #[CoversClass(Theme::class)] class ThemeHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); $clear_keys = implode('', array_fill(0, 20, Key::BACKSPACE)); - - return [ - 'theme - prompt - olivero' => [ - [Theme::id() => Key::DOWN . Key::ENTER], - [Theme::id() => Theme::OLIVERO] + $expected_defaults, - ], - - 'theme - prompt - claro' => [ - [Theme::id() => Key::DOWN . Key::DOWN . Key::ENTER], - [Theme::id() => Theme::CLARO] + $expected_defaults, - ], - - 'theme - prompt - stark' => [ - [Theme::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER], - [Theme::id() => Theme::STARK] + $expected_defaults, - ], - - 'theme - prompt - custom' => [ - [Theme::id() => Key::ENTER . $clear_keys . 'mytheme'], - [Theme::id() => 'mytheme'] + $expected_defaults, - ], - - 'theme - prompt - custom - invalid' => [ - [Theme::id() => Key::ENTER . $clear_keys . 'my theme'], - 'Please enter a valid theme machine name: only lowercase letters, numbers, and underscores are allowed.', - ], - - 'theme - prompt - custom - invalid - capitalization' => [ - [Theme::id() => Key::ENTER . $clear_keys . 'MyTheme'], - 'Please enter a valid theme machine name: only lowercase letters, numbers, and underscores are allowed.', - ], - - 'theme - discovery - olivero' => [ - [], - [Theme::id() => Theme::OLIVERO] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('DRUPAL_THEME', Theme::OLIVERO); - }, - ], - - 'theme - discovery - claro' => [ - [], - [Theme::id() => Theme::CLARO] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('DRUPAL_THEME', Theme::CLARO); - }, - ], - - 'theme - discovery - stark' => [ - [], - [Theme::id() => Theme::STARK] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('DRUPAL_THEME', Theme::STARK); - }, - ], - - 'theme - discovery - custom' => [ - [], - [Theme::id() => 'discovered_project'] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('DRUPAL_THEME', 'discovered_project'); - }, - ], - - 'theme - discovery - non-Vortex project' => [ - [], - [Theme::id() => 'discovered_project'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - File::dump(static::$sut . '/web/themes/custom/discovered_project/discovered_project.info'); - }, - ], - - 'theme - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No theme files exist and no DRUPAL_THEME in .env - fall back. - }, - ], + yield 'theme - prompt - olivero' => [ + [Theme::id() => Key::DOWN . Key::ENTER], + [Theme::id() => Theme::OLIVERO] + $expected_defaults, + ]; + yield 'theme - prompt - claro' => [ + [Theme::id() => Key::DOWN . Key::DOWN . Key::ENTER], + [Theme::id() => Theme::CLARO] + $expected_defaults, + ]; + yield 'theme - prompt - stark' => [ + [Theme::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER], + [Theme::id() => Theme::STARK] + $expected_defaults, + ]; + yield 'theme - prompt - custom' => [ + [Theme::id() => Key::ENTER . $clear_keys . 'mytheme'], + [Theme::id() => 'mytheme'] + $expected_defaults, + ]; + yield 'theme - prompt - custom - invalid' => [ + [Theme::id() => Key::ENTER . $clear_keys . 'my theme'], + 'Please enter a valid theme machine name: only lowercase letters, numbers, and underscores are allowed.', + ]; + yield 'theme - prompt - custom - invalid - capitalization' => [ + [Theme::id() => Key::ENTER . $clear_keys . 'MyTheme'], + 'Please enter a valid theme machine name: only lowercase letters, numbers, and underscores are allowed.', + ]; + yield 'theme - discovery - olivero' => [ + [], + [Theme::id() => Theme::OLIVERO] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('DRUPAL_THEME', Theme::OLIVERO); + }, + ]; + yield 'theme - discovery - claro' => [ + [], + [Theme::id() => Theme::CLARO] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('DRUPAL_THEME', Theme::CLARO); + }, + ]; + yield 'theme - discovery - stark' => [ + [], + [Theme::id() => Theme::STARK] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('DRUPAL_THEME', Theme::STARK); + }, + ]; + yield 'theme - discovery - custom' => [ + [], + [Theme::id() => 'discovered_project'] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('DRUPAL_THEME', 'discovered_project'); + }, + ]; + yield 'theme - discovery - non-Vortex project' => [ + [], + [Theme::id() => 'discovered_project'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + File::dump(static::$sut . '/web/themes/custom/discovered_project/discovered_project.info'); + }, + ]; + yield 'theme - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No theme files exist and no DRUPAL_THEME in .env - fall back. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/TimezoneHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/TimezoneHandlerDiscoveryTest.php index 1f4eea65c..2becaf030 100644 --- a/.vortex/installer/tests/Unit/Handlers/TimezoneHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/TimezoneHandlerDiscoveryTest.php @@ -11,32 +11,27 @@ #[CoversClass(Timezone::class)] class TimezoneHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'timezone - prompt' => [ - [Timezone::id() => 'America/New_York'], - [Timezone::id() => 'America/New_York'] + $expected_defaults, - ], - - 'timezone - discovery' => [ - [], - [Timezone::id() => 'Europe/London'] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('TZ', 'Europe/London'); - }, - ], - - 'timezone - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No TZ in .env - should fall back to default. - }, - ], + yield 'timezone - prompt' => [ + [Timezone::id() => 'America/New_York'], + [Timezone::id() => 'America/New_York'] + $expected_defaults, + ]; + yield 'timezone - discovery' => [ + [], + [Timezone::id() => 'Europe/London'] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('TZ', 'Europe/London'); + }, + ]; + yield 'timezone - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No TZ in .env - should fall back to default. + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/ToolsHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/ToolsHandlerDiscoveryTest.php index 6c59eb731..08d51f11b 100644 --- a/.vortex/installer/tests/Unit/Handlers/ToolsHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/ToolsHandlerDiscoveryTest.php @@ -13,226 +13,212 @@ #[CoversClass(Tools::class)] class ToolsHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'tools - prompt - defaults' => [ - [Tools::id() => Key::ENTER], - [Tools::id() => [Tools::BEHAT, Tools::ESLINT, Tools::PHPCS, Tools::PHPMD, Tools::PHPSTAN, Tools::PHPUNIT, Tools::RECTOR, Tools::STYLELINT]] + $expected_defaults, - ], - - 'tools - discovery - all tools' => [ - [], - [Tools::id() => [Tools::BEHAT, Tools::ESLINT, Tools::PHPCS, Tools::PHPMD, Tools::PHPSTAN, Tools::PHPUNIT, Tools::RECTOR, Tools::STYLELINT]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $dependencies = [ - 'squizlabs/php_codesniffer' => '*', - 'phpmd/phpmd' => '*', - 'phpstan/phpstan' => '*', - 'rector/rector' => '*', - 'phpunit/phpunit' => '*', - 'behat/behat' => '*', - ]; - $test->stubComposerJsonDependencies($dependencies, TRUE); - file_put_contents(static::$sut . '/package.json', json_encode(['devDependencies' => ['eslint' => '*', 'stylelint' => '*']], JSON_PRETTY_PRINT)); - }, - ], - - 'tools - discovery - none' => [ - [], - [Tools::id() => []] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - // No tool dependencies in composer.json. - }, - ], - - 'tools - discovery - non-Vortex project' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $dependencies = [ - 'squizlabs/php_codesniffer' => '*', - 'phpmd/phpmd' => '*', - 'phpstan/phpstan' => '*', - 'rector/rector' => '*', - 'phpunit/phpunit' => '*', - 'behat/behat' => '*', - ]; - $test->stubComposerJsonDependencies($dependencies, TRUE); - }, - ], - - 'tools - discovery - phpcs' => [ - [], - [Tools::id() => [Tools::PHPCS]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies(['drupal/coder' => '*'], TRUE); - }, - ], - 'tools - discovery - phpcs, alt' => [ - [], - [Tools::id() => [Tools::PHPCS]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies(['squizlabs/php_codesniffer' => '*'], TRUE); - }, - ], - 'tools - discovery - phpcs, alt2' => [ - [], - [Tools::id() => [Tools::PHPCS]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/phpcs.xml'); - }, - ], - - 'tools - discovery - phpstan' => [ - [], - [Tools::id() => [Tools::PHPSTAN]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies(['phpstan/phpstan' => '*'], TRUE); - }, - ], - 'tools - discovery - phpstan, alt' => [ - [], - [Tools::id() => [Tools::PHPSTAN]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies(['mglaman/phpstan-drupal' => '*'], TRUE); - }, - ], - 'tools - discovery - phpstan, alt2' => [ - [], - [Tools::id() => [Tools::PHPSTAN]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/phpstan.neon'); - }, - ], - - 'tools - discovery - rector' => [ - [], - [Tools::id() => [Tools::RECTOR]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies(['rector/rector' => '*'], TRUE); - }, - ], - 'tools - discovery - rector, alt' => [ - [], - [Tools::id() => [Tools::RECTOR]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies(['palantirnet/drupal-rector' => '*'], TRUE); - }, - ], - 'tools - discovery - rector, alt2' => [ - [], - [Tools::id() => [Tools::RECTOR]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/rector.php'); - }, - ], - - 'tools - discovery - phpmd' => [ - [], - [Tools::id() => [Tools::PHPMD]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies(['phpmd/phpmd' => '*'], TRUE); - }, - ], - 'tools - discovery - phpmd, alt' => [ - [], - [Tools::id() => [Tools::PHPMD]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/phpmd.xml'); - }, - ], - - 'tools - discovery - phpunit' => [ - [], - [Tools::id() => [Tools::PHPUNIT]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies(['phpunit/phpunit' => '*'], TRUE); - }, - ], - 'tools - discovery - phpunit, alt' => [ - [], - [Tools::id() => [Tools::PHPUNIT]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/phpunit.xml'); - }, - ], - - 'tools - discovery - behat' => [ - [], - [Tools::id() => [Tools::BEHAT]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies(['behat/behat' => '*'], TRUE); - }, - ], - 'tools - discovery - behat, alt' => [ - [], - [Tools::id() => [Tools::BEHAT]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubComposerJsonDependencies(['drupal/drupal-extension' => '*'], TRUE); - }, - ], - 'tools - discovery - behat, alt2' => [ - [], - [Tools::id() => [Tools::BEHAT]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/behat.yml'); - }, - ], - - 'tools - discovery - eslint' => [ - [], - [Tools::id() => [Tools::ESLINT]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - file_put_contents(static::$sut . '/package.json', json_encode(['devDependencies' => ['eslint' => '*']], JSON_PRETTY_PRINT)); - }, - ], - 'tools - discovery - eslint, alt' => [ - [], - [Tools::id() => [Tools::ESLINT]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/.eslintrc.json'); - }, - ], - - 'tools - discovery - stylelint' => [ - [], - [Tools::id() => [Tools::STYLELINT]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - file_put_contents(static::$sut . '/package.json', json_encode(['devDependencies' => ['stylelint' => '*']], JSON_PRETTY_PRINT)); - }, - ], - 'tools - discovery - stylelint, alt' => [ - [], - [Tools::id() => [Tools::STYLELINT]] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - File::dump(static::$sut . '/.stylelintrc.js'); - }, - ], + yield 'tools - prompt - defaults' => [ + [Tools::id() => Key::ENTER], + [Tools::id() => [Tools::BEHAT, Tools::ESLINT, Tools::PHPCS, Tools::PHPMD, Tools::PHPSTAN, Tools::PHPUNIT, Tools::RECTOR, Tools::STYLELINT]] + $expected_defaults, + ]; + yield 'tools - discovery - all tools' => [ + [], + [Tools::id() => [Tools::BEHAT, Tools::ESLINT, Tools::PHPCS, Tools::PHPMD, Tools::PHPSTAN, Tools::PHPUNIT, Tools::RECTOR, Tools::STYLELINT]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $dependencies = [ + 'squizlabs/php_codesniffer' => '*', + 'phpmd/phpmd' => '*', + 'phpstan/phpstan' => '*', + 'rector/rector' => '*', + 'phpunit/phpunit' => '*', + 'behat/behat' => '*', + ]; + $test->stubComposerJsonDependencies($dependencies, TRUE); + file_put_contents(static::$sut . '/package.json', json_encode(['devDependencies' => ['eslint' => '*', 'stylelint' => '*']], JSON_PRETTY_PRINT)); + }, + ]; + yield 'tools - discovery - none' => [ + [], + [Tools::id() => []] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + // No tool dependencies in composer.json. + }, + ]; + yield 'tools - discovery - non-Vortex project' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $dependencies = [ + 'squizlabs/php_codesniffer' => '*', + 'phpmd/phpmd' => '*', + 'phpstan/phpstan' => '*', + 'rector/rector' => '*', + 'phpunit/phpunit' => '*', + 'behat/behat' => '*', + ]; + $test->stubComposerJsonDependencies($dependencies, TRUE); + }, + ]; + yield 'tools - discovery - phpcs' => [ + [], + [Tools::id() => [Tools::PHPCS]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies(['drupal/coder' => '*'], TRUE); + }, + ]; + yield 'tools - discovery - phpcs, alt' => [ + [], + [Tools::id() => [Tools::PHPCS]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies(['squizlabs/php_codesniffer' => '*'], TRUE); + }, + ]; + yield 'tools - discovery - phpcs, alt2' => [ + [], + [Tools::id() => [Tools::PHPCS]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/phpcs.xml'); + }, + ]; + yield 'tools - discovery - phpstan' => [ + [], + [Tools::id() => [Tools::PHPSTAN]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies(['phpstan/phpstan' => '*'], TRUE); + }, + ]; + yield 'tools - discovery - phpstan, alt' => [ + [], + [Tools::id() => [Tools::PHPSTAN]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies(['mglaman/phpstan-drupal' => '*'], TRUE); + }, + ]; + yield 'tools - discovery - phpstan, alt2' => [ + [], + [Tools::id() => [Tools::PHPSTAN]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/phpstan.neon'); + }, + ]; + yield 'tools - discovery - rector' => [ + [], + [Tools::id() => [Tools::RECTOR]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies(['rector/rector' => '*'], TRUE); + }, + ]; + yield 'tools - discovery - rector, alt' => [ + [], + [Tools::id() => [Tools::RECTOR]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies(['palantirnet/drupal-rector' => '*'], TRUE); + }, + ]; + yield 'tools - discovery - rector, alt2' => [ + [], + [Tools::id() => [Tools::RECTOR]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/rector.php'); + }, + ]; + yield 'tools - discovery - phpmd' => [ + [], + [Tools::id() => [Tools::PHPMD]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies(['phpmd/phpmd' => '*'], TRUE); + }, + ]; + yield 'tools - discovery - phpmd, alt' => [ + [], + [Tools::id() => [Tools::PHPMD]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/phpmd.xml'); + }, + ]; + yield 'tools - discovery - phpunit' => [ + [], + [Tools::id() => [Tools::PHPUNIT]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies(['phpunit/phpunit' => '*'], TRUE); + }, + ]; + yield 'tools - discovery - phpunit, alt' => [ + [], + [Tools::id() => [Tools::PHPUNIT]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/phpunit.xml'); + }, + ]; + yield 'tools - discovery - behat' => [ + [], + [Tools::id() => [Tools::BEHAT]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies(['behat/behat' => '*'], TRUE); + }, + ]; + yield 'tools - discovery - behat, alt' => [ + [], + [Tools::id() => [Tools::BEHAT]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubComposerJsonDependencies(['drupal/drupal-extension' => '*'], TRUE); + }, + ]; + yield 'tools - discovery - behat, alt2' => [ + [], + [Tools::id() => [Tools::BEHAT]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/behat.yml'); + }, + ]; + yield 'tools - discovery - eslint' => [ + [], + [Tools::id() => [Tools::ESLINT]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + file_put_contents(static::$sut . '/package.json', json_encode(['devDependencies' => ['eslint' => '*']], JSON_PRETTY_PRINT)); + }, + ]; + yield 'tools - discovery - eslint, alt' => [ + [], + [Tools::id() => [Tools::ESLINT]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/.eslintrc.json'); + }, + ]; + yield 'tools - discovery - stylelint' => [ + [], + [Tools::id() => [Tools::STYLELINT]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + file_put_contents(static::$sut . '/package.json', json_encode(['devDependencies' => ['stylelint' => '*']], JSON_PRETTY_PRINT)); + }, + ]; + yield 'tools - discovery - stylelint, alt' => [ + [], + [Tools::id() => [Tools::STYLELINT]] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + File::dump(static::$sut . '/.stylelintrc.js'); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/VersionSchemeHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/VersionSchemeHandlerDiscoveryTest.php index 83f9c5945..e38818478 100644 --- a/.vortex/installer/tests/Unit/Handlers/VersionSchemeHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/VersionSchemeHandlerDiscoveryTest.php @@ -12,50 +12,43 @@ #[CoversClass(VersionScheme::class)] class VersionSchemeHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); $expected_installed = static::getExpectedInstalled(); - - return [ - 'version scheme - prompt' => [ - [VersionScheme::id() => Key::ENTER], - $expected_defaults, - ], - - 'version scheme - discovery - calver' => [ - [], - [VersionScheme::id() => VersionScheme::CALVER] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('VORTEX_RELEASE_VERSION_SCHEME', VersionScheme::CALVER); - }, - ], - - 'version scheme - discovery - semver' => [ - [], - [VersionScheme::id() => VersionScheme::SEMVER] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('VORTEX_RELEASE_VERSION_SCHEME', VersionScheme::SEMVER); - }, - ], - - 'version scheme - discovery - other' => [ - [], - [VersionScheme::id() => VersionScheme::OTHER] + $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - $test->stubDotenvValue('VORTEX_RELEASE_VERSION_SCHEME', VersionScheme::OTHER); - }, - ], - - 'version scheme - discovery - missing .env' => [ - [], - $expected_installed, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubVortexProject($config); - }, - ], + yield 'version scheme - prompt' => [ + [VersionScheme::id() => Key::ENTER], + $expected_defaults, + ]; + yield 'version scheme - discovery - calver' => [ + [], + [VersionScheme::id() => VersionScheme::CALVER] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('VORTEX_RELEASE_VERSION_SCHEME', VersionScheme::CALVER); + }, + ]; + yield 'version scheme - discovery - semver' => [ + [], + [VersionScheme::id() => VersionScheme::SEMVER] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('VORTEX_RELEASE_VERSION_SCHEME', VersionScheme::SEMVER); + }, + ]; + yield 'version scheme - discovery - other' => [ + [], + [VersionScheme::id() => VersionScheme::OTHER] + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + $test->stubDotenvValue('VORTEX_RELEASE_VERSION_SCHEME', VersionScheme::OTHER); + }, + ]; + yield 'version scheme - discovery - missing .env' => [ + [], + $expected_installed, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubVortexProject($config); + }, ]; } diff --git a/.vortex/installer/tests/Unit/Handlers/WebrootHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Handlers/WebrootHandlerDiscoveryTest.php index b2a921a87..7e7739cd8 100644 --- a/.vortex/installer/tests/Unit/Handlers/WebrootHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Handlers/WebrootHandlerDiscoveryTest.php @@ -13,71 +13,62 @@ #[CoversClass(Webroot::class)] class WebrootHandlerDiscoveryTest extends AbstractHandlerDiscoveryTestCase { - public static function dataProviderRunPrompts(): array { + public static function dataProviderRunPrompts(): \Iterator { $expected_defaults = static::getExpectedDefaults(); - - return [ - 'webroot - prompt' => [ - [ - HostingProvider::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, - Webroot::id() => 'my_webroot', - ], - [ - HostingProvider::id() => HostingProvider::OTHER, - Webroot::id() => 'my_webroot', - ] + $expected_defaults, - ], - - 'webroot - prompt - capitalization' => [ - [ - HostingProvider::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, - Webroot::id() => 'MyWebroot', - ], - [ - HostingProvider::id() => HostingProvider::OTHER, - Webroot::id() => 'MyWebroot', - ] + $expected_defaults, - ], - - 'webroot - prompt - invalid' => [ - [ - HostingProvider::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, - Webroot::id() => 'my webroot', - ], - 'Please enter a valid webroot name: only lowercase letters, numbers, and underscores are allowed.', - ], - - 'webroot - discovery' => [ - [], - [Webroot::id() => 'discovered_webroot'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubDotenvValue('WEBROOT', 'discovered_webroot'); - }, - ], - - 'webroot - discovery - composer' => [ - [], - [Webroot::id() => 'discovered_webroot'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubComposerJsonValue('extra', ['drupal-scaffold' => ['locations' => ['web-root' => 'discovered_webroot']]]); - }, + yield 'webroot - prompt' => [ + [ + HostingProvider::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, + Webroot::id() => 'my_webroot', ], - - 'webroot - discovery - composer, relative' => [ - [], - [Webroot::id() => 'discovered_webroot'] + $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { - $test->stubComposerJsonValue('extra', ['drupal-scaffold' => ['locations' => ['web-root' => './discovered_webroot']]]); - }, + [ + HostingProvider::id() => HostingProvider::OTHER, + Webroot::id() => 'my_webroot', + ] + $expected_defaults, + ]; + yield 'webroot - prompt - capitalization' => [ + [ + HostingProvider::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, + Webroot::id() => 'MyWebroot', ], - - 'webroot - discovery - invalid' => [ - [], - $expected_defaults, - function (AbstractHandlerDiscoveryTestCase $test): void { - // No WEBROOT in .env and no composer.json scaffold - fall back. - }, + [ + HostingProvider::id() => HostingProvider::OTHER, + Webroot::id() => 'MyWebroot', + ] + $expected_defaults, + ]; + yield 'webroot - prompt - invalid' => [ + [ + HostingProvider::id() => Key::DOWN . Key::DOWN . Key::DOWN . Key::ENTER, + Webroot::id() => 'my webroot', ], + 'Please enter a valid webroot name: only lowercase letters, numbers, and underscores are allowed.', + ]; + yield 'webroot - discovery' => [ + [], + [Webroot::id() => 'discovered_webroot'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubDotenvValue('WEBROOT', 'discovered_webroot'); + }, + ]; + yield 'webroot - discovery - composer' => [ + [], + [Webroot::id() => 'discovered_webroot'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubComposerJsonValue('extra', ['drupal-scaffold' => ['locations' => ['web-root' => 'discovered_webroot']]]); + }, + ]; + yield 'webroot - discovery - composer, relative' => [ + [], + [Webroot::id() => 'discovered_webroot'] + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { + $test->stubComposerJsonValue('extra', ['drupal-scaffold' => ['locations' => ['web-root' => './discovered_webroot']]]); + }, + ]; + yield 'webroot - discovery - invalid' => [ + [], + $expected_defaults, + function (AbstractHandlerDiscoveryTestCase $test): void { + // No WEBROOT in .env and no composer.json scaffold - fall back. + }, ]; } diff --git a/.vortex/installer/tests/Unit/JsonManipulatorTest.php b/.vortex/installer/tests/Unit/JsonManipulatorTest.php index 85711d322..0c563cef3 100644 --- a/.vortex/installer/tests/Unit/JsonManipulatorTest.php +++ b/.vortex/installer/tests/Unit/JsonManipulatorTest.php @@ -111,40 +111,34 @@ public function testGetProperty(string $property_name, mixed $expected): void { $this->assertSame($expected, $result); } - public static function dataProviderGetProperty(): array { - return [ - // Top-level properties. - 'name property' => ['name', 'test/package'], - 'description property' => ['description', 'A test package'], - 'version property' => ['version', '1.0.0'], - - // Nested object properties. - 'require.php' => ['require.php', '^8.1'], - 'require.symfony/console' => ['require.symfony/console', '^6.0'], - 'require-dev.phpunit/phpunit' => ['require-dev.phpunit/phpunit', '^9.0'], - 'autoload.psr-4.Test\\' => ['autoload.psr-4.Test\\', 'src/'], - 'scripts.test' => ['scripts.test', 'phpunit'], - - // Entire objects. - 'require object' => [ - 'require', + public static function dataProviderGetProperty(): \Iterator { + // Top-level properties. + yield 'name property' => ['name', 'test/package']; + yield 'description property' => ['description', 'A test package']; + yield 'version property' => ['version', '1.0.0']; + // Nested object properties. + yield 'require.php' => ['require.php', '^8.1']; + yield 'require.symfony/console' => ['require.symfony/console', '^6.0']; + yield 'require-dev.phpunit/phpunit' => ['require-dev.phpunit/phpunit', '^9.0']; + yield 'autoload.psr-4.Test\\' => ['autoload.psr-4.Test\\', 'src/']; + yield 'scripts.test' => ['scripts.test', 'phpunit']; + // Entire objects. + yield 'require object' => [ + 'require', ['php' => '^8.1', 'symfony/console' => '^6.0'], - ], - 'autoload.psr-4 object' => [ - 'autoload.psr-4', + ]; + yield 'autoload.psr-4 object' => [ + 'autoload.psr-4', ['Test\\' => 'src/'], - ], - - // Non-existent properties. - 'nonexistent top-level' => ['nonexistent', NULL], - 'nonexistent nested' => ['require.nonexistent', NULL], - 'nonexistent deep nested' => ['require.nested.deep', NULL], - 'empty property name' => ['', NULL], - - // Edge cases with dots. - 'property with trailing dot' => ['require.', NULL], - 'property with multiple dots' => ['require..php', NULL], ]; + // Non-existent properties. + yield 'nonexistent top-level' => ['nonexistent', NULL]; + yield 'nonexistent nested' => ['require.nonexistent', NULL]; + yield 'nonexistent deep nested' => ['require.nested.deep', NULL]; + yield 'empty property name' => ['', NULL]; + // Edge cases with dots. + yield 'property with trailing dot' => ['require.', NULL]; + yield 'property with multiple dots' => ['require..php', NULL]; } public function testGetPropertyWithInvalidJson(): void { diff --git a/.vortex/installer/tests/Unit/Logger/FileLoggerTest.php b/.vortex/installer/tests/Unit/Logger/FileLoggerTest.php index 70580dd95..11e0e5857 100644 --- a/.vortex/installer/tests/Unit/Logger/FileLoggerTest.php +++ b/.vortex/installer/tests/Unit/Logger/FileLoggerTest.php @@ -233,157 +233,147 @@ public function testBuildFilename(string $command, array $args, string $expected /** * Data provider for enable/disable tests. */ - public static function dataProviderEnableDisable(): array { - return [ - 'initially enabled' => [ - 'initial_state' => TRUE, - 'after_enable' => TRUE, - 'after_disable' => FALSE, - ], - 'initially disabled' => [ - 'initial_state' => FALSE, - 'after_enable' => TRUE, - 'after_disable' => FALSE, - ], + public static function dataProviderEnableDisable(): \Iterator { + yield 'initially enabled' => [ + 'initial_state' => TRUE, + 'after_enable' => TRUE, + 'after_disable' => FALSE, + ]; + yield 'initially disabled' => [ + 'initial_state' => FALSE, + 'after_enable' => TRUE, + 'after_disable' => FALSE, ]; } /** * Data provider for directory paths. */ - public static function dataProviderDirectoryManagement(): array { - return [ - 'default directory (cwd)' => [ - 'dir' => '', - 'test_default' => TRUE, - ], - 'absolute path' => [ - 'dir' => '/tmp/test-dir', - 'test_default' => FALSE, - ], - 'relative path' => [ - 'dir' => './test-dir', - 'test_default' => FALSE, - ], + public static function dataProviderDirectoryManagement(): \Iterator { + yield 'default directory (cwd)' => [ + 'dir' => '', + 'test_default' => TRUE, + ]; + yield 'absolute path' => [ + 'dir' => '/tmp/test-dir', + 'test_default' => FALSE, + ]; + yield 'relative path' => [ + 'dir' => './test-dir', + 'test_default' => FALSE, ]; } /** * Data provider for open scenarios. */ - public static function dataProviderOpen(): array { - return [ - 'simple command, enabled' => [ - 'command' => 'test-command', - 'args' => [], - 'enabled' => TRUE, - 'expected_pattern' => '/test-command-\d{4}-\d{2}-\d{2}-\d{6}\.log$/', - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with positional args' => [ - 'command' => 'install', - 'args' => ['project', 'arg2'], - 'enabled' => TRUE, - 'expected_pattern' => '/install-project-arg2-\d{4}-\d{2}-\d{2}-\d{6}\.log$/', - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with option args (filtered)' => [ - 'command' => 'test', - 'args' => ['positional', '--option=value', '-f'], - 'enabled' => TRUE, - 'expected_pattern' => '/test-positional-\d{4}-\d{2}-\d{2}-\d{6}\.log$/', - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with special characters' => [ - 'command' => 'test:command', - 'args' => ['arg/with/slashes', 'arg with spaces'], - 'enabled' => TRUE, - 'expected_pattern' => '/test-command-arg-with-slashes-arg-with-spaces-\d{4}-\d{2}-\d{2}-\d{6}\.log$/', - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'disabled logger' => [ - 'command' => 'test-disabled', - 'args' => [], - 'enabled' => FALSE, - 'expected_pattern' => NULL, - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], + public static function dataProviderOpen(): \Iterator { + yield 'simple command, enabled' => [ + 'command' => 'test-command', + 'args' => [], + 'enabled' => TRUE, + 'expected_pattern' => '/test-command-\d{4}-\d{2}-\d{2}-\d{6}\.log$/', + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with positional args' => [ + 'command' => 'install', + 'args' => ['project', 'arg2'], + 'enabled' => TRUE, + 'expected_pattern' => '/install-project-arg2-\d{4}-\d{2}-\d{2}-\d{6}\.log$/', + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with option args (filtered)' => [ + 'command' => 'test', + 'args' => ['positional', '--option=value', '-f'], + 'enabled' => TRUE, + 'expected_pattern' => '/test-positional-\d{4}-\d{2}-\d{2}-\d{6}\.log$/', + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with special characters' => [ + 'command' => 'test:command', + 'args' => ['arg/with/slashes', 'arg with spaces'], + 'enabled' => TRUE, + 'expected_pattern' => '/test-command-arg-with-slashes-arg-with-spaces-\d{4}-\d{2}-\d{2}-\d{6}\.log$/', + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'disabled logger' => [ + 'command' => 'test-disabled', + 'args' => [], + 'enabled' => FALSE, + 'expected_pattern' => NULL, + 'expected_exception' => NULL, + 'expected_message' => NULL, ]; } /** * Data provider for write content. */ - public static function dataProviderWrite(): array { - return [ - 'single write, logger open' => [ - 'content' => 'Test log entry', - 'is_open' => TRUE, - 'expected_writes' => 1, - ], - 'multiple writes, logger open' => [ - 'content' => 'Line of text', - 'is_open' => TRUE, - 'expected_writes' => 3, - ], - 'empty content, logger open' => [ - 'content' => '', - 'is_open' => TRUE, - 'expected_writes' => 1, - ], - 'multiline content, logger open' => [ - 'content' => "Line 1\nLine 2\nLine 3\n", - 'is_open' => TRUE, - 'expected_writes' => 1, - ], - 'write when logger not open (no-op)' => [ - 'content' => 'Should not be written', - 'is_open' => FALSE, - 'expected_writes' => 1, - ], + public static function dataProviderWrite(): \Iterator { + yield 'single write, logger open' => [ + 'content' => 'Test log entry', + 'is_open' => TRUE, + 'expected_writes' => 1, + ]; + yield 'multiple writes, logger open' => [ + 'content' => 'Line of text', + 'is_open' => TRUE, + 'expected_writes' => 3, + ]; + yield 'empty content, logger open' => [ + 'content' => '', + 'is_open' => TRUE, + 'expected_writes' => 1, + ]; + yield 'multiline content, logger open' => [ + 'content' => "Line 1\nLine 2\nLine 3\n", + 'is_open' => TRUE, + 'expected_writes' => 1, + ]; + yield 'write when logger not open (no-op)' => [ + 'content' => 'Should not be written', + 'is_open' => FALSE, + 'expected_writes' => 1, ]; } /** * Data provider for filename building. */ - public static function dataProviderBuildFilename(): array { - return [ - 'command only' => [ - 'command' => 'test-command', - 'args' => [], - 'expected' => 'test-command', - ], - 'command with positional args' => [ - 'command' => 'install', - 'args' => ['project', 'theme'], - 'expected' => 'install-project-theme', - ], - 'command with options (filtered)' => [ - 'command' => 'run', - 'args' => ['script', '--verbose', '-f', 'value'], - 'expected' => 'run-script-value', - ], - 'special characters sanitized' => [ - 'command' => 'test/command:name', - 'args' => ['arg@with#special', 'arg with spaces'], - 'expected' => 'test-command-name-arg-with-special-arg-with-spaces', - ], - 'multiple consecutive hyphens collapsed' => [ - 'command' => 'test---command', - 'args' => ['arg***value'], - 'expected' => 'test-command-arg-value', - ], - 'empty result fallback' => [ - 'command' => '---', - 'args' => ['--option', '-f'], - 'expected' => 'runner', - ], + public static function dataProviderBuildFilename(): \Iterator { + yield 'command only' => [ + 'command' => 'test-command', + 'args' => [], + 'expected' => 'test-command', + ]; + yield 'command with positional args' => [ + 'command' => 'install', + 'args' => ['project', 'theme'], + 'expected' => 'install-project-theme', + ]; + yield 'command with options (filtered)' => [ + 'command' => 'run', + 'args' => ['script', '--verbose', '-f', 'value'], + 'expected' => 'run-script-value', + ]; + yield 'special characters sanitized' => [ + 'command' => 'test/command:name', + 'args' => ['arg@with#special', 'arg with spaces'], + 'expected' => 'test-command-name-arg-with-special-arg-with-spaces', + ]; + yield 'multiple consecutive hyphens collapsed' => [ + 'command' => 'test---command', + 'args' => ['arg***value'], + 'expected' => 'test-command-arg-value', + ]; + yield 'empty result fallback' => [ + 'command' => '---', + 'args' => ['--option', '-f'], + 'expected' => 'runner', ]; } diff --git a/.vortex/installer/tests/Unit/Prompts/InstallerPresenterTest.php b/.vortex/installer/tests/Unit/Prompts/InstallerPresenterTest.php index 91867b796..dfb8b285d 100644 --- a/.vortex/installer/tests/Unit/Prompts/InstallerPresenterTest.php +++ b/.vortex/installer/tests/Unit/Prompts/InstallerPresenterTest.php @@ -65,13 +65,11 @@ public function testHeaderWithStableArtifact(bool $is_vortex_project, bool $no_i $this->assertStringContainsString('stable', $output); } - public static function dataProviderHeaderWithStableArtifact(): array { - return [ - 'new project, interactive' => [FALSE, FALSE], - 'new project, non-interactive' => [FALSE, TRUE], - 'existing project, interactive' => [TRUE, FALSE], - 'existing project, non-interactive' => [TRUE, TRUE], - ]; + public static function dataProviderHeaderWithStableArtifact(): \Iterator { + yield 'new project, interactive' => [FALSE, FALSE]; + yield 'new project, non-interactive' => [FALSE, TRUE]; + yield 'existing project, interactive' => [TRUE, FALSE]; + yield 'existing project, non-interactive' => [TRUE, TRUE]; } public function testHeaderWithDevelopmentArtifact(): void { @@ -241,23 +239,21 @@ public function testFooterBuildSkipped(string $starter, bool $expect_profile_com } } - public static function dataProviderFooterBuildSkipped(): array { - return [ - 'demo database starter' => [ - Starter::LOAD_DATABASE_DEMO, - FALSE, - FALSE, - ], - 'core profile starter' => [ - Starter::INSTALL_PROFILE_CORE, - TRUE, - TRUE, - ], - 'drupalcms profile starter' => [ - Starter::INSTALL_PROFILE_DRUPALCMS, - TRUE, - TRUE, - ], + public static function dataProviderFooterBuildSkipped(): \Iterator { + yield 'demo database starter' => [ + Starter::LOAD_DATABASE_DEMO, + FALSE, + FALSE, + ]; + yield 'core profile starter' => [ + Starter::INSTALL_PROFILE_CORE, + TRUE, + TRUE, + ]; + yield 'drupalcms profile starter' => [ + Starter::INSTALL_PROFILE_DRUPALCMS, + TRUE, + TRUE, ]; } @@ -319,12 +315,10 @@ public function testBuildResultConstants(string $constant, string $expected): vo $this->assertSame($expected, $constant); } - public static function dataProviderBuildResultConstants(): array { - return [ - 'success' => [InstallerPresenter::BUILD_RESULT_SUCCESS, 'success'], - 'skipped' => [InstallerPresenter::BUILD_RESULT_SKIPPED, 'skipped'], - 'failed' => [InstallerPresenter::BUILD_RESULT_FAILED, 'failed'], - ]; + public static function dataProviderBuildResultConstants(): \Iterator { + yield 'success' => [InstallerPresenter::BUILD_RESULT_SUCCESS, 'success']; + yield 'skipped' => [InstallerPresenter::BUILD_RESULT_SKIPPED, 'skipped']; + yield 'failed' => [InstallerPresenter::BUILD_RESULT_FAILED, 'failed']; } } diff --git a/.vortex/installer/tests/Unit/Prompts/PromptTypeTest.php b/.vortex/installer/tests/Unit/Prompts/PromptTypeTest.php index 9012d1648..76fe3db66 100644 --- a/.vortex/installer/tests/Unit/Prompts/PromptTypeTest.php +++ b/.vortex/installer/tests/Unit/Prompts/PromptTypeTest.php @@ -23,13 +23,10 @@ public function testAllCasesHavePromptFunction(PromptType $case): void { /** * Data provider for testAllCasesHavePromptFunction. */ - public static function dataProviderAllCasesHavePromptFunction(): array { - $cases = []; + public static function dataProviderAllCasesHavePromptFunction(): \Iterator { foreach (PromptType::cases() as $case) { - $cases[$case->name] = [$case]; + yield $case->name => [$case]; } - - return $cases; } #[DataProvider('dataProviderPromptFunctionMatchesCaseValue')] @@ -40,13 +37,10 @@ public function testPromptFunctionMatchesCaseValue(PromptType $case): void { /** * Data provider for testPromptFunctionMatchesCaseValue. */ - public static function dataProviderPromptFunctionMatchesCaseValue(): array { - $cases = []; + public static function dataProviderPromptFunctionMatchesCaseValue(): \Iterator { foreach (PromptType::cases() as $case) { - $cases[$case->name] = [$case]; + yield $case->name => [$case]; } - - return $cases; } #[DataProvider('dataProviderFromValidString')] @@ -57,20 +51,18 @@ public function testFromValidString(string $value, PromptType $expected): void { /** * Data provider for testFromValidString. */ - public static function dataProviderFromValidString(): array { - return [ - 'text' => ['text', PromptType::Text], - 'select' => ['select', PromptType::Select], - 'multiselect' => ['multiselect', PromptType::MultiSelect], - 'confirm' => ['confirm', PromptType::Confirm], - 'suggest' => ['suggest', PromptType::Suggest], - 'number' => ['number', PromptType::Number], - 'textarea' => ['textarea', PromptType::Textarea], - 'password' => ['password', PromptType::Password], - 'search' => ['search', PromptType::Search], - 'multisearch' => ['multisearch', PromptType::MultiSearch], - 'pause' => ['pause', PromptType::Pause], - ]; + public static function dataProviderFromValidString(): \Iterator { + yield 'text' => ['text', PromptType::Text]; + yield 'select' => ['select', PromptType::Select]; + yield 'multiselect' => ['multiselect', PromptType::MultiSelect]; + yield 'confirm' => ['confirm', PromptType::Confirm]; + yield 'suggest' => ['suggest', PromptType::Suggest]; + yield 'number' => ['number', PromptType::Number]; + yield 'textarea' => ['textarea', PromptType::Textarea]; + yield 'password' => ['password', PromptType::Password]; + yield 'search' => ['search', PromptType::Search]; + yield 'multisearch' => ['multisearch', PromptType::MultiSearch]; + yield 'pause' => ['pause', PromptType::Pause]; } public function testFromInvalidString(): void { diff --git a/.vortex/installer/tests/Unit/Runner/AbstractRunnerTest.php b/.vortex/installer/tests/Unit/Runner/AbstractRunnerTest.php index adee302a1..e1b522a59 100644 --- a/.vortex/installer/tests/Unit/Runner/AbstractRunnerTest.php +++ b/.vortex/installer/tests/Unit/Runner/AbstractRunnerTest.php @@ -173,194 +173,192 @@ public function testParseCommand(string $command, array $expected, ?string $expe /** * Data provider for parseCommand. */ - public static function dataProviderParseCommand(): array { - return [ - 'simple command' => [ - 'command' => 'echo', - 'expected' => ['echo'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with arguments' => [ - 'command' => 'echo hello world', - 'expected' => ['echo', 'hello', 'world'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with single-quoted argument' => [ - 'command' => "echo 'hello world'", - 'expected' => ['echo', 'hello world'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with double-quoted argument' => [ - 'command' => 'echo "hello world"', - 'expected' => ['echo', 'hello world'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with escaped character' => [ - 'command' => 'echo hello\\ world', - 'expected' => ['echo', 'hello world'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with escaped quote inside single quotes' => [ - 'command' => "echo 'It\\'s working'", - 'expected' => ['echo', "It's working"], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with mixed quotes' => [ - 'command' => 'echo "hello" \'world\'', - 'expected' => ['echo', 'hello', 'world'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with end-of-options marker' => [ - 'command' => 'echo -- --not-an-option', - 'expected' => ['echo', '--', '--not-an-option'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with single short option' => [ - 'command' => 'ls -l', - 'expected' => ['ls', '-l'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with multiple short options' => [ - 'command' => 'ls -la', - 'expected' => ['ls', '-la'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with separate short options' => [ - 'command' => 'ls -l -a -h', - 'expected' => ['ls', '-l', '-a', '-h'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with long option' => [ - 'command' => 'ls --all', - 'expected' => ['ls', '--all'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with long option with equals value' => [ - 'command' => 'composer require --dev=phpunit', - 'expected' => ['composer', 'require', '--dev=phpunit'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with long option with space-separated value' => [ - 'command' => 'git commit -m "commit message"', - 'expected' => ['git', 'commit', '-m', 'commit message'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with option value with equals' => [ - 'command' => 'command --option=value', - 'expected' => ['command', '--option=value'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with option value with spaces' => [ - 'command' => 'command --option="value with spaces"', - 'expected' => ['command', '--option=value with spaces'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with mixed options and arguments' => [ - 'command' => 'ls -la /path/to/dir', - 'expected' => ['ls', '-la', '/path/to/dir'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with options and quoted arguments' => [ - 'command' => 'grep -r "search term" /path/to/dir', - 'expected' => ['grep', '-r', 'search term', '/path/to/dir'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'complex command with multiple options and arguments' => [ - 'command' => 'docker run -it --rm --name=mycontainer -v /host:/container ubuntu:latest bash', - 'expected' => ['docker', 'run', '-it', '--rm', '--name=mycontainer', '-v', '/host:/container', 'ubuntu:latest', 'bash'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with option containing special characters' => [ - 'command' => 'curl -H "Authorization: Bearer token123"', - 'expected' => ['curl', '-H', 'Authorization: Bearer token123'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with multiple long options with values' => [ - 'command' => 'command --option1=value1 --option2=value2 --flag', - 'expected' => ['command', '--option1=value1', '--option2=value2', '--flag'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with mixed short and long options' => [ - 'command' => 'command -a -b --long-option --another=value arg1 arg2', - 'expected' => ['command', '-a', '-b', '--long-option', '--another=value', 'arg1', 'arg2'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with options before and after arguments' => [ - 'command' => 'find /path -name "*.txt" -type f', - 'expected' => ['find', '/path', '-name', '*.txt', '-type', 'f'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with option value containing equals sign' => [ - 'command' => 'command --url="http://example.com?param=value"', - 'expected' => ['command', '--url=http://example.com?param=value'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with negative number argument' => [ - 'command' => 'command -n -42', - 'expected' => ['command', '-n', '-42'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with option and empty string value' => [ - 'command' => 'command --option=""', - 'expected' => ['command', '--option='], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'empty command' => [ - 'command' => '', - 'expected' => [], - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Command cannot be empty.', - ], - 'whitespace only command' => [ - 'command' => ' ', - 'expected' => [], - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Command cannot be empty.', - ], - 'unclosed single quote' => [ - 'command' => "echo 'unclosed", - 'expected' => [], - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Unclosed quote in command string.', - ], - 'unclosed double quote' => [ - 'command' => 'echo "unclosed', - 'expected' => [], - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Unclosed quote in command string.', - ], - 'trailing escape' => [ - 'command' => 'echo trailing\\', - 'expected' => [], - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Trailing escape character in command string.', - ], + public static function dataProviderParseCommand(): \Iterator { + yield 'simple command' => [ + 'command' => 'echo', + 'expected' => ['echo'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with arguments' => [ + 'command' => 'echo hello world', + 'expected' => ['echo', 'hello', 'world'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with single-quoted argument' => [ + 'command' => "echo 'hello world'", + 'expected' => ['echo', 'hello world'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with double-quoted argument' => [ + 'command' => 'echo "hello world"', + 'expected' => ['echo', 'hello world'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with escaped character' => [ + 'command' => 'echo hello\\ world', + 'expected' => ['echo', 'hello world'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with escaped quote inside single quotes' => [ + 'command' => "echo 'It\\'s working'", + 'expected' => ['echo', "It's working"], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with mixed quotes' => [ + 'command' => 'echo "hello" \'world\'', + 'expected' => ['echo', 'hello', 'world'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with end-of-options marker' => [ + 'command' => 'echo -- --not-an-option', + 'expected' => ['echo', '--', '--not-an-option'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with single short option' => [ + 'command' => 'ls -l', + 'expected' => ['ls', '-l'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with multiple short options' => [ + 'command' => 'ls -la', + 'expected' => ['ls', '-la'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with separate short options' => [ + 'command' => 'ls -l -a -h', + 'expected' => ['ls', '-l', '-a', '-h'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with long option' => [ + 'command' => 'ls --all', + 'expected' => ['ls', '--all'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with long option with equals value' => [ + 'command' => 'composer require --dev=phpunit', + 'expected' => ['composer', 'require', '--dev=phpunit'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with long option with space-separated value' => [ + 'command' => 'git commit -m "commit message"', + 'expected' => ['git', 'commit', '-m', 'commit message'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with option value with equals' => [ + 'command' => 'command --option=value', + 'expected' => ['command', '--option=value'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with option value with spaces' => [ + 'command' => 'command --option="value with spaces"', + 'expected' => ['command', '--option=value with spaces'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with mixed options and arguments' => [ + 'command' => 'ls -la /path/to/dir', + 'expected' => ['ls', '-la', '/path/to/dir'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with options and quoted arguments' => [ + 'command' => 'grep -r "search term" /path/to/dir', + 'expected' => ['grep', '-r', 'search term', '/path/to/dir'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'complex command with multiple options and arguments' => [ + 'command' => 'docker run -it --rm --name=mycontainer -v /host:/container ubuntu:latest bash', + 'expected' => ['docker', 'run', '-it', '--rm', '--name=mycontainer', '-v', '/host:/container', 'ubuntu:latest', 'bash'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with option containing special characters' => [ + 'command' => 'curl -H "Authorization: Bearer token123"', + 'expected' => ['curl', '-H', 'Authorization: Bearer token123'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with multiple long options with values' => [ + 'command' => 'command --option1=value1 --option2=value2 --flag', + 'expected' => ['command', '--option1=value1', '--option2=value2', '--flag'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with mixed short and long options' => [ + 'command' => 'command -a -b --long-option --another=value arg1 arg2', + 'expected' => ['command', '-a', '-b', '--long-option', '--another=value', 'arg1', 'arg2'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with options before and after arguments' => [ + 'command' => 'find /path -name "*.txt" -type f', + 'expected' => ['find', '/path', '-name', '*.txt', '-type', 'f'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with option value containing equals sign' => [ + 'command' => 'command --url="http://example.com?param=value"', + 'expected' => ['command', '--url=http://example.com?param=value'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with negative number argument' => [ + 'command' => 'command -n -42', + 'expected' => ['command', '-n', '-42'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with option and empty string value' => [ + 'command' => 'command --option=""', + 'expected' => ['command', '--option='], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'empty command' => [ + 'command' => '', + 'expected' => [], + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Command cannot be empty.', + ]; + yield 'whitespace only command' => [ + 'command' => ' ', + 'expected' => [], + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Command cannot be empty.', + ]; + yield 'unclosed single quote' => [ + 'command' => "echo 'unclosed", + 'expected' => [], + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Unclosed quote in command string.', + ]; + yield 'unclosed double quote' => [ + 'command' => 'echo "unclosed', + 'expected' => [], + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Unclosed quote in command string.', + ]; + yield 'trailing escape' => [ + 'command' => 'echo trailing\\', + 'expected' => [], + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Trailing escape character in command string.', ]; } @@ -450,44 +448,42 @@ public function testGetOutputVariations(string $output, bool $as_array, ?int $li /** * Data provider for getOutput variations. */ - public static function dataProviderGetOutputVariations(): array { - return [ - 'string output, as_array=false, no limit' => [ - 'output' => "Line 1\nLine 2\nLine 3", - 'as_array' => FALSE, - 'lines' => NULL, - 'expected' => "Line 1\nLine 2\nLine 3", - ], - 'string output, as_array=true, no limit' => [ - 'output' => "Line 1\nLine 2\nLine 3", - 'as_array' => TRUE, - 'lines' => NULL, - 'expected' => ['Line 1', 'Line 2', 'Line 3'], - ], - 'string output, as_array=false, limit=2' => [ - 'output' => "Line 1\nLine 2\nLine 3", - 'as_array' => FALSE, - 'lines' => 2, - 'expected' => "Line 1\nLine 2", - ], - 'string output, as_array=true, limit=2' => [ - 'output' => "Line 1\nLine 2\nLine 3", - 'as_array' => TRUE, - 'lines' => 2, - 'expected' => ['Line 1', 'Line 2'], - ], - 'empty output, as_array=false' => [ - 'output' => '', - 'as_array' => FALSE, - 'lines' => NULL, - 'expected' => '', - ], - 'empty output, as_array=true' => [ - 'output' => '', - 'as_array' => TRUE, - 'lines' => NULL, - 'expected' => [''], - ], + public static function dataProviderGetOutputVariations(): \Iterator { + yield 'string output, as_array=false, no limit' => [ + 'output' => "Line 1\nLine 2\nLine 3", + 'as_array' => FALSE, + 'lines' => NULL, + 'expected' => "Line 1\nLine 2\nLine 3", + ]; + yield 'string output, as_array=true, no limit' => [ + 'output' => "Line 1\nLine 2\nLine 3", + 'as_array' => TRUE, + 'lines' => NULL, + 'expected' => ['Line 1', 'Line 2', 'Line 3'], + ]; + yield 'string output, as_array=false, limit=2' => [ + 'output' => "Line 1\nLine 2\nLine 3", + 'as_array' => FALSE, + 'lines' => 2, + 'expected' => "Line 1\nLine 2", + ]; + yield 'string output, as_array=true, limit=2' => [ + 'output' => "Line 1\nLine 2\nLine 3", + 'as_array' => TRUE, + 'lines' => 2, + 'expected' => ['Line 1', 'Line 2'], + ]; + yield 'empty output, as_array=false' => [ + 'output' => '', + 'as_array' => FALSE, + 'lines' => NULL, + 'expected' => '', + ]; + yield 'empty output, as_array=true' => [ + 'output' => '', + 'as_array' => TRUE, + 'lines' => NULL, + 'expected' => [''], ]; } @@ -506,44 +502,42 @@ public function testBuildCommandString(string $command, array $args, array $opts /** * Data provider for buildCommandString. */ - public static function dataProviderBuildCommandString(): array { - return [ - 'command only' => [ - 'command' => 'echo', - 'args' => [], - 'opts' => [], - 'expected' => 'echo', - ], - 'command with positional args' => [ - 'command' => 'echo', - 'args' => ['hello', 'world'], - 'opts' => [], - 'expected' => 'echo hello world', - ], - 'command with named options' => [ - 'command' => 'echo', - 'args' => [], - 'opts' => ['--verbose' => TRUE, '--format' => 'json'], - 'expected' => 'echo --verbose --format=json', - ], - 'command with mixed args and options' => [ - 'command' => 'echo', - 'args' => ['hello'], - 'opts' => ['--verbose' => TRUE], - 'expected' => 'echo hello --verbose', - ], - 'argument with spaces requires quoting' => [ - 'command' => 'echo', - 'args' => ['hello world'], - 'opts' => [], - 'expected' => "echo 'hello world'", - ], - 'empty string argument' => [ - 'command' => 'echo', - 'args' => [''], - 'opts' => [], - 'expected' => "echo ''", - ], + public static function dataProviderBuildCommandString(): \Iterator { + yield 'command only' => [ + 'command' => 'echo', + 'args' => [], + 'opts' => [], + 'expected' => 'echo', + ]; + yield 'command with positional args' => [ + 'command' => 'echo', + 'args' => ['hello', 'world'], + 'opts' => [], + 'expected' => 'echo hello world', + ]; + yield 'command with named options' => [ + 'command' => 'echo', + 'args' => [], + 'opts' => ['--verbose' => TRUE, '--format' => 'json'], + 'expected' => 'echo --verbose --format=json', + ]; + yield 'command with mixed args and options' => [ + 'command' => 'echo', + 'args' => ['hello'], + 'opts' => ['--verbose' => TRUE], + 'expected' => 'echo hello --verbose', + ]; + yield 'argument with spaces requires quoting' => [ + 'command' => 'echo', + 'args' => ['hello world'], + 'opts' => [], + 'expected' => "echo 'hello world'", + ]; + yield 'empty string argument' => [ + 'command' => 'echo', + 'args' => [''], + 'opts' => [], + 'expected' => "echo ''", ]; } @@ -562,36 +556,34 @@ public function testQuoteArgument(string $argument, string $expected): void { /** * Data provider for quoteArgument. */ - public static function dataProviderQuoteArgument(): array { - return [ - 'simple string (no quoting)' => [ - 'argument' => 'hello', - 'expected' => 'hello', - ], - 'string with spaces' => [ - 'argument' => 'hello world', - 'expected' => "'hello world'", - ], - 'string with single quote' => [ - 'argument' => "It's working", - 'expected' => "'It'\\''s working'", - ], - 'string with double quote' => [ - 'argument' => 'Say "hello"', - 'expected' => "'Say \"hello\"'", - ], - 'string with shell special chars' => [ - 'argument' => 'test$variable', - 'expected' => "'test\$variable'", - ], - 'empty string' => [ - 'argument' => '', - 'expected' => "''", - ], - 'string with backslash' => [ - 'argument' => 'path\\to\\file', - 'expected' => "'path\\to\\file'", - ], + public static function dataProviderQuoteArgument(): \Iterator { + yield 'simple string (no quoting)' => [ + 'argument' => 'hello', + 'expected' => 'hello', + ]; + yield 'string with spaces' => [ + 'argument' => 'hello world', + 'expected' => "'hello world'", + ]; + yield 'string with single quote' => [ + 'argument' => "It's working", + 'expected' => "'It'\\''s working'", + ]; + yield 'string with double quote' => [ + 'argument' => 'Say "hello"', + 'expected' => "'Say \"hello\"'", + ]; + yield 'string with shell special chars' => [ + 'argument' => 'test$variable', + 'expected' => "'test\$variable'", + ]; + yield 'empty string' => [ + 'argument' => '', + 'expected' => "''", + ]; + yield 'string with backslash' => [ + 'argument' => 'path\\to\\file', + 'expected' => "'path\\to\\file'", ]; } @@ -610,36 +602,34 @@ public function testFormatArgs(array $args, array $expected): void { /** * Data provider for formatArgs. */ - public static function dataProviderFormatArgs(): array { - return [ - 'positional args' => [ - 'args' => ['arg1', 'arg2'], - 'expected' => ['arg1', 'arg2'], - ], - 'named args with string values' => [ - 'args' => ['--option' => 'value', '--flag' => 'enabled'], - 'expected' => ['--option=value', '--flag=enabled'], - ], - 'named args with bool TRUE' => [ - 'args' => ['--verbose' => TRUE], - 'expected' => ['--verbose'], - ], - 'named args with bool FALSE (excluded)' => [ - 'args' => ['--verbose' => FALSE], - 'expected' => [], - ], - 'positional args with bool TRUE' => [ - 'args' => [TRUE], - 'expected' => ['1'], - ], - 'positional args with bool FALSE (excluded)' => [ - 'args' => [FALSE], - 'expected' => [], - ], - 'mixed positional and named' => [ - 'args' => ['pos1', '--opt' => 'val', 'pos2'], - 'expected' => ['pos1', '--opt=val', 'pos2'], - ], + public static function dataProviderFormatArgs(): \Iterator { + yield 'positional args' => [ + 'args' => ['arg1', 'arg2'], + 'expected' => ['arg1', 'arg2'], + ]; + yield 'named args with string values' => [ + 'args' => ['--option' => 'value', '--flag' => 'enabled'], + 'expected' => ['--option=value', '--flag=enabled'], + ]; + yield 'named args with bool TRUE' => [ + 'args' => ['--verbose' => TRUE], + 'expected' => ['--verbose'], + ]; + yield 'named args with bool FALSE (excluded)' => [ + 'args' => ['--verbose' => FALSE], + 'expected' => [], + ]; + yield 'positional args with bool TRUE' => [ + 'args' => [TRUE], + 'expected' => ['1'], + ]; + yield 'positional args with bool FALSE (excluded)' => [ + 'args' => [FALSE], + 'expected' => [], + ]; + yield 'mixed positional and named' => [ + 'args' => ['pos1', '--opt' => 'val', 'pos2'], + 'expected' => ['pos1', '--opt=val', 'pos2'], ]; } diff --git a/.vortex/installer/tests/Unit/Runner/CommandRunnerTest.php b/.vortex/installer/tests/Unit/Runner/CommandRunnerTest.php index d6dc0def7..75eb6754d 100644 --- a/.vortex/installer/tests/Unit/Runner/CommandRunnerTest.php +++ b/.vortex/installer/tests/Unit/Runner/CommandRunnerTest.php @@ -196,16 +196,14 @@ public function testRunCapturesExitCode(): void { /** * Data provider for streaming modes. */ - public static function dataProviderRunWithStreaming(): array { - return [ - 'streaming enabled' => [ - 'streaming_enabled' => TRUE, - 'should_have_output' => TRUE, - ], - 'streaming disabled' => [ - 'streaming_enabled' => FALSE, - 'should_have_output' => FALSE, - ], + public static function dataProviderRunWithStreaming(): \Iterator { + yield 'streaming enabled' => [ + 'streaming_enabled' => TRUE, + 'should_have_output' => TRUE, + ]; + yield 'streaming disabled' => [ + 'streaming_enabled' => FALSE, + 'should_have_output' => FALSE, ]; } diff --git a/.vortex/installer/tests/Unit/Runner/ProcessRunnerTest.php b/.vortex/installer/tests/Unit/Runner/ProcessRunnerTest.php index 64e501ffe..d69f45876 100644 --- a/.vortex/installer/tests/Unit/Runner/ProcessRunnerTest.php +++ b/.vortex/installer/tests/Unit/Runner/ProcessRunnerTest.php @@ -224,161 +224,151 @@ public function testPrepareArgumentsWithNonScalarAfterFormatting(): void { /** * Data provider for run command tests. */ - public static function dataProviderRun(): array { - return [ - 'simple echo command' => [ - 'command' => 'echo', - 'args' => ['hello', 'world'], - 'expected_output_pattern' => '/hello world/', - 'expected_exit_code' => 0, - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with single argument' => [ - 'command' => 'echo "test message"', - 'args' => [], - 'expected_output_pattern' => '/test message/', - 'expected_exit_code' => 0, - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command not found' => [ - 'command' => 'nonexistent_command_12345', - 'args' => [], - 'expected_output_pattern' => '//', - 'expected_exit_code' => 0, - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Command not found', - ], - 'command with invalid characters' => [ - 'command' => '$invalid-cmd', - 'args' => [], - 'expected_output_pattern' => '//', - 'expected_exit_code' => 0, - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Invalid command', - ], - 'command utility is not allowed' => [ - 'command' => 'command', - 'args' => ['-v', 'ls'], - 'expected_output_pattern' => '//', - 'expected_exit_code' => 0, - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Using the "command" utility is not allowed. Use Symfony\Component\Process\ExecutableFinder', - ], + public static function dataProviderRun(): \Iterator { + yield 'simple echo command' => [ + 'command' => 'echo', + 'args' => ['hello', 'world'], + 'expected_output_pattern' => '/hello world/', + 'expected_exit_code' => 0, + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with single argument' => [ + 'command' => 'echo "test message"', + 'args' => [], + 'expected_output_pattern' => '/test message/', + 'expected_exit_code' => 0, + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command not found' => [ + 'command' => 'nonexistent_command_12345', + 'args' => [], + 'expected_output_pattern' => '//', + 'expected_exit_code' => 0, + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Command not found', + ]; + yield 'command with invalid characters' => [ + 'command' => '$invalid-cmd', + 'args' => [], + 'expected_output_pattern' => '//', + 'expected_exit_code' => 0, + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Invalid command', + ]; + yield 'command utility is not allowed' => [ + 'command' => 'command', + 'args' => ['-v', 'ls'], + 'expected_output_pattern' => '//', + 'expected_exit_code' => 0, + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Using the "command" utility is not allowed. Use Symfony\Component\Process\ExecutableFinder', ]; } /** * Data provider for streaming modes. */ - public static function dataProviderRunWithStreaming(): array { - return [ - 'streaming enabled' => [ - 'streaming_enabled' => TRUE, - 'should_have_output_in_stream' => TRUE, - ], - 'streaming disabled' => [ - 'streaming_enabled' => FALSE, - 'should_have_output_in_stream' => FALSE, - ], + public static function dataProviderRunWithStreaming(): \Iterator { + yield 'streaming enabled' => [ + 'streaming_enabled' => TRUE, + 'should_have_output_in_stream' => TRUE, + ]; + yield 'streaming disabled' => [ + 'streaming_enabled' => FALSE, + 'should_have_output_in_stream' => FALSE, ]; } /** * Data provider for resolveCommand tests. */ - public static function dataProviderResolveCommand(): array { - return [ - 'simple command (echo)' => [ - 'command' => 'echo', - 'expect_success' => TRUE, - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command with arguments' => [ - 'command' => 'echo hello', - 'expect_success' => TRUE, - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'command not in PATH' => [ - 'command' => 'nonexistent_cmd_xyz', - 'expect_success' => FALSE, - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Command not found', - ], - 'command with invalid characters' => [ - 'command' => 'echo$test', - 'expect_success' => FALSE, - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Invalid command', - ], - 'command utility is not allowed' => [ - 'command' => 'command', - 'expect_success' => FALSE, - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Using the "command" utility is not allowed. Use Symfony\Component\Process\ExecutableFinder to check if a command exists instead.', - ], + public static function dataProviderResolveCommand(): \Iterator { + yield 'simple command (echo)' => [ + 'command' => 'echo', + 'expect_success' => TRUE, + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command with arguments' => [ + 'command' => 'echo hello', + 'expect_success' => TRUE, + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'command not in PATH' => [ + 'command' => 'nonexistent_cmd_xyz', + 'expect_success' => FALSE, + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Command not found', + ]; + yield 'command with invalid characters' => [ + 'command' => 'echo$test', + 'expect_success' => FALSE, + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Invalid command', + ]; + yield 'command utility is not allowed' => [ + 'command' => 'command', + 'expect_success' => FALSE, + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Using the "command" utility is not allowed. Use Symfony\Component\Process\ExecutableFinder to check if a command exists instead.', ]; } /** * Data provider for prepareArguments tests. */ - public static function dataProviderPrepareArguments(): array { - return [ - 'merge parsed and additional args' => [ - 'parsed_args' => ['arg1', 'arg2'], - 'additional_args' => ['arg3', 'arg4'], - 'expected' => ['arg1', 'arg2', 'arg3', 'arg4'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'convert numeric args to strings' => [ - 'parsed_args' => ['test'], - 'additional_args' => [123, 456], - 'expected' => ['test', '123', '456'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'boolean arguments' => [ - 'parsed_args' => [], - 'additional_args' => ['--verbose' => TRUE, '--quiet' => FALSE], - 'expected' => ['--verbose'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'non-scalar argument throws exception' => [ - 'parsed_args' => ['arg1', ['array']], - 'additional_args' => [], - 'expected' => [], - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Argument at index "1" must be a scalar value, array given.', - ], + public static function dataProviderPrepareArguments(): \Iterator { + yield 'merge parsed and additional args' => [ + 'parsed_args' => ['arg1', 'arg2'], + 'additional_args' => ['arg3', 'arg4'], + 'expected' => ['arg1', 'arg2', 'arg3', 'arg4'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'convert numeric args to strings' => [ + 'parsed_args' => ['test'], + 'additional_args' => [123, 456], + 'expected' => ['test', '123', '456'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'boolean arguments' => [ + 'parsed_args' => [], + 'additional_args' => ['--verbose' => TRUE, '--quiet' => FALSE], + 'expected' => ['--verbose'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'non-scalar argument throws exception' => [ + 'parsed_args' => ['arg1', ['array']], + 'additional_args' => [], + 'expected' => [], + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Argument at index "1" must be a scalar value, array given.', ]; } /** * Data provider for environment variables tests. */ - public static function dataProviderValidateEnvironmentVars(): array { - return [ - 'valid scalar env vars' => [ - 'env' => ['VAR1' => 'value1', 'VAR2' => 'value2'], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'empty env vars' => [ - 'env' => [], - 'expected_exception' => NULL, - 'expected_message' => NULL, - ], - 'non-scalar env var throws exception' => [ - 'env' => ['VAR1' => ['array']], - 'expected_exception' => \InvalidArgumentException::class, - 'expected_message' => 'Environment variable "VAR1" must be a scalar value, array given.', - ], + public static function dataProviderValidateEnvironmentVars(): \Iterator { + yield 'valid scalar env vars' => [ + 'env' => ['VAR1' => 'value1', 'VAR2' => 'value2'], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'empty env vars' => [ + 'env' => [], + 'expected_exception' => NULL, + 'expected_message' => NULL, + ]; + yield 'non-scalar env var throws exception' => [ + 'env' => ['VAR1' => ['array']], + 'expected_exception' => \InvalidArgumentException::class, + 'expected_message' => 'Environment variable "VAR1" must be a scalar value, array given.', ]; } diff --git a/.vortex/installer/tests/Unit/Schema/AgentHelpTest.php b/.vortex/installer/tests/Unit/Schema/AgentHelpTest.php index 1e0ce1533..9459085dc 100644 --- a/.vortex/installer/tests/Unit/Schema/AgentHelpTest.php +++ b/.vortex/installer/tests/Unit/Schema/AgentHelpTest.php @@ -28,17 +28,15 @@ public function testRenderContainsSections(string $section): void { $this->assertStringContainsString($section, $result); } - public static function dataProviderRenderContainsSections(): array { - return [ - 'title' => ['# Vortex Installer - AI Agent Instructions'], - 'workflow section' => ['## Workflow'], - 'commands section' => ['## Commands'], - 'schema format section' => ['## Schema Format'], - 'value types section' => ['## Value Types by Prompt Type'], - 'dependencies section' => ['## Dependencies'], - 'validation output section' => ['## Validation Output'], - 'tips section' => ['## Tips'], - ]; + public static function dataProviderRenderContainsSections(): \Iterator { + yield 'title' => ['# Vortex Installer - AI Agent Instructions']; + yield 'workflow section' => ['## Workflow']; + yield 'commands section' => ['## Commands']; + yield 'schema format section' => ['## Schema Format']; + yield 'value types section' => ['## Value Types by Prompt Type']; + yield 'dependencies section' => ['## Dependencies']; + yield 'validation output section' => ['## Validation Output']; + yield 'tips section' => ['## Tips']; } #[DataProvider('dataProviderRenderContainsCommandExamples')] @@ -48,14 +46,12 @@ public function testRenderContainsCommandExamples(string $example): void { $this->assertStringContainsString($example, $result); } - public static function dataProviderRenderContainsCommandExamples(): array { - return [ - 'schema flag' => ['--schema'], - 'validate flag' => ['--validate'], - 'no-interaction flag' => ['--no-interaction'], - 'config flag' => ['--config'], - 'destination flag' => ['--destination'], - ]; + public static function dataProviderRenderContainsCommandExamples(): \Iterator { + yield 'schema flag' => ['--schema']; + yield 'validate flag' => ['--validate']; + yield 'no-interaction flag' => ['--no-interaction']; + yield 'config flag' => ['--config']; + yield 'destination flag' => ['--destination']; } #[DataProvider('dataProviderRenderContainsPromptTypes')] @@ -65,14 +61,12 @@ public function testRenderContainsPromptTypes(string $type): void { $this->assertStringContainsString('`' . $type . '`', $result); } - public static function dataProviderRenderContainsPromptTypes(): array { - return [ - 'text' => ['text'], - 'select' => ['select'], - 'multiselect' => ['multiselect'], - 'confirm' => ['confirm'], - 'suggest' => ['suggest'], - ]; + public static function dataProviderRenderContainsPromptTypes(): \Iterator { + yield 'text' => ['text']; + yield 'select' => ['select']; + yield 'multiselect' => ['multiselect']; + yield 'confirm' => ['confirm']; + yield 'suggest' => ['suggest']; } #[DataProvider('dataProviderRenderContainsSchemaFields')] @@ -82,17 +76,15 @@ public function testRenderContainsSchemaFields(string $field): void { $this->assertStringContainsString('`' . $field . '`', $result); } - public static function dataProviderRenderContainsSchemaFields(): array { - return [ - 'id field' => ['id'], - 'env field' => ['env'], - 'type field' => ['type'], - 'label field' => ['label'], - 'options field' => ['options'], - 'default field' => ['default'], - 'required field' => ['required'], - 'depends_on field' => ['depends_on'], - ]; + public static function dataProviderRenderContainsSchemaFields(): \Iterator { + yield 'id field' => ['id']; + yield 'env field' => ['env']; + yield 'type field' => ['type']; + yield 'label field' => ['label']; + yield 'options field' => ['options']; + yield 'default field' => ['default']; + yield 'required field' => ['required']; + yield 'depends_on field' => ['depends_on']; } #[DataProvider('dataProviderRenderContainsValidationFields')] @@ -102,13 +94,11 @@ public function testRenderContainsValidationFields(string $field): void { $this->assertStringContainsString('`' . $field . '`', $result); } - public static function dataProviderRenderContainsValidationFields(): array { - return [ - 'valid' => ['valid'], - 'errors' => ['errors'], - 'warnings' => ['warnings'], - 'resolved' => ['resolved'], - ]; + public static function dataProviderRenderContainsValidationFields(): \Iterator { + yield 'valid' => ['valid']; + yield 'errors' => ['errors']; + yield 'warnings' => ['warnings']; + yield 'resolved' => ['resolved']; } public function testRenderIsIdempotent(): void { diff --git a/.vortex/installer/tests/Unit/Schema/SchemaGeneratorTest.php b/.vortex/installer/tests/Unit/Schema/SchemaGeneratorTest.php index 7b71a24aa..fe4608d6b 100644 --- a/.vortex/installer/tests/Unit/Schema/SchemaGeneratorTest.php +++ b/.vortex/installer/tests/Unit/Schema/SchemaGeneratorTest.php @@ -86,15 +86,13 @@ public function testPromptTypes(string $handler_id, string $expected_type): void /** * Data provider for testPromptTypes. */ - public static function dataProviderPromptTypes(): array { - return [ - 'name' => [Name::id(), 'text'], - 'hosting_provider' => [HostingProvider::id(), 'select'], - 'ci_provider' => [CiProvider::id(), 'select'], - 'migration' => [Migration::id(), 'confirm'], - 'database_image' => [DatabaseImage::id(), 'text'], - 'ai_code_instructions' => [AiCodeInstructions::id(), 'confirm'], - ]; + public static function dataProviderPromptTypes(): \Iterator { + yield 'name' => [Name::id(), 'text']; + yield 'hosting_provider' => [HostingProvider::id(), 'select']; + yield 'ci_provider' => [CiProvider::id(), 'select']; + yield 'migration' => [Migration::id(), 'confirm']; + yield 'database_image' => [DatabaseImage::id(), 'text']; + yield 'ai_code_instructions' => [AiCodeInstructions::id(), 'confirm']; } public function testOptionsFormat(): void { @@ -127,15 +125,13 @@ public function testDependsOnFormat(string $handler_id): void { /** * Data provider for testDependsOnFormat. */ - public static function dataProviderDependsOnFormat(): array { - return [ - 'hosting_project_name' => [HostingProjectName::id()], - 'profile_custom' => [ProfileCustom::id()], - 'theme_custom' => [ThemeCustom::id()], - 'database_download_source' => [DatabaseDownloadSource::id()], - 'database_image' => [DatabaseImage::id()], - 'migration_download_source' => [MigrationDownloadSource::id()], - ]; + public static function dataProviderDependsOnFormat(): \Iterator { + yield 'hosting_project_name' => [HostingProjectName::id()]; + yield 'profile_custom' => [ProfileCustom::id()]; + yield 'theme_custom' => [ThemeCustom::id()]; + yield 'database_download_source' => [DatabaseDownloadSource::id()]; + yield 'database_image' => [DatabaseImage::id()]; + yield 'migration_download_source' => [MigrationDownloadSource::id()]; } public function testUtilityHandlersExcluded(): void { diff --git a/.vortex/installer/tests/Unit/StringsTest.php b/.vortex/installer/tests/Unit/StringsTest.php index 5579ce2b6..0ca9d0ef9 100644 --- a/.vortex/installer/tests/Unit/StringsTest.php +++ b/.vortex/installer/tests/Unit/StringsTest.php @@ -19,15 +19,13 @@ public function testIsAsciiStart(string $input, bool $expected): void { $this->assertEquals($expected, Strings::isAsciiStart($input)); } - public static function dataProviderIsAsciiStart(): array { - return [ - ['Hello', TRUE], - ['Ångström', FALSE], - ['⚙️', FALSE], - ['⚙️ Text', FALSE], - ["\x80Invalid UTF", FALSE], - ['', FALSE], - ]; + public static function dataProviderIsAsciiStart(): \Iterator { + yield ['Hello', TRUE]; + yield ['Ångström', FALSE]; + yield ['⚙️', FALSE]; + yield ['⚙️ Text', FALSE]; + yield ["\x80Invalid UTF", FALSE]; + yield ['', FALSE]; } #[DataProvider('dataProviderStrlenPlain')] @@ -35,14 +33,12 @@ public function testStrlenPlain(string $input, int $expected): void { $this->assertEquals($expected, Strings::strlenPlain($input)); } - public static function dataProviderStrlenPlain(): array { - return [ - ['Hello', 5], - ["\e[31mRedText\e[0m", 7], - ['NoEscapeCodes', 13], - ['', 0], - ['Vortex 🚀🚀🚀', 13], - ]; + public static function dataProviderStrlenPlain(): \Iterator { + yield ['Hello', 5]; + yield ["\e[31mRedText\e[0m", 7]; + yield ['NoEscapeCodes', 13]; + yield ['', 0]; + yield ['Vortex 🚀🚀🚀', 13]; } #[DataProvider('dataProviderStripAnsiColors')] @@ -51,152 +47,122 @@ public function testStripAnsiColors(string $input, string $expected): void { $this->assertEquals($expected, $actual); } - public static function dataProviderStripAnsiColors(): array { - return [ - 'empty string' => [ - '', - '', - ], - - 'plain text without ANSI codes' => [ - 'Hello World', - 'Hello World', - ], - - 'text with basic color codes' => [ - "\033[32mGreen text\033[0m", - 'Green text', - ], - - 'text with multiple color codes' => [ - "\033[31mRed\033[0m and \033[34mBlue\033[0m", - 'Red and Blue', - ], - - 'text with style codes' => [ - "\033[1mBold\033[0m and \033[4mUnderlined\033[0m", - 'Bold and Underlined', - ], - - 'text with background colors' => [ - "\033[41mRed background\033[0m", - 'Red background', - ], - - 'text with 256-color codes' => [ - "\033[38;5;196mBright red\033[0m", - 'Bright red', - ], - - 'text with RGB color codes' => [ - "\033[38;2;255;0;0mRGB red\033[0m", - 'RGB red', - ], - - 'text with complex ANSI sequences' => [ - "\033[1;31;40mBold red on black\033[0m", - 'Bold red on black', - ], - - 'multiline text with ANSI codes' => [ - "\033[32mLine 1\033[0m\n\033[34mLine 2\033[0m", - "Line 1\nLine 2", - ], - - 'ANSI codes at start and end' => [ - "\033[33mYellow text\033[0m", - 'Yellow text', - ], - - 'consecutive ANSI codes' => [ - "\033[31m\033[1mBold Red\033[0m\033[0m", - 'Bold Red', - ], - - 'ANSI codes without content between' => [ - "\033[32m\033[0m", - '', - ], - - 'mixed ANSI and special characters' => [ - "\033[35mSpecial: áéíóú ñ €\033[0m", - 'Special: áéíóú ñ €', - ], - - 'cursor movement codes (should not be affected)' => [ - "\033[2AUp two lines\033[B", - "\033[2AUp two lines\033[B", - ], - - 'clear screen codes (should not be affected)' => [ - "\033[2JClear screen", - "\033[2JClear screen", - ], - - 'save/restore cursor (should not be affected)' => [ - "\033[sSave\033[uRestore", - "\033[sSave\033[uRestore", - ], - - 'complex terminal output simulation' => [ - "\033[1;32m[INFO]\033[0m \033[33mProcessing file:\033[0m example.txt", - '[INFO] Processing file: example.txt', - ], - - 'git-like colored output' => [ - "\033[32m+\033[0m Added line\n\033[31m-\033[0m Removed line", - "+ Added line\n- Removed line", - ], - - 'only ANSI codes' => [ - "\033[31m\033[1m\033[0m", - '', - ], - - 'partial ANSI sequences (should not be affected)' => [ - 'Text with \\033[31m escaped sequence', - 'Text with \\033[31m escaped sequence', - ], - - 'ANSI codes with different parameter counts' => [ - "\033[0mReset\033[1mBold\033[22mNormal\033[39mDefault", - 'ResetBoldNormalDefault', - ], - - 'dim and bright codes' => [ - "\033[2mDim text\033[22m\033[1mBright text\033[0m", - 'Dim textBright text', - ], - - 'strikethrough and other styles' => [ - "\033[9mStrikethrough\033[29m \033[3mItalic\033[23m", - 'Strikethrough Italic', - ], - - 'extended color codes with semicolons' => [ - "\033[38;5;208mOrange\033[48;5;19mBlue BG\033[0m", - 'OrangeBlue BG', - ], - - 'codes with no parameters' => [ - "\033[mDefault\033[m", - 'Default', - ], - - 'real-world example: colored log output' => [ - "\033[90m2023-01-01 12:00:00\033[0m \033[32mINFO\033[0m Application started", - '2023-01-01 12:00:00 INFO Application started', - ], - - 'real-world example: progress indicator' => [ - "Processing... \033[32m✓\033[0m Done", - 'Processing... ✓ Done', - ], - - 'mixed with escape sequences that should remain' => [ - "Normal text\n\ttab and newline\033[31mRed\033[0m", - "Normal text\n\ttab and newlineRed", - ], + public static function dataProviderStripAnsiColors(): \Iterator { + yield 'empty string' => [ + '', + '', + ]; + yield 'plain text without ANSI codes' => [ + 'Hello World', + 'Hello World', + ]; + yield 'text with basic color codes' => [ + "\033[32mGreen text\033[0m", + 'Green text', + ]; + yield 'text with multiple color codes' => [ + "\033[31mRed\033[0m and \033[34mBlue\033[0m", + 'Red and Blue', + ]; + yield 'text with style codes' => [ + "\033[1mBold\033[0m and \033[4mUnderlined\033[0m", + 'Bold and Underlined', + ]; + yield 'text with background colors' => [ + "\033[41mRed background\033[0m", + 'Red background', + ]; + yield 'text with 256-color codes' => [ + "\033[38;5;196mBright red\033[0m", + 'Bright red', + ]; + yield 'text with RGB color codes' => [ + "\033[38;2;255;0;0mRGB red\033[0m", + 'RGB red', + ]; + yield 'text with complex ANSI sequences' => [ + "\033[1;31;40mBold red on black\033[0m", + 'Bold red on black', + ]; + yield 'multiline text with ANSI codes' => [ + "\033[32mLine 1\033[0m\n\033[34mLine 2\033[0m", + "Line 1\nLine 2", + ]; + yield 'ANSI codes at start and end' => [ + "\033[33mYellow text\033[0m", + 'Yellow text', + ]; + yield 'consecutive ANSI codes' => [ + "\033[31m\033[1mBold Red\033[0m\033[0m", + 'Bold Red', + ]; + yield 'ANSI codes without content between' => [ + "\033[32m\033[0m", + '', + ]; + yield 'mixed ANSI and special characters' => [ + "\033[35mSpecial: áéíóú ñ €\033[0m", + 'Special: áéíóú ñ €', + ]; + yield 'cursor movement codes (should not be affected)' => [ + "\033[2AUp two lines\033[B", + "\033[2AUp two lines\033[B", + ]; + yield 'clear screen codes (should not be affected)' => [ + "\033[2JClear screen", + "\033[2JClear screen", + ]; + yield 'save/restore cursor (should not be affected)' => [ + "\033[sSave\033[uRestore", + "\033[sSave\033[uRestore", + ]; + yield 'complex terminal output simulation' => [ + "\033[1;32m[INFO]\033[0m \033[33mProcessing file:\033[0m example.txt", + '[INFO] Processing file: example.txt', + ]; + yield 'git-like colored output' => [ + "\033[32m+\033[0m Added line\n\033[31m-\033[0m Removed line", + "+ Added line\n- Removed line", + ]; + yield 'only ANSI codes' => [ + "\033[31m\033[1m\033[0m", + '', + ]; + yield 'partial ANSI sequences (should not be affected)' => [ + 'Text with \\033[31m escaped sequence', + 'Text with \\033[31m escaped sequence', + ]; + yield 'ANSI codes with different parameter counts' => [ + "\033[0mReset\033[1mBold\033[22mNormal\033[39mDefault", + 'ResetBoldNormalDefault', + ]; + yield 'dim and bright codes' => [ + "\033[2mDim text\033[22m\033[1mBright text\033[0m", + 'Dim textBright text', + ]; + yield 'strikethrough and other styles' => [ + "\033[9mStrikethrough\033[29m \033[3mItalic\033[23m", + 'Strikethrough Italic', + ]; + yield 'extended color codes with semicolons' => [ + "\033[38;5;208mOrange\033[48;5;19mBlue BG\033[0m", + 'OrangeBlue BG', + ]; + yield 'codes with no parameters' => [ + "\033[mDefault\033[m", + 'Default', + ]; + yield 'real-world example: colored log output' => [ + "\033[90m2023-01-01 12:00:00\033[0m \033[32mINFO\033[0m Application started", + '2023-01-01 12:00:00 INFO Application started', + ]; + yield 'real-world example: progress indicator' => [ + "Processing... \033[32m✓\033[0m Done", + 'Processing... ✓ Done', + ]; + yield 'mixed with escape sequences that should remain' => [ + "Normal text\n\ttab and newline\033[31mRed\033[0m", + "Normal text\n\ttab and newlineRed", ]; } @@ -206,13 +172,12 @@ public function testCollapsePhpBlockCommentsEmptyLines(string $input, string $ex $this->assertEquals($expected, $actual); } - public static function dataProviderCollapsePhpBlockCommentsEmptyLines(): array { - return [ - 'empty_string' => [ - '', - '', - ], - 'no_docblock_comments' => [ + public static function dataProviderCollapsePhpBlockCommentsEmptyLines(): \Iterator { + yield 'empty_string' => [ + '', + '', + ]; + yield 'no_docblock_comments' => [ <<<'PHP' [ - '/** Single line comment */', - '/** Single line comment */', - ], - 'docblock_no_empty_lines' => [ + ]; + yield 'single_line_docblock' => [ + '/** Single line comment */', + '/** Single line comment */', + ]; + yield 'docblock_no_empty_lines' => [ <<<'PHP' /** * Description here. @@ -245,8 +210,8 @@ function test() { * @return void */ PHP, - ], - 'docblock_with_two_consecutive_empty_lines' => [ + ]; + yield 'docblock_with_two_consecutive_empty_lines' => [ <<<'PHP' /** * Description here. @@ -262,8 +227,8 @@ function test() { * @param string $param */ PHP, - ], - 'docblock_with_multiple_consecutive_empty_lines' => [ + ]; + yield 'docblock_with_multiple_consecutive_empty_lines' => [ <<<'PHP' /** * Description here. @@ -281,8 +246,8 @@ function test() { * @param string $param */ PHP, - ], - 'multiple_docblocks_with_empty_lines' => [ + ]; + yield 'multiple_docblocks_with_empty_lines' => [ <<<'PHP' /** * First docblock. @@ -316,8 +281,8 @@ function first() {} */ function second() {} PHP, - ], - 'docblock_with_whitespace_in_empty_lines' => [ + ]; + yield 'docblock_with_whitespace_in_empty_lines' => [ <<<'PHP' /** * Description here. @@ -333,8 +298,8 @@ function second() {} * @param string $param */ PHP, - ], - 'mixed_docblocks_and_regular_comments' => [ + ]; + yield 'mixed_docblocks_and_regular_comments' => [ <<<'PHP' /** * Docblock comment. @@ -362,8 +327,8 @@ function test() { return 'test'; } PHP, - ], - 'docblock_at_beginning_and_end' => [ + ]; + yield 'docblock_at_beginning_and_end' => [ <<<'PHP' /** * File docblock. @@ -396,8 +361,8 @@ function test() {} * @return void */ PHP, - ], - 'empty_lines_at_start_of_docblock' => [ + ]; + yield 'empty_lines_at_start_of_docblock' => [ <<<'PHP' /** * @@ -412,8 +377,8 @@ function test() {} * @param string $param */ PHP, - ], - 'empty_lines_at_end_of_docblock' => [ + ]; + yield 'empty_lines_at_end_of_docblock' => [ <<<'PHP' /** * Description here. @@ -428,8 +393,8 @@ function test() {} * @param string $param */ PHP, - ], - 'entirely_empty_docblock' => [ + ]; + yield 'entirely_empty_docblock' => [ <<<'PHP' /** * @@ -441,8 +406,8 @@ function test() {} <<<'PHP' function test() {} PHP, - ], - 'docblock_with_only_whitespace' => [ + ]; + yield 'docblock_with_only_whitespace' => [ <<<'PHP' /** * @@ -454,8 +419,8 @@ class Test {} <<<'PHP' class Test {} PHP, - ], - 'mixed_empty_and_content_docblocks' => [ + ]; + yield 'mixed_empty_and_content_docblocks' => [ <<<'PHP' /** * @@ -476,8 +441,8 @@ function test() {} */ function test() {} PHP, - ], - 'docblock_with_leading_and_trailing_empty_lines' => [ + ]; + yield 'docblock_with_leading_and_trailing_empty_lines' => [ <<<'PHP' /** * @@ -497,8 +462,8 @@ function test() {} * @param string $param */ PHP, - ], - 'docblock_with_custom_indentation' => [ + ]; + yield 'docblock_with_custom_indentation' => [ <<<'PHP' /** * Description here. @@ -515,8 +480,8 @@ function test() {} * @param string $param */ PHP, - ], - 'docblock_with_deeper_indentation' => [ + ]; + yield 'docblock_with_deeper_indentation' => [ <<<'PHP' /** * Description here. @@ -533,12 +498,12 @@ function test() {} * @param string $param */ PHP, - ], - 'docblock_with_tabs_indentation' => [ - "/**\n\t * Description here.\n\t *\n\t *\n\t *\n\t * @param string \$param\n\t */", - "/**\n\t * Description here.\n\t *\n\t * @param string \$param\n\t */", - ], - 'json_string_with_docblock_pattern_should_not_be_modified' => [ + ]; + yield 'docblock_with_tabs_indentation' => [ + "/**\n\t * Description here.\n\t *\n\t *\n\t *\n\t * @param string \$param\n\t */", + "/**\n\t * Description here.\n\t *\n\t * @param string \$param\n\t */", + ]; + yield 'json_string_with_docblock_pattern_should_not_be_modified' => [ <<<'JSON_WRAP' { "lint-css": "stylelint --allow-empty-input \"web/modules/custom/**/*.css\"", @@ -551,11 +516,10 @@ function test() {} "description": "Some /** comment */ in JSON" } JSON_WRAP, - ], - 'inline_docblock_pattern_should_not_be_modified' => [ - 'const foo = "/** some comment */"; // Not a real docblock', - 'const foo = "/** some comment */"; // Not a real docblock', - ], + ]; + yield 'inline_docblock_pattern_should_not_be_modified' => [ + 'const foo = "/** some comment */"; // Not a real docblock', + 'const foo = "/** some comment */"; // Not a real docblock', ]; } @@ -564,39 +528,33 @@ public function testIsRegex(string $value, mixed $expected): void { $this->assertEquals($expected, Strings::isRegex($value)); } - public static function dataProviderIsRegex(): array { - return [ - ['', FALSE], - - // Valid regular expressions. - ["/^[a-z]$/", TRUE], - ["#[a-z]*#i", TRUE], - - // Invalid regular expressions (wrong delimiters or syntax). - ["{\\d+}", FALSE], - ["(\\d+)", FALSE], - ["<[A-Z]{3,6}>", FALSE], - ["^[a-z]$", FALSE], - ["/[a-z", FALSE], - ["[a-z]+/", FALSE], - ["{[a-z]*", FALSE], - ["(a-z]", FALSE], - - // Edge cases. - // Valid, but '*' as delimiter would be invalid. - ["/a*/", TRUE], - // Empty string. - ["", FALSE], - // Just delimiters, no pattern. - ["//", FALSE], - - ['web/', FALSE], - ['web\/', FALSE], - [': web', FALSE], - ['=web', FALSE], - ['!web', FALSE], - ['/web', FALSE], - ]; + public static function dataProviderIsRegex(): \Iterator { + yield ['', FALSE]; + // Valid regular expressions. + yield ["/^[a-z]$/", TRUE]; + yield ["#[a-z]*#i", TRUE]; + // Invalid regular expressions (wrong delimiters or syntax). + yield ["{\\d+}", FALSE]; + yield ["(\\d+)", FALSE]; + yield ["<[A-Z]{3,6}>", FALSE]; + yield ["^[a-z]$", FALSE]; + yield ["/[a-z", FALSE]; + yield ["[a-z]+/", FALSE]; + yield ["{[a-z]*", FALSE]; + yield ["(a-z]", FALSE]; + // Edge cases. + // Valid, but '*' as delimiter would be invalid. + yield ["/a*/", TRUE]; + // Empty string. + yield ["", FALSE]; + // Just delimiters, no pattern. + yield ["//", FALSE]; + yield ['web/', FALSE]; + yield ['web\/', FALSE]; + yield [': web', FALSE]; + yield ['=web', FALSE]; + yield ['!web', FALSE]; + yield ['/web', FALSE]; } #[DataProvider('dataProviderRemoveTrailingSpaces')] @@ -605,88 +563,86 @@ public function testRemoveTrailingSpaces(string $input, string $expected): void $this->assertEquals($expected, $actual); } - public static function dataProviderRemoveTrailingSpaces(): array { - return [ - 'empty_string' => [ - '', - '', - ], - 'no_trailing_spaces' => [ - 'hello world', - 'hello world', - ], - 'single_line_with_trailing_spaces' => [ - 'hello world ', - 'hello world', - ], - 'single_line_with_trailing_tabs' => [ - "hello world\t\t", - 'hello world', - ], - 'single_line_with_mixed_trailing_whitespace' => [ - "hello world \t \t", - 'hello world', - ], - 'multiline_with_trailing_spaces' => [ - "line one \nline two \nline three", - "line one\nline two\nline three", - ], - 'multiline_with_trailing_tabs' => [ - "line one\t\t\nline two\t\nline three", - "line one\nline two\nline three", - ], - 'multiline_with_mixed_trailing_whitespace' => [ - "line one \t \nline two \t\nline three \t\t ", - "line one\nline two\nline three", - ], - 'empty_lines_with_trailing_spaces' => [ - "line one\n \nline three", - "line one\n\nline three", - ], - 'empty_lines_with_trailing_tabs' => [ - "line one\n\t\t\nline three", - "line one\n\nline three", - ], - 'only_trailing_whitespace_lines' => [ - " \n\t\t\n \t ", - "\n\n", - ], - 'preserve_leading_whitespace' => [ - " indented line \n\tindented with tab\t", - " indented line\n\tindented with tab", - ], - 'preserve_internal_whitespace' => [ - "hello world \ninternal spaces\t", - "hello world\ninternal spaces", - ], - 'windows_line_endings' => [ - "line one \r\nline two\t\r\nline three", - "line one\r\nline two\r\nline three", - ], - 'mixed_line_endings' => [ - "line one \nline two\t\r\nline three ", - "line one\nline two\r\nline three", - ], - 'single_space_at_end' => [ - 'hello world ', - 'hello world', - ], - 'single_tab_at_end' => [ - "hello world\t", - 'hello world', - ], - 'multiple_consecutive_trailing_spaces' => [ - 'hello world ', - 'hello world', - ], - 'multiple_consecutive_trailing_tabs' => [ - "hello world\t\t\t\t", - 'hello world', - ], - 'no_line_ending_with_trailing_spaces' => [ - 'single line with spaces ', - 'single line with spaces', - ], + public static function dataProviderRemoveTrailingSpaces(): \Iterator { + yield 'empty_string' => [ + '', + '', + ]; + yield 'no_trailing_spaces' => [ + 'hello world', + 'hello world', + ]; + yield 'single_line_with_trailing_spaces' => [ + 'hello world ', + 'hello world', + ]; + yield 'single_line_with_trailing_tabs' => [ + "hello world\t\t", + 'hello world', + ]; + yield 'single_line_with_mixed_trailing_whitespace' => [ + "hello world \t \t", + 'hello world', + ]; + yield 'multiline_with_trailing_spaces' => [ + "line one \nline two \nline three", + "line one\nline two\nline three", + ]; + yield 'multiline_with_trailing_tabs' => [ + "line one\t\t\nline two\t\nline three", + "line one\nline two\nline three", + ]; + yield 'multiline_with_mixed_trailing_whitespace' => [ + "line one \t \nline two \t\nline three \t\t ", + "line one\nline two\nline three", + ]; + yield 'empty_lines_with_trailing_spaces' => [ + "line one\n \nline three", + "line one\n\nline three", + ]; + yield 'empty_lines_with_trailing_tabs' => [ + "line one\n\t\t\nline three", + "line one\n\nline three", + ]; + yield 'only_trailing_whitespace_lines' => [ + " \n\t\t\n \t ", + "\n\n", + ]; + yield 'preserve_leading_whitespace' => [ + " indented line \n\tindented with tab\t", + " indented line\n\tindented with tab", + ]; + yield 'preserve_internal_whitespace' => [ + "hello world \ninternal spaces\t", + "hello world\ninternal spaces", + ]; + yield 'windows_line_endings' => [ + "line one \r\nline two\t\r\nline three", + "line one\r\nline two\r\nline three", + ]; + yield 'mixed_line_endings' => [ + "line one \nline two\t\r\nline three ", + "line one\nline two\r\nline three", + ]; + yield 'single_space_at_end' => [ + 'hello world ', + 'hello world', + ]; + yield 'single_tab_at_end' => [ + "hello world\t", + 'hello world', + ]; + yield 'multiple_consecutive_trailing_spaces' => [ + 'hello world ', + 'hello world', + ]; + yield 'multiple_consecutive_trailing_tabs' => [ + "hello world\t\t\t\t", + 'hello world', + ]; + yield 'no_line_ending_with_trailing_spaces' => [ + 'single line with spaces ', + 'single line with spaces', ]; } @@ -696,148 +652,146 @@ public function testWrapLines(string $input, string $prefix, string $suffix, str $this->assertEquals($expected, $actual); } - public static function dataProviderWrapLines(): array { - return [ - 'empty_string' => [ - '', - '', - '', - PHP_EOL, - '', - ], - 'single_line_no_wrapping' => [ - 'hello world', - '', - '', - PHP_EOL, - 'hello world', - ], - 'single_line_with_prefix' => [ - 'hello world', - '> ', - '', - PHP_EOL, - '> hello world', - ], - 'single_line_with_suffix' => [ - 'hello world', - '', - ' <', - PHP_EOL, - 'hello world <', - ], - 'single_line_with_prefix_and_suffix' => [ - 'hello world', - '[ ', - ' ]', - PHP_EOL, - '[ hello world ]', - ], - 'multiline_with_prefix' => [ - "line one\nline two\nline three", - '> ', - '', - "\n", - "> line one\n> line two\n> line three", - ], - 'multiline_with_suffix' => [ - "line one\nline two\nline three", - '', - ' <--', - "\n", - "line one <--\nline two <--\nline three <--", - ], - 'multiline_with_prefix_and_suffix' => [ - "line one\nline two\nline three", - '| ', - ' |', - "\n", - "| line one |\n| line two |\n| line three |", - ], - 'empty_lines_with_wrapping' => [ - "line one\n\nline three", - '- ', - '', - "\n", - "- line one\n- \n- line three", - ], - 'custom_eol_character' => [ - "line one\r\nline two", - '> ', - ' <', - "\r\n", - "> line one <\r\n> line two <", - ], - 'html_tag_wrapping' => [ - "First paragraph\nSecond paragraph", - '

', - '

', - "\n", - "

First paragraph

\n

Second paragraph

", - ], - 'indentation_wrapping' => [ - "function test()\nreturn 'hello'", - ' ', - '', - "\n", - " function test()\n return 'hello'", - ], - 'comment_wrapping' => [ - "This is a comment\nAnother line", - '// ', - '', - "\n", - "// This is a comment\n// Another line", - ], - 'quote_wrapping' => [ - "First quote\nSecond quote", - '"', - '"', - "\n", - "\"First quote\"\n\"Second quote\"", - ], - 'single_character_eol' => [ - "line1|line2|line3", - '> ', - ' <', - "|", - "> line1 <|> line2 <|> line3 <", - ], - 'whitespace_only_lines' => [ - " \n\t\n ", - '> ', - ' <', - "\n", - "> <\n> \t <\n> <", - ], - 'special_characters_in_prefix_suffix' => [ - "line one\nline two", - '[INFO] ', - ' ✓', - "\n", - "[INFO] line one ✓\n[INFO] line two ✓", - ], - 'unicode_content_and_wrapping' => [ - "Hello 世界\nGoodbye 🌍", - '🔹 ', - ' ✨', - "\n", - "🔹 Hello 世界 ✨\n🔹 Goodbye 🌍 ✨", - ], - 'complex_multiline_with_php_eol' => [ - " [ - "line one\nline two\nline three", - '> ', - ' <', - '', - "> line one <" . PHP_EOL . "> line two <" . PHP_EOL . "> line three <", - ], + public static function dataProviderWrapLines(): \Iterator { + yield 'empty_string' => [ + '', + '', + '', + PHP_EOL, + '', + ]; + yield 'single_line_no_wrapping' => [ + 'hello world', + '', + '', + PHP_EOL, + 'hello world', + ]; + yield 'single_line_with_prefix' => [ + 'hello world', + '> ', + '', + PHP_EOL, + '> hello world', + ]; + yield 'single_line_with_suffix' => [ + 'hello world', + '', + ' <', + PHP_EOL, + 'hello world <', + ]; + yield 'single_line_with_prefix_and_suffix' => [ + 'hello world', + '[ ', + ' ]', + PHP_EOL, + '[ hello world ]', + ]; + yield 'multiline_with_prefix' => [ + "line one\nline two\nline three", + '> ', + '', + "\n", + "> line one\n> line two\n> line three", + ]; + yield 'multiline_with_suffix' => [ + "line one\nline two\nline three", + '', + ' <--', + "\n", + "line one <--\nline two <--\nline three <--", + ]; + yield 'multiline_with_prefix_and_suffix' => [ + "line one\nline two\nline three", + '| ', + ' |', + "\n", + "| line one |\n| line two |\n| line three |", + ]; + yield 'empty_lines_with_wrapping' => [ + "line one\n\nline three", + '- ', + '', + "\n", + "- line one\n- \n- line three", + ]; + yield 'custom_eol_character' => [ + "line one\r\nline two", + '> ', + ' <', + "\r\n", + "> line one <\r\n> line two <", + ]; + yield 'html_tag_wrapping' => [ + "First paragraph\nSecond paragraph", + '

', + '

', + "\n", + "

First paragraph

\n

Second paragraph

", + ]; + yield 'indentation_wrapping' => [ + "function test()\nreturn 'hello'", + ' ', + '', + "\n", + " function test()\n return 'hello'", + ]; + yield 'comment_wrapping' => [ + "This is a comment\nAnother line", + '// ', + '', + "\n", + "// This is a comment\n// Another line", + ]; + yield 'quote_wrapping' => [ + "First quote\nSecond quote", + '"', + '"', + "\n", + "\"First quote\"\n\"Second quote\"", + ]; + yield 'single_character_eol' => [ + "line1|line2|line3", + '> ', + ' <', + "|", + "> line1 <|> line2 <|> line3 <", + ]; + yield 'whitespace_only_lines' => [ + " \n\t\n ", + '> ', + ' <', + "\n", + "> <\n> \t <\n> <", + ]; + yield 'special_characters_in_prefix_suffix' => [ + "line one\nline two", + '[INFO] ', + ' ✓', + "\n", + "[INFO] line one ✓\n[INFO] line two ✓", + ]; + yield 'unicode_content_and_wrapping' => [ + "Hello 世界\nGoodbye 🌍", + '🔹 ', + ' ✨', + "\n", + "🔹 Hello 世界 ✨\n🔹 Goodbye 🌍 ✨", + ]; + yield 'complex_multiline_with_php_eol' => [ + " [ + "line one\nline two\nline three", + '> ', + ' <', + '', + "> line one <" . PHP_EOL . "> line two <" . PHP_EOL . "> line three <", ]; } diff --git a/.vortex/installer/tests/Unit/TaskTest.php b/.vortex/installer/tests/Unit/TaskTest.php index d225103f4..9ec6a7489 100644 --- a/.vortex/installer/tests/Unit/TaskTest.php +++ b/.vortex/installer/tests/Unit/TaskTest.php @@ -42,82 +42,72 @@ public function testAction( /** * Data provider for testAction. */ - public static function dataProviderAction(): array { - return [ - - 'successful action with string label and no messages' => [ - 'label' => 'Processing default messages', - 'action' => fn(): null => NULL, - 'hint' => NULL, - 'success' => NULL, - 'failure' => NULL, - 'expected_output' => '✓ OK', - ], - - 'successful action with string messages' => [ - 'label' => 'Processing task', - 'action' => fn(): null => NULL, - 'hint' => 'This is a hint', - 'success' => 'Completed successfully', - 'failure' => 'Failed', - 'expected_output' => [ - '✓ Completed successfully', - 'This is a hint', - ], - ], - - 'successful action with string label and TRUE value' => [ - 'label' => 'Processing task', - 'action' => fn(): true => TRUE, - 'hint' => 'This is a hint', - 'success' => 'Completed successfully', - 'failure' => 'Failed', - 'expected_output' => '✓ Completed successfully', - ], - - 'successful action with closures' => [ - 'label' => fn(): string => 'Dynamic label', - 'action' => fn(): string => 'Done', - 'hint' => fn(): string => 'Processing dynamically', - 'success' => fn($result): string => 'Success: ' . $result, - 'failure' => 'Failed', - 'expected_output' => [ - '✓ Success: Done', - 'Processing dynamically', - ], - ], - - 'successful action returning array' => [ - 'label' => 'Processing array', - 'action' => fn(): array => ['item1', 'item2'], - 'hint' => NULL, - 'success' => 'Processed items', - 'failure' => 'Processing failed', - 'expected_output' => [ - '✓ Processed items', - 'item1', - 'item2', - ], + public static function dataProviderAction(): \Iterator { + yield 'successful action with string label and no messages' => [ + 'label' => 'Processing default messages', + 'action' => fn(): null => NULL, + 'hint' => NULL, + 'success' => NULL, + 'failure' => NULL, + 'expected_output' => '✓ OK', + ]; + yield 'successful action with string messages' => [ + 'label' => 'Processing task', + 'action' => fn(): null => NULL, + 'hint' => 'This is a hint', + 'success' => 'Completed successfully', + 'failure' => 'Failed', + 'expected_output' => [ + '✓ Completed successfully', + 'This is a hint', ], - - 'failed action with string' => [ - 'label' => fn(): string => 'Dynamic label', - 'action' => fn(): false => FALSE, - 'hint' => fn(): string => 'Processing dynamically', - 'success' => fn($result): string => 'Success: ' . $result, - 'failure' => 'Failed', - 'expected_output' => 'Failed', + ]; + yield 'successful action with string label and TRUE value' => [ + 'label' => 'Processing task', + 'action' => fn(): true => TRUE, + 'hint' => 'This is a hint', + 'success' => 'Completed successfully', + 'failure' => 'Failed', + 'expected_output' => '✓ Completed successfully', + ]; + yield 'successful action with closures' => [ + 'label' => fn(): string => 'Dynamic label', + 'action' => fn(): string => 'Done', + 'hint' => fn(): string => 'Processing dynamically', + 'success' => fn($result): string => 'Success: ' . $result, + 'failure' => 'Failed', + 'expected_output' => [ + '✓ Success: Done', + 'Processing dynamically', ], - - 'failed action with closure' => [ - 'label' => fn(): string => 'Dynamic label', - 'action' => fn(): false => FALSE, - 'hint' => fn(): string => 'Processing dynamically', - 'success' => fn($result): string => 'Success: ' . $result, - 'failure' => fn(): string => 'Failed dynamically', - 'expected_output' => 'Failed dynamically', + ]; + yield 'successful action returning array' => [ + 'label' => 'Processing array', + 'action' => fn(): array => ['item1', 'item2'], + 'hint' => NULL, + 'success' => 'Processed items', + 'failure' => 'Processing failed', + 'expected_output' => [ + '✓ Processed items', + 'item1', + 'item2', ], - + ]; + yield 'failed action with string' => [ + 'label' => fn(): string => 'Dynamic label', + 'action' => fn(): false => FALSE, + 'hint' => fn(): string => 'Processing dynamically', + 'success' => fn($result): string => 'Success: ' . $result, + 'failure' => 'Failed', + 'expected_output' => 'Failed', + ]; + yield 'failed action with closure' => [ + 'label' => fn(): string => 'Dynamic label', + 'action' => fn(): false => FALSE, + 'hint' => fn(): string => 'Processing dynamically', + 'success' => fn($result): string => 'Success: ' . $result, + 'failure' => fn(): string => 'Failed dynamically', + 'expected_output' => 'Failed dynamically', ]; } diff --git a/.vortex/installer/tests/Unit/TuiTest.php b/.vortex/installer/tests/Unit/TuiTest.php index d70173f2c..96effc411 100644 --- a/.vortex/installer/tests/Unit/TuiTest.php +++ b/.vortex/installer/tests/Unit/TuiTest.php @@ -75,18 +75,16 @@ public function testColorMethods(string $method, string $input, string $expected $this->assertStringContainsString($input, $result); } - public static function dataProviderColorMethods(): array { - return [ - 'green method' => ['green', 'Hello', "\033[32m"], - 'blue method' => ['blue', 'Hello', "\033[34m"], - 'purple method' => ['purple', 'Hello', "\033[35m"], - 'yellow method' => ['yellow', 'Hello', "\033[33m"], - 'cyan method' => ['cyan', 'Hello', "\033[36m"], - 'bold method' => ['bold', 'Hello', "\033[1m"], - 'underscore method' => ['underscore', 'Hello', "\033[4m"], - 'dim method' => ['dim', 'Hello', "\033[2m"], - 'undim method' => ['undim', 'Hello', "\033[22m"], - ]; + public static function dataProviderColorMethods(): \Iterator { + yield 'green method' => ['green', 'Hello', "\033[32m"]; + yield 'blue method' => ['blue', 'Hello', "\033[34m"]; + yield 'purple method' => ['purple', 'Hello', "\033[35m"]; + yield 'yellow method' => ['yellow', 'Hello', "\033[33m"]; + yield 'cyan method' => ['cyan', 'Hello', "\033[36m"]; + yield 'bold method' => ['bold', 'Hello', "\033[1m"]; + yield 'underscore method' => ['underscore', 'Hello', "\033[4m"]; + yield 'dim method' => ['dim', 'Hello', "\033[2m"]; + yield 'undim method' => ['undim', 'Hello', "\033[22m"]; } #[DataProvider('dataProviderColorMethodsMultiline')] @@ -95,24 +93,22 @@ public function testColorMethodsMultiline(string $method, string $input, string $this->assertSame($expected, $result); } - public static function dataProviderColorMethodsMultiline(): array { - return [ - 'green multiline' => [ - 'green', + public static function dataProviderColorMethodsMultiline(): \Iterator { + yield 'green multiline' => [ + 'green', <<<'INPUT' Line 1 Line 2 INPUT, - "\033[32mLine 1\033[39m\n\033[32mLine 2\033[39m", - ], - 'blue multiline' => [ - 'blue', + "\033[32mLine 1\033[39m\n\033[32mLine 2\033[39m", + ]; + yield 'blue multiline' => [ + 'blue', <<<'INPUT' First Second INPUT, - "\033[34mFirst\033[39m\n\033[34mSecond\033[39m", - ], + "\033[34mFirst\033[39m\n\033[34mSecond\033[39m", ]; } @@ -186,14 +182,13 @@ public function testBox( $this->assertSame($expected_clean, $actual_clean); } - public static function dataProviderBox(): array { - return [ - 'simple content without title' => [ - 'content' => 'Simple content', - 'title' => NULL, - 'width' => 50, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => 'Simple content', + 'title' => NULL, + 'width' => 50, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => 'Content with title', - 'title' => 'Box Title', - 'width' => 50, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => 'Content with title', + 'title' => 'Box Title', + 'width' => 50, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => '', - 'title' => 'Empty Content', - 'width' => 40, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => '', + 'title' => 'Empty Content', + 'width' => 40, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => 'Content with empty title', - 'title' => '', - 'width' => 40, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => 'Content with empty title', + 'title' => '', + 'width' => 40, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => 'X', - 'title' => 'A', - 'width' => 25, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => 'X', + 'title' => 'A', + 'width' => 25, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => ' ', - 'title' => NULL, - 'width' => 30, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => ' ', + 'title' => NULL, + 'width' => 30, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => 'Terminal width test', - 'title' => 'Narrow Terminal', - 'width' => 100, - 'terminal_width' => 30, - 'expected_output' => << [ + 'content' => 'Terminal width test', + 'title' => 'Narrow Terminal', + 'width' => 100, + 'terminal_width' => 30, + 'expected_output' => << [ - 'content' => 'Default width content', - 'title' => 'Default Width', - 'width' => NULL, - 'terminal_width' => 50, - 'expected_output' => << [ + 'content' => 'Default width content', + 'title' => 'Default Width', + 'width' => NULL, + 'terminal_width' => 50, + 'expected_output' => << [ - 'content' => 'This is a very long line of content that should definitely be wrapped when the box width is narrow', - 'title' => 'Long Content Test', - 'width' => 40, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => 'This is a very long line of content that should definitely be wrapped when the box width is narrow', + 'title' => 'Long Content Test', + 'width' => 40, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => 'Short line', - 'title' => 'This is a very long title that should be wrapped across multiple lines when the box width is constrained', - 'width' => 35, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => 'Short line', + 'title' => 'This is a very long title that should be wrapped across multiple lines when the box width is constrained', + 'width' => 35, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => "Multi\nLine\nContent\nHere", - 'title' => 'Multi-Line Test', - 'width' => 30, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => "Multi\nLine\nContent\nHere", + 'title' => 'Multi-Line Test', + 'width' => 30, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => 'This line has some words and should wrap nicely', - 'title' => NULL, - 'width' => 25, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => 'This line has some words and should wrap nicely', + 'title' => NULL, + 'width' => 25, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => 'OneVeryLongWordThatCannotBeWrappedNormally', - 'title' => 'Unbreakable', - 'width' => 20, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => 'OneVeryLongWordThatCannotBeWrappedNormally', + 'title' => 'Unbreakable', + 'width' => 20, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => "Paragraph one with some text.\n\nParagraph two with more text after empty line.", - 'title' => 'Multi-Paragraph', - 'width' => 45, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => "Paragraph one with some text.\n\nParagraph two with more text after empty line.", + 'title' => 'Multi-Paragraph', + 'width' => 45, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => 'Content with émojis 🌟 and special chars ñáéíóú that affect wrapping calculations', - 'title' => 'Special Chars', - 'width' => 35, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => 'Content with émojis 🌟 and special chars ñáéíóú that affect wrapping calculations', + 'title' => 'Special Chars', + 'width' => 35, + 'terminal_width' => 100, + 'expected_output' => << [ - 'content' => 'Short', - 'title' => 'Normal Title', - 'width' => 10, - 'terminal_width' => 100, - 'expected_output' => << [ + 'content' => 'Short', + 'title' => 'Normal Title', + 'width' => 10, + 'terminal_width' => 100, + 'expected_output' => << [ - 'values' => ['key1' => 'value1', 'key2' => 'value2'], - 'title' => 'Test List', - 'expected_strings' => ['key1', 'value1', 'key2', 'value2', 'Test List'], - ], - 'list with array values' => [ - 'values' => ['items' => ['item1', 'item2', 'item3']], - 'title' => 'Array Test', - 'expected_strings' => ['items', 'item1, item2, item3', 'Array Test'], - ], - 'list with section title' => [ - 'values' => [ - 'Section A' => Tui::LIST_SECTION_TITLE, - 'key1' => 'value1', - ], - 'title' => 'Section Test', - 'expected_strings' => ['Section A', 'key1', 'value1'], + public static function dataProviderList(): \Iterator { + yield 'simple list' => [ + 'values' => ['key1' => 'value1', 'key2' => 'value2'], + 'title' => 'Test List', + 'expected_strings' => ['key1', 'value1', 'key2', 'value2', 'Test List'], + ]; + yield 'list with array values' => [ + 'values' => ['items' => ['item1', 'item2', 'item3']], + 'title' => 'Array Test', + 'expected_strings' => ['items', 'item1, item2, item3', 'Array Test'], + ]; + yield 'list with section title' => [ + 'values' => [ + 'Section A' => Tui::LIST_SECTION_TITLE, + 'key1' => 'value1', ], + 'title' => 'Section Test', + 'expected_strings' => ['Section A', 'key1', 'value1'], ]; } @@ -553,96 +530,84 @@ public function testUtfPadding( $this->assertSame($expected_padding, $result); } - public static function dataProviderUtfPadding(): array { - return [ - // JetBrains terminal conditions. - 'JetBrains with 1-byte UTF-8 char' => [ + public static function dataProviderUtfPadding(): \Iterator { + // JetBrains terminal conditions. + yield 'JetBrains with 1-byte UTF-8 char' => [ // 2 bytes, 1 mb_strlen - 'char' => 'é', - 'terminal_emulator' => 'JetBrains-something', - 'term_program' => NULL, - 'expected_padding' => ' ', - ], - - 'JetBrains with 3-byte UTF-8 char' => [ + 'char' => 'é', + 'terminal_emulator' => 'JetBrains-something', + 'term_program' => NULL, + 'expected_padding' => ' ', + ]; + yield 'JetBrains with 3-byte UTF-8 char' => [ // 3 bytes, 1 mb_strlen - 'char' => 'あ', - 'terminal_emulator' => 'JetBrains-IDE', - 'term_program' => NULL, - 'expected_padding' => ' ', - ], - - 'JetBrains with 4-byte UTF-8 char' => [ + 'char' => 'あ', + 'terminal_emulator' => 'JetBrains-IDE', + 'term_program' => NULL, + 'expected_padding' => ' ', + ]; + yield 'JetBrains with 4-byte UTF-8 char' => [ // 4 bytes, 1 mb_strlen - should NOT get padding (len >= 4) - 'char' => '🌟', - 'terminal_emulator' => 'JetBrains-IDE', - 'term_program' => NULL, - 'expected_padding' => '', - ], - - 'Non-JetBrains terminal' => [ - 'char' => 'é', - 'terminal_emulator' => 'other-terminal', - 'term_program' => NULL, - 'expected_padding' => '', - ], - - // Apple Terminal conditions. - 'Apple Terminal with multi-byte char under 8 bytes' => [ + 'char' => '🌟', + 'terminal_emulator' => 'JetBrains-IDE', + 'term_program' => NULL, + 'expected_padding' => '', + ]; + yield 'Non-JetBrains terminal' => [ + 'char' => 'é', + 'terminal_emulator' => 'other-terminal', + 'term_program' => NULL, + 'expected_padding' => '', + ]; + // Apple Terminal conditions. + yield 'Apple Terminal with multi-byte char under 8 bytes' => [ // 2 chars × 3 bytes = 6 bytes total, mblen=2, len=6 < 8 - 'char' => 'あい', - 'terminal_emulator' => NULL, - 'term_program' => 'Apple_Terminal', - 'expected_padding' => ' ', - ], - - 'Apple Terminal with long multi-byte string' => [ + 'char' => 'あい', + 'terminal_emulator' => NULL, + 'term_program' => 'Apple_Terminal', + 'expected_padding' => ' ', + ]; + yield 'Apple Terminal with long multi-byte string' => [ // 5 chars × 3 bytes = 15 bytes, mblen=5, len=15 >= 8 - 'char' => 'あいうえお', - 'terminal_emulator' => NULL, - 'term_program' => 'Apple_Terminal', - 'expected_padding' => '', - ], - - 'Apple Terminal with single-byte char' => [ + 'char' => 'あいうえお', + 'terminal_emulator' => NULL, + 'term_program' => 'Apple_Terminal', + 'expected_padding' => '', + ]; + yield 'Apple Terminal with single-byte char' => [ // Single byte, single mb_strlen. - 'char' => 'A', - 'terminal_emulator' => NULL, - 'term_program' => 'Apple_Terminal', - 'expected_padding' => '', - ], - - // No special terminal conditions. - 'No special terminal with UTF-8' => [ - 'char' => '🌟', - 'terminal_emulator' => NULL, - 'term_program' => NULL, - 'expected_padding' => '', - ], - - 'Regular ASCII character' => [ - 'char' => 'A', - 'terminal_emulator' => NULL, - 'term_program' => NULL, - 'expected_padding' => '', - ], - - // Both terminals set - JetBrains takes precedence. - 'Both JetBrains and Apple set' => [ - 'char' => 'é', - 'terminal_emulator' => 'JetBrains-IDE', - 'term_program' => 'Apple_Terminal', + 'char' => 'A', + 'terminal_emulator' => NULL, + 'term_program' => 'Apple_Terminal', + 'expected_padding' => '', + ]; + // No special terminal conditions. + yield 'No special terminal with UTF-8' => [ + 'char' => '🌟', + 'terminal_emulator' => NULL, + 'term_program' => NULL, + 'expected_padding' => '', + ]; + yield 'Regular ASCII character' => [ + 'char' => 'A', + 'terminal_emulator' => NULL, + 'term_program' => NULL, + 'expected_padding' => '', + ]; + // Both terminals set - JetBrains takes precedence. + yield 'Both JetBrains and Apple set' => [ + 'char' => 'é', + 'terminal_emulator' => 'JetBrains-IDE', + 'term_program' => 'Apple_Terminal', // JetBrains condition should trigger first. - 'expected_padding' => ' ', - ], - - // Empty/null environment values. - 'Empty environment values' => [ - 'char' => 'é', - 'terminal_emulator' => '', - 'term_program' => '', - 'expected_padding' => '', - ], + 'expected_padding' => ' ', + ]; + // Empty/null environment values. + yield 'Empty environment values' => [ + 'char' => 'é', + 'terminal_emulator' => '', + 'term_program' => '', + 'expected_padding' => '', ]; } @@ -660,91 +625,83 @@ public function testCenter( /** * Data provider for testCenter. */ - public static function dataProviderCenter(): array { - return [ - - 'single line text with default width' => [ - 'text' => 'Hello', - 'width' => 80, - 'border' => NULL, - 'expected' => << [ + 'text' => 'Hello', + 'width' => 80, + 'border' => NULL, + 'expected' => << [ - 'text' => 'Test', - 'width' => 20, - 'border' => NULL, - 'expected' => << [ + 'text' => 'Test', + 'width' => 20, + 'border' => NULL, + 'expected' => << [ - 'text' => <<<'TEXT' + ]; + yield 'multiline text without border' => [ + 'text' => <<<'TEXT' Line 1 Line 2 TEXT, - 'width' => 20, - 'border' => NULL, - 'expected' => << 20, + 'border' => NULL, + 'expected' => << [ - 'text' => <<<'TEXT' + ]; + yield 'multiline text with different line lengths' => [ + 'text' => <<<'TEXT' Short Longer line X TEXT, - 'width' => 30, - 'border' => NULL, - 'expected' => << 30, + 'border' => NULL, + 'expected' => << [ - 'text' => <<<'TEXT' + ]; + yield 'empty line in multiline text' => [ + 'text' => <<<'TEXT' Line 1 Line 3 TEXT, - 'width' => 20, - 'border' => NULL, - 'expected' => << 20, + 'border' => NULL, + 'expected' => << [ - 'text' => 'Hello', - 'width' => 20, - 'border' => '=', - 'expected' => << [ + 'text' => 'Hello', + 'width' => 20, + 'border' => '=', + 'expected' => << [ - 'text' => <<<'TEXT' + ]; + yield 'multiline text with border' => [ + 'text' => <<<'TEXT' Line 1 Line 2 TEXT, - 'width' => 25, - 'border' => '-', - 'expected' => << 25, + 'border' => '-', + 'expected' => << [ - 'text' => 'Exact', - 'width' => 5, - 'border' => NULL, - 'expected' => << [ + 'text' => 'Exact', + 'width' => 5, + 'border' => NULL, + 'expected' => << [ - 'text' => 'Very long text', - 'width' => 20, - 'border' => NULL, - 'expected' => << [ + 'text' => 'Very long text', + 'width' => 20, + 'border' => NULL, + 'expected' => << [ - 'text' => 'X', - 'width' => 10, - 'border' => NULL, - 'expected' => << [ + 'text' => 'X', + 'width' => 10, + 'border' => NULL, + 'expected' => << [ - 'text' => '', - 'width' => 10, - 'border' => NULL, - 'expected' => << [ + 'text' => '', + 'width' => 10, + 'border' => NULL, + 'expected' => << [ - 'text' => ' ', - 'width' => 15, - 'border' => NULL, - 'expected' => ' ', - ], - - 'text with border using different character' => [ - 'text' => 'Bordered', - 'width' => 16, - 'border' => '*', - 'expected' => << [ + 'text' => ' ', + 'width' => 15, + 'border' => NULL, + 'expected' => ' ', + ]; + yield 'text with border using different character' => [ + 'text' => 'Bordered', + 'width' => 16, + 'border' => '*', + 'expected' => <<assertEquals($expected, $result); } - public static function dataProviderNormalizeText(): array { - return [ - // Test whitespace collapsing. - 'multiple spaces' => [ - 'input' => 'Hello world', - 'expected' => 'Hello world', - ], - - 'multiple types of whitespace' => [ - 'input' => "Hello\t\t \n world", - 'expected' => 'Hello world', - ], - - 'leading and trailing spaces with multiple interior spaces' => [ - 'input' => ' Hello world ', - 'expected' => ' Hello world ', - ], - - // Test non-ASCII text gets whitespace normalized + UTF padding. - 'text starting with non-ASCII character' => [ - 'input' => 'éHello world', - 'expected' => 'éHello world', - ], - - // Test ASCII text processing (with UTF padding). - 'simple ASCII text' => [ - 'input' => 'Hello world', - 'expected' => 'Hello world', - ], - - 'ASCII text with UTF-8 characters' => [ - 'input' => 'Hello 🌟 world', - 'expected' => 'Hello 🌟 world', - ], - - 'empty string' => [ - 'input' => '', - 'expected' => '', - ], - - 'single space' => [ - 'input' => ' ', - 'expected' => ' ', - ], - - 'only multiple spaces' => [ - 'input' => ' ', - 'expected' => ' ', - ], + public static function dataProviderNormalizeText(): \Iterator { + // Test whitespace collapsing. + yield 'multiple spaces' => [ + 'input' => 'Hello world', + 'expected' => 'Hello world', + ]; + yield 'multiple types of whitespace' => [ + 'input' => "Hello\t\t \n world", + 'expected' => 'Hello world', + ]; + yield 'leading and trailing spaces with multiple interior spaces' => [ + 'input' => ' Hello world ', + 'expected' => ' Hello world ', + ]; + // Test non-ASCII text gets whitespace normalized + UTF padding. + yield 'text starting with non-ASCII character' => [ + 'input' => 'éHello world', + 'expected' => 'éHello world', + ]; + // Test ASCII text processing (with UTF padding). + yield 'simple ASCII text' => [ + 'input' => 'Hello world', + 'expected' => 'Hello world', + ]; + yield 'ASCII text with UTF-8 characters' => [ + 'input' => 'Hello 🌟 world', + 'expected' => 'Hello 🌟 world', + ]; + yield 'empty string' => [ + 'input' => '', + 'expected' => '', + ]; + yield 'single space' => [ + 'input' => ' ', + 'expected' => ' ', + ]; + yield 'only multiple spaces' => [ + 'input' => ' ', + 'expected' => ' ', ]; } diff --git a/.vortex/installer/tests/Unit/Utils/OptionsResolverTest.php b/.vortex/installer/tests/Unit/Utils/OptionsResolverTest.php index f6a165800..bfe5921d8 100644 --- a/.vortex/installer/tests/Unit/Utils/OptionsResolverTest.php +++ b/.vortex/installer/tests/Unit/Utils/OptionsResolverTest.php @@ -49,12 +49,10 @@ public function testCheckRequirementsThrowsOnMissing(string $missing_command): v OptionsResolver::checkRequirements($finder); } - public static function dataProviderCheckRequirementsThrowsOnMissing(): array { - return [ - 'missing git' => ['git'], - 'missing tar' => ['tar'], - 'missing composer' => ['composer'], - ]; + public static function dataProviderCheckRequirementsThrowsOnMissing(): \Iterator { + yield 'missing git' => ['git']; + yield 'missing tar' => ['tar']; + yield 'missing composer' => ['composer']; } public function testCheckRequirementsStopsAtFirstMissing(): void { @@ -90,17 +88,15 @@ public function testResolveBooleanOptions(string $option_key, string $config_key } } - public static function dataProviderResolveBooleanOptions(): array { - return [ - 'no-interaction true' => ['no-interaction', 'getNoInteraction', TRUE], - 'no-interaction false' => ['no-interaction', 'getNoInteraction', FALSE], - 'quiet true' => ['quiet', 'isQuiet', TRUE], - 'quiet false' => ['quiet', 'isQuiet', FALSE], - 'build true' => ['build', Config::BUILD_NOW, TRUE], - 'build false' => ['build', Config::BUILD_NOW, FALSE], - 'no-cleanup true' => ['no-cleanup', Config::NO_CLEANUP, TRUE], - 'no-cleanup false' => ['no-cleanup', Config::NO_CLEANUP, FALSE], - ]; + public static function dataProviderResolveBooleanOptions(): \Iterator { + yield 'no-interaction true' => ['no-interaction', 'getNoInteraction', TRUE]; + yield 'no-interaction false' => ['no-interaction', 'getNoInteraction', FALSE]; + yield 'quiet true' => ['quiet', 'isQuiet', TRUE]; + yield 'quiet false' => ['quiet', 'isQuiet', FALSE]; + yield 'build true' => ['build', Config::BUILD_NOW, TRUE]; + yield 'build false' => ['build', Config::BUILD_NOW, FALSE]; + yield 'no-cleanup true' => ['no-cleanup', Config::NO_CLEANUP, TRUE]; + yield 'no-cleanup false' => ['no-cleanup', Config::NO_CLEANUP, FALSE]; } public function testResolveSetsDestination(): void { @@ -162,28 +158,26 @@ public function testResolveUri(?string $uri, string $expected_repo, string $expe $this->assertEquals($expected_ref, $artifact->getRef()); } - public static function dataProviderResolveUri(): array { - return [ - 'default (null uri)' => [ - NULL, - RepositoryDownloader::DEFAULT_REPO, - RepositoryDownloader::REF_STABLE, - ], - 'repo with branch ref' => [ - 'https://github.com/drevops/vortex.git#main', - 'https://github.com/drevops/vortex.git', - 'main', - ], - 'repo with tag ref' => [ - 'https://github.com/drevops/vortex.git#25.11.0', - 'https://github.com/drevops/vortex.git', - '25.11.0', - ], - 'repo with stable ref' => [ - RepositoryDownloader::DEFAULT_REPO . '#' . RepositoryDownloader::REF_STABLE, - RepositoryDownloader::DEFAULT_REPO, - RepositoryDownloader::REF_STABLE, - ], + public static function dataProviderResolveUri(): \Iterator { + yield 'default (null uri)' => [ + NULL, + RepositoryDownloader::DEFAULT_REPO, + RepositoryDownloader::REF_STABLE, + ]; + yield 'repo with branch ref' => [ + 'https://github.com/drevops/vortex.git#main', + 'https://github.com/drevops/vortex.git', + 'main', + ]; + yield 'repo with tag ref' => [ + 'https://github.com/drevops/vortex.git#25.11.0', + 'https://github.com/drevops/vortex.git', + '25.11.0', + ]; + yield 'repo with stable ref' => [ + RepositoryDownloader::DEFAULT_REPO . '#' . RepositoryDownloader::REF_STABLE, + RepositoryDownloader::DEFAULT_REPO, + RepositoryDownloader::REF_STABLE, ]; } diff --git a/.vortex/installer/tests/Unit/ValidatorTest.php b/.vortex/installer/tests/Unit/ValidatorTest.php index 66eccdc8d..caf285bd2 100644 --- a/.vortex/installer/tests/Unit/ValidatorTest.php +++ b/.vortex/installer/tests/Unit/ValidatorTest.php @@ -19,24 +19,22 @@ public function testContainerImage(string $input, bool $expected): void { $this->assertSame($expected, Validator::containerImage($input)); } - public static function dataProviderContainerImage(): array { - return [ - ['myregistryhost:5000/fedora/httpd:version', TRUE], - ['fedora/httpd:version1.0.test', TRUE], - ['fedora/httpd:version1.0', TRUE], - ['rabbit:3', TRUE], - ['rabbit', TRUE], - ['registry/rabbit:3', TRUE], - ['registry/rabbit', TRUE], - ['invalid@name!', FALSE], - ['UPPERCASE/Repo:Tag', FALSE], - ['registry.example.com/image', TRUE], - ['registry.example.com:8080/image:v1.2', TRUE], - ['multiple//slashes', FALSE], - [' spaced name ', FALSE], - ['trailing.dot.', FALSE], - ['test:super-long-tag-that-exceeds-128-characters-aaaaaaaaaabbbbbbbbbbbbccccccccccddddddddddeeeeeeeeeeaaaaaaaaaabbbbbbbbbbbbccccccccccddddddddddeeeeeeeeee', FALSE], - ]; + public static function dataProviderContainerImage(): \Iterator { + yield ['myregistryhost:5000/fedora/httpd:version', TRUE]; + yield ['fedora/httpd:version1.0.test', TRUE]; + yield ['fedora/httpd:version1.0', TRUE]; + yield ['rabbit:3', TRUE]; + yield ['rabbit', TRUE]; + yield ['registry/rabbit:3', TRUE]; + yield ['registry/rabbit', TRUE]; + yield ['invalid@name!', FALSE]; + yield ['UPPERCASE/Repo:Tag', FALSE]; + yield ['registry.example.com/image', TRUE]; + yield ['registry.example.com:8080/image:v1.2', TRUE]; + yield ['multiple//slashes', FALSE]; + yield [' spaced name ', FALSE]; + yield ['trailing.dot.', FALSE]; + yield ['test:super-long-tag-that-exceeds-128-characters-aaaaaaaaaabbbbbbbbbbbbccccccccccddddddddddeeeeeeeeeeaaaaaaaaaabbbbbbbbbbbbccccccccccddddddddddeeeeeeeeee', FALSE]; } #[DataProvider('dataProviderDomain')] @@ -44,19 +42,17 @@ public function testDomain(string $domain, bool $expected): void { $this->assertSame($expected, Validator::domain($domain)); } - public static function dataProviderDomain(): array { - return [ - 'valid domain with TLD' => ['example.com', TRUE], - 'valid subdomain' => ['sub.example.com', TRUE], - 'valid domain with multiple dots' => ['example.co.uk', TRUE], - 'invalid domain without TLD' => ['myproject', FALSE], - 'invalid domain with only dot' => ['.', FALSE], - 'invalid domain with special characters' => ['invalid_domain.com', FALSE], - 'invalid empty string' => ['', FALSE], - 'invalid numeric domain' => ['123456', FALSE], - 'invalid IP address' => ['192.168.1.1', FALSE], - 'invalid domain with spaces' => ['example .com', FALSE], - ]; + public static function dataProviderDomain(): \Iterator { + yield 'valid domain with TLD' => ['example.com', TRUE]; + yield 'valid subdomain' => ['sub.example.com', TRUE]; + yield 'valid domain with multiple dots' => ['example.co.uk', TRUE]; + yield 'invalid domain without TLD' => ['myproject', FALSE]; + yield 'invalid domain with only dot' => ['.', FALSE]; + yield 'invalid domain with special characters' => ['invalid_domain.com', FALSE]; + yield 'invalid empty string' => ['', FALSE]; + yield 'invalid numeric domain' => ['123456', FALSE]; + yield 'invalid IP address' => ['192.168.1.1', FALSE]; + yield 'invalid domain with spaces' => ['example .com', FALSE]; } #[DataProvider('dataProviderGithubProject')] @@ -64,20 +60,18 @@ public function testGithubProject(string $value, bool $expected): void { $this->assertSame($expected, Validator::githubProject($value)); } - public static function dataProviderGithubProject(): array { - return [ - 'valid project' => ['user/repo', TRUE], - 'valid project with numbers' => ['user123/repo456', TRUE], - 'valid project with hyphens and underscores' => ['user-name/repo_name', TRUE], - 'valid project with mixed case' => ['UserName/RepoName', TRUE], - 'invalid missing slash' => ['userrepo', FALSE], - 'invalid leading slash' => ['/repo', FALSE], - 'invalid trailing slash' => ['user/', FALSE], - 'invalid empty string' => ['', FALSE], - 'invalid extra slash' => ['user/repo/extra', FALSE], - 'invalid spaces' => ['user /repo', FALSE], - 'invalid special characters' => ['user!@#/repo$', FALSE], - ]; + public static function dataProviderGithubProject(): \Iterator { + yield 'valid project' => ['user/repo', TRUE]; + yield 'valid project with numbers' => ['user123/repo456', TRUE]; + yield 'valid project with hyphens and underscores' => ['user-name/repo_name', TRUE]; + yield 'valid project with mixed case' => ['UserName/RepoName', TRUE]; + yield 'invalid missing slash' => ['userrepo', FALSE]; + yield 'invalid leading slash' => ['/repo', FALSE]; + yield 'invalid trailing slash' => ['user/', FALSE]; + yield 'invalid empty string' => ['', FALSE]; + yield 'invalid extra slash' => ['user/repo/extra', FALSE]; + yield 'invalid spaces' => ['user /repo', FALSE]; + yield 'invalid special characters' => ['user!@#/repo$', FALSE]; } #[DataProvider('dataProviderDirname')] @@ -85,24 +79,22 @@ public function testDirname(string $input, bool $expected): void { $this->assertSame($expected, Validator::dirname($input)); } - public static function dataProviderDirname(): array { - return [ - 'valid folder name' => ['valid_folder', TRUE], - 'valid with hyphen' => ['my-folder', TRUE], - 'valid with dot' => ['another.folder', TRUE], - 'valid with space' => ['folder name', FALSE], - 'valid with leading dot' => ['.hidden_folder', TRUE], - 'valid with numbers' => ['folder123', TRUE], - 'invalid Windows reserved name CON' => ['CON', FALSE], - 'invalid Windows reserved name NUL' => ['NUL', FALSE], - 'invalid Windows reserved name COM1' => ['COM1', FALSE], - 'invalid with forward slash' => ['folder/name', FALSE], - 'invalid with backslash' => ['folder\name', FALSE], - 'invalid with pipe' => ['folder|name', FALSE], - 'invalid with angle brackets' => ['folder<>name', FALSE], - 'invalid single dot' => ['.', FALSE], - 'invalid double dot' => ['..', FALSE], - ]; + public static function dataProviderDirname(): \Iterator { + yield 'valid folder name' => ['valid_folder', TRUE]; + yield 'valid with hyphen' => ['my-folder', TRUE]; + yield 'valid with dot' => ['another.folder', TRUE]; + yield 'valid with space' => ['folder name', FALSE]; + yield 'valid with leading dot' => ['.hidden_folder', TRUE]; + yield 'valid with numbers' => ['folder123', TRUE]; + yield 'invalid Windows reserved name CON' => ['CON', FALSE]; + yield 'invalid Windows reserved name NUL' => ['NUL', FALSE]; + yield 'invalid Windows reserved name COM1' => ['COM1', FALSE]; + yield 'invalid with forward slash' => ['folder/name', FALSE]; + yield 'invalid with backslash' => ['folder\name', FALSE]; + yield 'invalid with pipe' => ['folder|name', FALSE]; + yield 'invalid with angle brackets' => ['folder<>name', FALSE]; + yield 'invalid single dot' => ['.', FALSE]; + yield 'invalid double dot' => ['..', FALSE]; } #[DataProvider('dataProviderGitCommitSha')] @@ -110,27 +102,24 @@ public function testGitCommitSha(string $sha, bool $expected): void { $this->assertSame($expected, Validator::gitCommitSha($sha)); } - public static function dataProviderGitCommitSha(): array { - return [ - // Valid SHA-1 hashes (40 hexadecimal characters) - 'valid lowercase SHA' => ['a1b2c3d4e5f6789012345678901234567890abcd', TRUE], - 'valid uppercase SHA' => ['A1B2C3D4E5F6789012345678901234567890ABCD', TRUE], - 'valid mixed case SHA' => ['a1B2c3D4e5F6789012345678901234567890AbCd', TRUE], - 'valid all numbers SHA' => ['1234567890123456789012345678901234567890', TRUE], - 'valid all letters SHA' => ['abcdefabcdefabcdefabcdefabcdefabcdefabcd', TRUE], - - // Invalid SHA hashes. - 'invalid too short' => ['a1b2c3d4e5f6789012345678901234567890abc', FALSE], - 'invalid too long' => ['a1b2c3d4e5f6789012345678901234567890abcdef', FALSE], - 'invalid with non-hex characters' => ['a1b2c3d4e5f6789012345678901234567890abcg', FALSE], - 'invalid with special characters' => ['a1b2c3d4e5f6789012345678901234567890ab!@', FALSE], - 'invalid with spaces' => ['a1b2c3d4e5f6 789012345678901234567890abcd', FALSE], - 'invalid empty string' => ['', FALSE], - 'invalid only spaces' => [' ', FALSE], - 'invalid with hyphens' => ['a1b2c3d4-e5f6-7890-1234-567890abcd', FALSE], - 'invalid partial match' => ['123', FALSE], - 'invalid null characters' => ["a1b2c3d4e5f6789012345678901234567890abc\0", FALSE], - ]; + public static function dataProviderGitCommitSha(): \Iterator { + // Valid SHA-1 hashes (40 hexadecimal characters) + yield 'valid lowercase SHA' => ['a1b2c3d4e5f6789012345678901234567890abcd', TRUE]; + yield 'valid uppercase SHA' => ['A1B2C3D4E5F6789012345678901234567890ABCD', TRUE]; + yield 'valid mixed case SHA' => ['a1B2c3D4e5F6789012345678901234567890AbCd', TRUE]; + yield 'valid all numbers SHA' => ['1234567890123456789012345678901234567890', TRUE]; + yield 'valid all letters SHA' => ['abcdefabcdefabcdefabcdefabcdefabcdefabcd', TRUE]; + // Invalid SHA hashes. + yield 'invalid too short' => ['a1b2c3d4e5f6789012345678901234567890abc', FALSE]; + yield 'invalid too long' => ['a1b2c3d4e5f6789012345678901234567890abcdef', FALSE]; + yield 'invalid with non-hex characters' => ['a1b2c3d4e5f6789012345678901234567890abcg', FALSE]; + yield 'invalid with special characters' => ['a1b2c3d4e5f6789012345678901234567890ab!@', FALSE]; + yield 'invalid with spaces' => ['a1b2c3d4e5f6 789012345678901234567890abcd', FALSE]; + yield 'invalid empty string' => ['', FALSE]; + yield 'invalid only spaces' => [' ', FALSE]; + yield 'invalid with hyphens' => ['a1b2c3d4-e5f6-7890-1234-567890abcd', FALSE]; + yield 'invalid partial match' => ['123', FALSE]; + yield 'invalid null characters' => ["a1b2c3d4e5f6789012345678901234567890abc\0", FALSE]; } #[DataProvider('dataProviderGitCommitShaShort')] @@ -138,33 +127,30 @@ public function testGitCommitShaShort(string $sha_short, bool $expected): void { $this->assertSame($expected, Validator::gitCommitShaShort($sha_short)); } - public static function dataProviderGitCommitShaShort(): array { - return [ - // Valid short SHA-1 hashes (7 hexadecimal characters) - 'valid lowercase short SHA' => ['a1b2c3d', TRUE], - 'valid uppercase short SHA' => ['A1B2C3D', TRUE], - 'valid mixed case short SHA' => ['a1B2c3D', TRUE], - 'valid all numbers short SHA' => ['1234567', TRUE], - 'valid all letters short SHA' => ['abcdef0', TRUE], - 'valid with f characters' => ['fffffff', TRUE], - 'valid with 0 characters' => ['0000000', TRUE], - - // Invalid short SHA hashes. - 'invalid too short (6 chars)' => ['a1b2c3', FALSE], - 'invalid too short (1 char)' => ['a', FALSE], - 'invalid too long (8 chars)' => ['a1b2c3d4', FALSE], - 'invalid too long (40 chars)' => ['a1b2c3d4e5f6789012345678901234567890abcd', FALSE], - 'invalid with non-hex characters' => ['a1b2c3g', FALSE], - 'invalid with special characters' => ['a1b2c!@', FALSE], - 'invalid with spaces' => ['a1b 2c3', FALSE], - 'invalid with leading space' => [' a1b2c3', FALSE], - 'invalid with trailing space' => ['a1b2c3 ', FALSE], - 'invalid empty string' => ['', FALSE], - 'invalid only spaces' => [' ', FALSE], - 'invalid with hyphens' => ['a1b-2c3', FALSE], - 'invalid with underscores' => ['a1b_2c3', FALSE], - 'invalid null characters' => ["a1b2c3\0", FALSE], - ]; + public static function dataProviderGitCommitShaShort(): \Iterator { + // Valid short SHA-1 hashes (7 hexadecimal characters) + yield 'valid lowercase short SHA' => ['a1b2c3d', TRUE]; + yield 'valid uppercase short SHA' => ['A1B2C3D', TRUE]; + yield 'valid mixed case short SHA' => ['a1B2c3D', TRUE]; + yield 'valid all numbers short SHA' => ['1234567', TRUE]; + yield 'valid all letters short SHA' => ['abcdef0', TRUE]; + yield 'valid with f characters' => ['fffffff', TRUE]; + yield 'valid with 0 characters' => ['0000000', TRUE]; + // Invalid short SHA hashes. + yield 'invalid too short (6 chars)' => ['a1b2c3', FALSE]; + yield 'invalid too short (1 char)' => ['a', FALSE]; + yield 'invalid too long (8 chars)' => ['a1b2c3d4', FALSE]; + yield 'invalid too long (40 chars)' => ['a1b2c3d4e5f6789012345678901234567890abcd', FALSE]; + yield 'invalid with non-hex characters' => ['a1b2c3g', FALSE]; + yield 'invalid with special characters' => ['a1b2c!@', FALSE]; + yield 'invalid with spaces' => ['a1b 2c3', FALSE]; + yield 'invalid with leading space' => [' a1b2c3', FALSE]; + yield 'invalid with trailing space' => ['a1b2c3 ', FALSE]; + yield 'invalid empty string' => ['', FALSE]; + yield 'invalid only spaces' => [' ', FALSE]; + yield 'invalid with hyphens' => ['a1b-2c3', FALSE]; + yield 'invalid with underscores' => ['a1b_2c3', FALSE]; + yield 'invalid null characters' => ["a1b2c3\0", FALSE]; } #[DataProvider('dataProviderGitRef')] @@ -172,79 +158,67 @@ public function testGitRef(string $ref, bool $expected): void { $this->assertSame($expected, Validator::gitRef($ref)); } - public static function dataProviderGitRef(): array { - return [ - // Special keywords. - 'special keyword stable' => ['stable', TRUE], - 'special keyword HEAD' => ['HEAD', TRUE], - - // Commit hashes (already tested, but included for completeness). - 'valid 40-char commit hash' => ['a1b2c3d4e5f6789012345678901234567890abcd', TRUE], - 'valid 7-char commit hash' => ['a1b2c3d', TRUE], - - // Semantic versioning tags. - 'semver without prefix' => ['1.2.3', TRUE], - 'semver with v prefix' => ['v1.2.3', TRUE], - 'semver with patch zero' => ['2.0.0', TRUE], - 'semver with pre-release' => ['1.2.3-beta', TRUE], - 'semver with pre-release alpha' => ['1.2.3-alpha.1', TRUE], - 'semver with pre-release numbered' => ['1.2.3-beta.1', TRUE], - 'semver with build metadata' => ['1.2.3+20130313144700', TRUE], - 'semver with build metadata simple' => ['1.2.3+build', TRUE], - 'semver with pre-release and build' => ['1.2.3-alpha.1+build.123', TRUE], - - // Calendar versioning tags. - 'calver YY.MM.PATCH' => ['24.10.0', TRUE], - 'calver YY.MM.PATCH with higher version' => ['25.11.0', TRUE], - 'calver YYYY.MM.PATCH' => ['2024.12.3', TRUE], - - // Drupal-style versioning. - 'drupal 8.x version' => ['8.x-1.10', TRUE], - 'drupal 9.x version' => ['9.x-2.3', TRUE], - 'drupal 10.x version' => ['10.x-1.0', TRUE], - - // Hybrid versioning (SemVer with CalVer build metadata). - 'semver+calver hybrid' => ['1.0.0+2025.11.0', TRUE], - 'semver+calver hybrid v2' => ['1.2.0+2025.12.0', TRUE], - 'semver+calver with pre-release' => ['1.0.0-beta+2025.11.0', TRUE], - - // Pre-release tags. - 'pre-release rc' => ['1.x-rc1', TRUE], - 'pre-release beta' => ['2.0.0-beta', TRUE], - 'pre-release alpha' => ['3.0.0-alpha', TRUE], - - // Branch names. - 'branch main' => ['main', TRUE], - 'branch master' => ['master', TRUE], - 'branch develop' => ['develop', TRUE], - 'branch feature with slash' => ['feature/my-feature', TRUE], - 'branch bugfix with slash' => ['bugfix/fix-123', TRUE], - 'branch release with slash' => ['release/1.0', TRUE], - - // Invalid formats - special characters. - 'invalid with @' => ['invalid@ref', FALSE], - 'invalid with ^' => ['invalid^ref', FALSE], - 'invalid with ~' => ['invalid~ref', FALSE], - 'invalid with :' => ['invalid:ref', FALSE], - 'invalid with ?' => ['invalid?ref', FALSE], - 'invalid with *' => ['invalid*ref', FALSE], - 'invalid with [' => ['invalid[ref', FALSE], - 'invalid with space' => ['invalid ref', FALSE], - 'invalid with backslash' => ['invalid\ref', FALSE], - 'invalid with @{' => ['invalid@{ref', FALSE], - - // Invalid formats - starting/ending patterns. - 'invalid starting with dot' => ['.invalid', FALSE], - 'invalid starting with hyphen' => ['-invalid', FALSE], - 'invalid ending with .lock' => ['invalid.lock', FALSE], - 'invalid containing ..' => ['invalid..ref', FALSE], - 'invalid trailing slash' => ['feature/', FALSE], - 'invalid consecutive slashes' => ['feature//name', FALSE], - - // Empty and edge cases. - 'invalid empty string' => ['', FALSE], - 'invalid only spaces' => [' ', FALSE], - ]; + public static function dataProviderGitRef(): \Iterator { + // Special keywords. + yield 'special keyword stable' => ['stable', TRUE]; + yield 'special keyword HEAD' => ['HEAD', TRUE]; + // Commit hashes (already tested, but included for completeness). + yield 'valid 40-char commit hash' => ['a1b2c3d4e5f6789012345678901234567890abcd', TRUE]; + yield 'valid 7-char commit hash' => ['a1b2c3d', TRUE]; + // Semantic versioning tags. + yield 'semver without prefix' => ['1.2.3', TRUE]; + yield 'semver with v prefix' => ['v1.2.3', TRUE]; + yield 'semver with patch zero' => ['2.0.0', TRUE]; + yield 'semver with pre-release' => ['1.2.3-beta', TRUE]; + yield 'semver with pre-release alpha' => ['1.2.3-alpha.1', TRUE]; + yield 'semver with pre-release numbered' => ['1.2.3-beta.1', TRUE]; + yield 'semver with build metadata' => ['1.2.3+20130313144700', TRUE]; + yield 'semver with build metadata simple' => ['1.2.3+build', TRUE]; + yield 'semver with pre-release and build' => ['1.2.3-alpha.1+build.123', TRUE]; + // Calendar versioning tags. + yield 'calver YY.MM.PATCH' => ['24.10.0', TRUE]; + yield 'calver YY.MM.PATCH with higher version' => ['25.11.0', TRUE]; + yield 'calver YYYY.MM.PATCH' => ['2024.12.3', TRUE]; + // Drupal-style versioning. + yield 'drupal 8.x version' => ['8.x-1.10', TRUE]; + yield 'drupal 9.x version' => ['9.x-2.3', TRUE]; + yield 'drupal 10.x version' => ['10.x-1.0', TRUE]; + // Hybrid versioning (SemVer with CalVer build metadata). + yield 'semver+calver hybrid' => ['1.0.0+2025.11.0', TRUE]; + yield 'semver+calver hybrid v2' => ['1.2.0+2025.12.0', TRUE]; + yield 'semver+calver with pre-release' => ['1.0.0-beta+2025.11.0', TRUE]; + // Pre-release tags. + yield 'pre-release rc' => ['1.x-rc1', TRUE]; + yield 'pre-release beta' => ['2.0.0-beta', TRUE]; + yield 'pre-release alpha' => ['3.0.0-alpha', TRUE]; + // Branch names. + yield 'branch main' => ['main', TRUE]; + yield 'branch master' => ['master', TRUE]; + yield 'branch develop' => ['develop', TRUE]; + yield 'branch feature with slash' => ['feature/my-feature', TRUE]; + yield 'branch bugfix with slash' => ['bugfix/fix-123', TRUE]; + yield 'branch release with slash' => ['release/1.0', TRUE]; + // Invalid formats - special characters. + yield 'invalid with @' => ['invalid@ref', FALSE]; + yield 'invalid with ^' => ['invalid^ref', FALSE]; + yield 'invalid with ~' => ['invalid~ref', FALSE]; + yield 'invalid with :' => ['invalid:ref', FALSE]; + yield 'invalid with ?' => ['invalid?ref', FALSE]; + yield 'invalid with *' => ['invalid*ref', FALSE]; + yield 'invalid with [' => ['invalid[ref', FALSE]; + yield 'invalid with space' => ['invalid ref', FALSE]; + yield 'invalid with backslash' => ['invalid\ref', FALSE]; + yield 'invalid with @{' => ['invalid@{ref', FALSE]; + // Invalid formats - starting/ending patterns. + yield 'invalid starting with dot' => ['.invalid', FALSE]; + yield 'invalid starting with hyphen' => ['-invalid', FALSE]; + yield 'invalid ending with .lock' => ['invalid.lock', FALSE]; + yield 'invalid containing ..' => ['invalid..ref', FALSE]; + yield 'invalid trailing slash' => ['feature/', FALSE]; + yield 'invalid consecutive slashes' => ['feature//name', FALSE]; + // Empty and edge cases. + yield 'invalid empty string' => ['', FALSE]; + yield 'invalid only spaces' => [' ', FALSE]; } } diff --git a/.vortex/installer/tests/Unit/YamlTest.php b/.vortex/installer/tests/Unit/YamlTest.php index 5c898c9a9..026529f6a 100644 --- a/.vortex/installer/tests/Unit/YamlTest.php +++ b/.vortex/installer/tests/Unit/YamlTest.php @@ -36,23 +36,21 @@ public function testValidateFileNonExistent(): void { Yaml::validateFile($non_existent_file); } - public static function dataProviderValidateFile(): array { - return [ - 'valid YAML file' => [ + public static function dataProviderValidateFile(): \Iterator { + yield 'valid YAML file' => [ << [ + ]; + yield 'invalid YAML syntax' => [ << [ + public static function dataProviderValidate(): \Iterator { + yield 'valid simple YAML' => [ << [ + ]; + yield 'valid complex YAML' => [ << [''], - 'valid YAML with arrays' => [ + ]; + yield 'valid empty YAML' => ['']; + yield 'valid YAML with arrays' => [ << [ + ]; + yield 'valid YAML with nested objects' => [ << [ + ]; + yield 'invalid YAML missing closing bracket' => [ << ['key: "unclosed string', 'Malformed inline YAML string'], - 'invalid YAML syntax' => [ + ]; + yield 'invalid YAML unclosed quotes' => ['key: "unclosed string', 'Malformed inline YAML string']; + yield 'invalid YAML syntax' => [ << [ + ]; + yield 'invalid YAML tabs mixed with spaces' => [ <<<'YAML' key: value1 value2 YAML, 'A YAML file cannot contain tabs', - ], ]; } @@ -138,9 +134,8 @@ public function testCollapseEmptyLinesInLiteralBlock(string $input, string $expe $this->assertEquals($expected, $result); } - public static function dataProviderCollapseEmptyLinesInLiteralBlock(): array { - return [ - 'no literal blocks' => [ + public static function dataProviderCollapseEmptyLinesInLiteralBlock(): \Iterator { + yield 'no literal blocks' => [ << [ + ]; + yield 'single empty line' => [ << [ + ]; + yield 'multiple empty lines' => [ << [ + ]; + yield 'multiple empty lines start and end' => [ << [ + ]; + yield 'multiple blocks with empty lines' => [ << [ + ]; + yield 'multiple blocks with empty lines with line between' => [ << [ + ]; + yield 'multiple blocks with empty lines with multiple lines between' => [ << [ + ]; + yield 'multiple blocks with empty lines with multiple lines between and same level' => [ << [ + ]; + yield 'no empty lines' => [ << [ + ]; + yield 'end of document with empty lines' => [ << [ + ]; + yield 'full document' => [ <<assertEquals($expected, $result); } - public static function dataProviderCollapseFirstEmptyLinesInLiteralBlock(): array { - return [ - 'no empty lines' => [ + public static function dataProviderCollapseFirstEmptyLinesInLiteralBlock(): \Iterator { + yield 'no empty lines' => [ << [ + ]; + yield '1 empty line at start' => [ << [ + ]; + yield '2 empty lines at start' => [ << [ + ]; + yield '2 empty lines at start and 2 in middle' => [ <<assertFileEquals($expected_file, 'docker-compose.actual.json', 'Docker Compose configuration should match expected fixture'); } - public static function dataProviderDockerComposeConfig(): array { - return [ - ['docker-compose.noenv.json'], - [ - 'docker-compose.env.json', - function (): void { + public static function dataProviderDockerComposeConfig(): \Iterator { + yield ['docker-compose.noenv.json']; + yield [ + 'docker-compose.env.json', + function (): void { File::copy(static::$root . '/.env', '.env'); - }, - ], - [ - 'docker-compose.env_mod.json', - function (FunctionalTestCase $test): void { + }, + ]; + yield [ + 'docker-compose.env_mod.json', + function (FunctionalTestCase $test): void { File::copy(static::$root . '/.env', '.env'); // Add modified environment variables. @@ -75,15 +74,14 @@ function (FunctionalTestCase $test): void { $test->fileAddVar('.env', 'DRUPAL_SHIELD_PASS', 'passw'); $test->fileAddVar('.env', 'DRUPAL_REDIS_ENABLED', '1'); $test->fileAddVar('.env', 'LAGOON_ENVIRONMENT_TYPE', 'development'); - }, - ], - [ - 'docker-compose.env_local.json', - function (): void { + }, + ]; + yield [ + 'docker-compose.env_local.json', + function (): void { File::copy(static::$root . '/.env', '.env'); File::copy(static::$root . '/.env.local.example', '.env.local'); - }, - ], + }, ]; } diff --git a/.vortex/tests/rector.php b/.vortex/tests/rector.php index 5a09b2c7e..5bc6f6f63 100644 --- a/.vortex/tests/rector.php +++ b/.vortex/tests/rector.php @@ -26,6 +26,7 @@ use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector; use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; +use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector; use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; @@ -76,6 +77,7 @@ // Additional rules. ->withRules([ DeclareStrictTypesRector::class, + YieldDataProviderRector::class, ]) ->withFileExtensions([ 'php', diff --git a/rector.php b/rector.php index fd931800f..d53dbdfdf 100644 --- a/rector.php +++ b/rector.php @@ -36,6 +36,7 @@ use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector; use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector; use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; +use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector; use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; @@ -98,6 +99,7 @@ // Additional rules. ->withRules([ DeclareStrictTypesRector::class, + YieldDataProviderRector::class, ]) // Configure Drupal autoloading. ->withAutoloadPaths((function (): array { diff --git a/tests/phpunit/CircleCiConfigTest.php b/tests/phpunit/CircleCiConfigTest.php index 370bccded..22dc50ce6 100644 --- a/tests/phpunit/CircleCiConfigTest.php +++ b/tests/phpunit/CircleCiConfigTest.php @@ -54,165 +54,163 @@ public function testDeployBranchRegex(string $branch, bool $expected = TRUE): vo /** * Data provider for testDeployBranchRegex(). */ - public static function dataProviderDeployBranchRegex(): array { - return [ - // Positive branches. - ['production'], - ['main'], - ['master'], - ['develop'], + public static function dataProviderDeployBranchRegex(): \Iterator { + // Positive branches. + yield ['production']; + yield ['main']; + yield ['master']; + yield ['develop']; - ['ci'], - ['cisomething'], + yield ['ci']; + yield ['cisomething']; - ['release/123.456.789'], - ['release/123.456.789-rc.123'], - ['hotfix/123.456.789'], - ['hotfix/123.456.789-rc.123'], + yield ['release/123.456.789']; + yield ['release/123.456.789-rc.123']; + yield ['hotfix/123.456.789']; + yield ['hotfix/123.456.789-rc.123']; - ['release/2023-04-17'], - ['release/2023-04-17.1'], - ['hotfix/2023-04-17'], - ['hotfix/2023-04-17.1'], + yield ['release/2023-04-17']; + yield ['release/2023-04-17.1']; + yield ['hotfix/2023-04-17']; + yield ['hotfix/2023-04-17.1']; - ['feature/description'], - ['feature/Description'], - ['feature/Description-With-Hyphens'], - ['feature/Description-With_Underscores'], - ['feature/123-description'], - ['feature/123-Description'], - ['feature/UNDERSCORES_UNDERSCORES'], - ['feature/123-Description-With_UNDERSCORES'], - ['feature/1.x'], - ['feature/0.x'], - ['feature/0.1.x'], - ['feature/0.1.2.x'], - ['feature/1.x-description'], - ['feature/0.x-description'], - ['feature/0.1.x-description'], - ['feature/0.1.2.x-description'], + yield ['feature/description']; + yield ['feature/Description']; + yield ['feature/Description-With-Hyphens']; + yield ['feature/Description-With_Underscores']; + yield ['feature/123-description']; + yield ['feature/123-Description']; + yield ['feature/UNDERSCORES_UNDERSCORES']; + yield ['feature/123-Description-With_UNDERSCORES']; + yield ['feature/1.x']; + yield ['feature/0.x']; + yield ['feature/0.1.x']; + yield ['feature/0.1.2.x']; + yield ['feature/1.x-description']; + yield ['feature/0.x-description']; + yield ['feature/0.1.x-description']; + yield ['feature/0.1.2.x-description']; - ['bugfix/description'], - ['bugfix/Description'], - ['bugfix/Description-With-Hyphens'], - ['bugfix/Description-With_Underscores'], - ['bugfix/123-description'], - ['bugfix/123-Description'], - ['bugfix/UNDERSCORES_UNDERSCORES'], - ['bugfix/123-Description-With_UNDERSCORES'], - ['bugfix/1.x'], - ['bugfix/0.x'], - ['bugfix/0.1.x'], - ['bugfix/0.1.2.x'], - ['bugfix/1.x-description'], - ['bugfix/0.x-description'], - ['bugfix/0.1.x-description'], - ['bugfix/0.1.2.x-description'], + yield ['bugfix/description']; + yield ['bugfix/Description']; + yield ['bugfix/Description-With-Hyphens']; + yield ['bugfix/Description-With_Underscores']; + yield ['bugfix/123-description']; + yield ['bugfix/123-Description']; + yield ['bugfix/UNDERSCORES_UNDERSCORES']; + yield ['bugfix/123-Description-With_UNDERSCORES']; + yield ['bugfix/1.x']; + yield ['bugfix/0.x']; + yield ['bugfix/0.1.x']; + yield ['bugfix/0.1.2.x']; + yield ['bugfix/1.x-description']; + yield ['bugfix/0.x-description']; + yield ['bugfix/0.1.x-description']; + yield ['bugfix/0.1.2.x-description']; - ['project/description'], - ['project/Description'], - ['project/Description-With-Hyphens'], - ['project/123-description'], - ['project/123-Description'], - ['project/1.x'], - ['project/0.x'], - ['project/0.1.x'], - ['project/0.1.2.x'], - ['project/1.x-description'], - ['project/0.x-description'], - ['project/0.1.x-description'], - ['project/0.1.2.x-description'], + yield ['project/description']; + yield ['project/Description']; + yield ['project/Description-With-Hyphens']; + yield ['project/123-description']; + yield ['project/123-Description']; + yield ['project/1.x']; + yield ['project/0.x']; + yield ['project/0.1.x']; + yield ['project/0.1.2.x']; + yield ['project/1.x-description']; + yield ['project/0.x-description']; + yield ['project/0.1.x-description']; + yield ['project/0.1.2.x-description']; - // Negative branches. - ['something', FALSE], - ['premain', FALSE], - ['premaster', FALSE], - ['predevelop', FALSE], - ['mainpost', FALSE], - ['masterpost', FALSE], - ['developpost', FALSE], - ['premainpost', FALSE], - ['premasterpost', FALSE], - ['predeveloppost', FALSE], + // Negative branches. + yield ['something', FALSE]; + yield ['premain', FALSE]; + yield ['premaster', FALSE]; + yield ['predevelop', FALSE]; + yield ['mainpost', FALSE]; + yield ['masterpost', FALSE]; + yield ['developpost', FALSE]; + yield ['premainpost', FALSE]; + yield ['premasterpost', FALSE]; + yield ['predeveloppost', FALSE]; - ['preci', FALSE], - ['precipost', FALSE], + yield ['preci', FALSE]; + yield ['precipost', FALSE]; - ['deps/something', FALSE], - ['deps', FALSE], - ['predeps', FALSE], - ['depspost', FALSE], - ['predepspost', FALSE], + yield ['deps/something', FALSE]; + yield ['deps', FALSE]; + yield ['predeps', FALSE]; + yield ['depspost', FALSE]; + yield ['predepspost', FALSE]; - ['feature', FALSE], - ['release', FALSE], - ['hotfix', FALSE], - ['prefeature', FALSE], - ['prerelease', FALSE], - ['prehotfix', FALSE], - ['featurepost', FALSE], - ['releasepost', FALSE], - ['hotfixpost', FALSE], - ['prefeaturepost', FALSE], - ['prereleasepost', FALSE], - ['prehotfixpost', FALSE], + yield ['feature', FALSE]; + yield ['release', FALSE]; + yield ['hotfix', FALSE]; + yield ['prefeature', FALSE]; + yield ['prerelease', FALSE]; + yield ['prehotfix', FALSE]; + yield ['featurepost', FALSE]; + yield ['releasepost', FALSE]; + yield ['hotfixpost', FALSE]; + yield ['prefeaturepost', FALSE]; + yield ['prereleasepost', FALSE]; + yield ['prehotfixpost', FALSE]; - ['release/123', FALSE], - ['release/123.456', FALSE], - ['hotfix/123', FALSE], - ['hotfix/123.456', FALSE], + yield ['release/123', FALSE]; + yield ['release/123.456', FALSE]; + yield ['hotfix/123', FALSE]; + yield ['hotfix/123.456', FALSE]; - ['release/202-04-17', FALSE], - ['release/2023-4-17', FALSE], - ['release/2023-04-1', FALSE], - ['release/pre2023-04-17', FALSE], - ['release/2023-04-17post', FALSE], - ['release/pre2023-04-17post', FALSE], + yield ['release/202-04-17', FALSE]; + yield ['release/2023-4-17', FALSE]; + yield ['release/2023-04-1', FALSE]; + yield ['release/pre2023-04-17', FALSE]; + yield ['release/2023-04-17post', FALSE]; + yield ['release/pre2023-04-17post', FALSE]; - ['hotfix/202-04-17', FALSE], - ['hotfix/2023-4-17', FALSE], - ['hotfix/2023-04-1', FALSE], - ['hotfix/pre2023-04-17', FALSE], - ['hotfix/2023-04-17post', FALSE], - ['hotfix/pre2023-04-17post', FALSE], + yield ['hotfix/202-04-17', FALSE]; + yield ['hotfix/2023-4-17', FALSE]; + yield ['hotfix/2023-04-1', FALSE]; + yield ['hotfix/pre2023-04-17', FALSE]; + yield ['hotfix/2023-04-17post', FALSE]; + yield ['hotfix/pre2023-04-17post', FALSE]; - ['release/123.456.789-something', FALSE], - ['release/123.456.789-rc', FALSE], - ['release/123.456.789-rc123', FALSE], - ['release/123.456.789-rc-123', FALSE], - ['release/123.456.789-prerc123', FALSE], - ['release/123.456.789-rcpost123', FALSE], - ['release/123.456.789-prercpost123', FALSE], - ['release/123.456.789-rc123something', FALSE], - ['release/123.456.789-rc.123something', FALSE], - ['release/123.456.789-rc.123-something', FALSE], + yield ['release/123.456.789-something', FALSE]; + yield ['release/123.456.789-rc', FALSE]; + yield ['release/123.456.789-rc123', FALSE]; + yield ['release/123.456.789-rc-123', FALSE]; + yield ['release/123.456.789-prerc123', FALSE]; + yield ['release/123.456.789-rcpost123', FALSE]; + yield ['release/123.456.789-prercpost123', FALSE]; + yield ['release/123.456.789-rc123something', FALSE]; + yield ['release/123.456.789-rc.123something', FALSE]; + yield ['release/123.456.789-rc.123-something', FALSE]; - ['hotfix/123.456.789-something', FALSE], - ['hotfix/123.456.789-rc', FALSE], - ['hotfix/123.456.789-rc123', FALSE], - ['hotfix/123.456.789-rc-123', FALSE], - ['hotfix/123.456.789-prerc123', FALSE], - ['hotfix/123.456.789-rcpost123', FALSE], - ['hotfix/123.456.789-prercpost123', FALSE], - ['hotfix/123.456.789-rc123something', FALSE], - ['hotfix/123.456.789-rc.123something', FALSE], - ['hotfix/123.456.789-rc.123-something', FALSE], + yield ['hotfix/123.456.789-something', FALSE]; + yield ['hotfix/123.456.789-rc', FALSE]; + yield ['hotfix/123.456.789-rc123', FALSE]; + yield ['hotfix/123.456.789-rc-123', FALSE]; + yield ['hotfix/123.456.789-prerc123', FALSE]; + yield ['hotfix/123.456.789-rcpost123', FALSE]; + yield ['hotfix/123.456.789-prercpost123', FALSE]; + yield ['hotfix/123.456.789-rc123something', FALSE]; + yield ['hotfix/123.456.789-rc.123something', FALSE]; + yield ['hotfix/123.456.789-rc.123-something', FALSE]; - ['prefeature/something', FALSE], - ['prefbugfix/something', FALSE], - ['prerelease/something', FALSE], - ['prehotfix/something', FALSE], - ['featurepost/something', FALSE], - ['bugfixpost/something', FALSE], - ['releasepost/something', FALSE], - ['hotfixpost/something', FALSE], - ['prefeaturepost/something', FALSE], - ['prebugfixpost/something', FALSE], - ['prereleasepost/something', FALSE], - ['prehotfixpost/something', FALSE], - ['preproject/something', FALSE], - ['projectpost/something', FALSE], - ]; + yield ['prefeature/something', FALSE]; + yield ['prefbugfix/something', FALSE]; + yield ['prerelease/something', FALSE]; + yield ['prehotfix/something', FALSE]; + yield ['featurepost/something', FALSE]; + yield ['bugfixpost/something', FALSE]; + yield ['releasepost/something', FALSE]; + yield ['hotfixpost/something', FALSE]; + yield ['prefeaturepost/something', FALSE]; + yield ['prebugfixpost/something', FALSE]; + yield ['prereleasepost/something', FALSE]; + yield ['prehotfixpost/something', FALSE]; + yield ['preproject/something', FALSE]; + yield ['projectpost/something', FALSE]; } /** @@ -228,34 +226,32 @@ public function testDeployTagRegex(string $branch, bool $expected = TRUE): void /** * Data provider for testDeployTagRegex(). */ - public static function dataProviderDeployTagRegex(): array { - return [ - // Positive tags. - ['1.2.3'], - ['1.2.3-rc.123'], - ['2023-04-17'], - ['2023-04-17.123'], + public static function dataProviderDeployTagRegex(): \Iterator { + // Positive tags. + yield ['1.2.3']; + yield ['1.2.3-rc.123']; + yield ['2023-04-17']; + yield ['2023-04-17.123']; - // Negative tags. - ['123', FALSE], - ['123.456', FALSE], - ['1.2.3-rc123', FALSE], - ['1.2.3-rc.123post', FALSE], - ['1.2.3-prerc.123', FALSE], - ['1.2.3-rcpost.123', FALSE], - ['1.2.3-prercpost.123', FALSE], + // Negative tags. + yield ['123', FALSE]; + yield ['123.456', FALSE]; + yield ['1.2.3-rc123', FALSE]; + yield ['1.2.3-rc.123post', FALSE]; + yield ['1.2.3-prerc.123', FALSE]; + yield ['1.2.3-rcpost.123', FALSE]; + yield ['1.2.3-prercpost.123', FALSE]; - ['202-04-17', FALSE], - ['2023-0-17', FALSE], - ['2023-04-1', FALSE], - ['pre2023-04-17', FALSE], - ['2023-04-17post', FALSE], - ['pre2023-04-17post', FALSE], - ['2023-04-17.123.', FALSE], - ['2023-04-17.pre123', FALSE], - ['2023-04-17.pre123post', FALSE], - ['2023-04-17.123post', FALSE], - ]; + yield ['202-04-17', FALSE]; + yield ['2023-0-17', FALSE]; + yield ['2023-04-1', FALSE]; + yield ['pre2023-04-17', FALSE]; + yield ['2023-04-17post', FALSE]; + yield ['pre2023-04-17post', FALSE]; + yield ['2023-04-17.123.', FALSE]; + yield ['2023-04-17.pre123', FALSE]; + yield ['2023-04-17.pre123post', FALSE]; + yield ['2023-04-17.123post', FALSE]; } } diff --git a/tests/phpunit/Drupal/DatabaseSettingsTest.php b/tests/phpunit/Drupal/DatabaseSettingsTest.php index e66758c36..8545f8dda 100644 --- a/tests/phpunit/Drupal/DatabaseSettingsTest.php +++ b/tests/phpunit/Drupal/DatabaseSettingsTest.php @@ -30,197 +30,196 @@ public function testDatabases(array $vars, array $expected): void { /** * Data provider for resulting database settings. */ - public static function dataProviderDatabases(): array { - return [ + public static function dataProviderDatabases(): \Iterator { + yield [ + [], [ - [], - [ + 'default' => [ 'default' => [ - 'default' => [ - 'database' => 'drupal', - 'username' => 'drupal', - 'password' => 'drupal', - 'host' => 'localhost', - 'port' => '3306', - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_general_ci', - 'driver' => 'mysql', - 'prefix' => '', - ], + 'database' => 'drupal', + 'username' => 'drupal', + 'password' => 'drupal', + 'host' => 'localhost', + 'port' => '3306', + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_general_ci', + 'driver' => 'mysql', + 'prefix' => '', ], - // phpcs:ignore #;< MIGRATION - 'migrate' => [ - 'default' => [ - 'database' => 'drupal', - 'username' => 'drupal', - 'password' => 'drupal', - 'host' => 'localhost', - 'port' => '', - 'prefix' => '', - 'driver' => 'mysql', - ], + ], + // phpcs:ignore #;< MIGRATION + 'migrate' => [ + 'default' => [ + 'database' => 'drupal', + 'username' => 'drupal', + 'password' => 'drupal', + 'host' => 'localhost', + 'port' => '', + 'prefix' => '', + 'driver' => 'mysql', ], - // phpcs:ignore #;> MIGRATION ], + // phpcs:ignore #;> MIGRATION ], + ]; + yield [ [ - [ - 'DATABASE_NAME' => 'database_db_name', - 'DATABASE_USERNAME' => 'database_db_user', - 'DATABASE_PASSWORD' => 'database_db_pass', - 'DATABASE_HOST' => 'database_db_host', - 'DATABASE_PORT' => 'database_db_port', - 'DATABASE_CHARSET' => 'database_utf8', - 'DATABASE_COLLATION' => 'database_utf8_unicode_ci', - ], - [ + 'DATABASE_NAME' => 'database_db_name', + 'DATABASE_USERNAME' => 'database_db_user', + 'DATABASE_PASSWORD' => 'database_db_pass', + 'DATABASE_HOST' => 'database_db_host', + 'DATABASE_PORT' => 'database_db_port', + 'DATABASE_CHARSET' => 'database_utf8', + 'DATABASE_COLLATION' => 'database_utf8_unicode_ci', + ], + [ + 'default' => [ 'default' => [ - 'default' => [ - 'database' => 'database_db_name', - 'username' => 'database_db_user', - 'password' => 'database_db_pass', - 'host' => 'database_db_host', - 'port' => 'database_db_port', - 'charset' => 'database_utf8', - 'collation' => 'database_utf8_unicode_ci', - 'driver' => 'mysql', - 'prefix' => '', - ], + 'database' => 'database_db_name', + 'username' => 'database_db_user', + 'password' => 'database_db_pass', + 'host' => 'database_db_host', + 'port' => 'database_db_port', + 'charset' => 'database_utf8', + 'collation' => 'database_utf8_unicode_ci', + 'driver' => 'mysql', + 'prefix' => '', ], - // phpcs:ignore #;< MIGRATION - 'migrate' => [ - 'default' => [ - 'database' => 'drupal', - 'username' => 'drupal', - 'password' => 'drupal', - 'host' => 'localhost', - 'port' => '', - 'prefix' => '', - 'driver' => 'mysql', - ], + ], + // phpcs:ignore #;< MIGRATION + 'migrate' => [ + 'default' => [ + 'database' => 'drupal', + 'username' => 'drupal', + 'password' => 'drupal', + 'host' => 'localhost', + 'port' => '', + 'prefix' => '', + 'driver' => 'mysql', ], - // phpcs:ignore #;> MIGRATION ], + // phpcs:ignore #;> MIGRATION ], + ]; + yield [ [ - [ - 'MARIADB_DATABASE' => 'mariadb_db_name', - 'MARIADB_USERNAME' => 'mariadb_db_user', - 'MARIADB_PASSWORD' => 'mariadb_db_pass', - 'MARIADB_HOST' => 'mariadb_db_host', - 'MARIADB_PORT' => 'mariadb_db_port', - 'MARIADB_CHARSET' => 'mariadb_latin1', - 'MARIADB_COLLATION' => 'mariadb_latin1_swedish_ci', - ], - [ + 'MARIADB_DATABASE' => 'mariadb_db_name', + 'MARIADB_USERNAME' => 'mariadb_db_user', + 'MARIADB_PASSWORD' => 'mariadb_db_pass', + 'MARIADB_HOST' => 'mariadb_db_host', + 'MARIADB_PORT' => 'mariadb_db_port', + 'MARIADB_CHARSET' => 'mariadb_latin1', + 'MARIADB_COLLATION' => 'mariadb_latin1_swedish_ci', + ], + [ + 'default' => [ 'default' => [ - 'default' => [ - 'database' => 'mariadb_db_name', - 'username' => 'mariadb_db_user', - 'password' => 'mariadb_db_pass', - 'host' => 'mariadb_db_host', - 'port' => 'mariadb_db_port', - 'charset' => 'mariadb_latin1', - 'collation' => 'mariadb_latin1_swedish_ci', - 'driver' => 'mysql', - 'prefix' => '', - ], + 'database' => 'mariadb_db_name', + 'username' => 'mariadb_db_user', + 'password' => 'mariadb_db_pass', + 'host' => 'mariadb_db_host', + 'port' => 'mariadb_db_port', + 'charset' => 'mariadb_latin1', + 'collation' => 'mariadb_latin1_swedish_ci', + 'driver' => 'mysql', + 'prefix' => '', ], - // phpcs:ignore #;< MIGRATION - 'migrate' => [ - 'default' => [ - 'database' => 'drupal', - 'username' => 'drupal', - 'password' => 'drupal', - 'host' => 'localhost', - 'port' => '', - 'prefix' => '', - 'driver' => 'mysql', - ], + ], + // phpcs:ignore #;< MIGRATION + 'migrate' => [ + 'default' => [ + 'database' => 'drupal', + 'username' => 'drupal', + 'password' => 'drupal', + 'host' => 'localhost', + 'port' => '', + 'prefix' => '', + 'driver' => 'mysql', ], - // phpcs:ignore #;> MIGRATION ], + // phpcs:ignore #;> MIGRATION ], + ]; + yield [ [ - [ - 'DATABASE_DATABASE' => 'database_db_name', - 'DATABASE_USERNAME' => 'database_db_user', - 'DATABASE_PASSWORD' => 'database_db_pass', - 'DATABASE_HOST' => 'database_db_host', - 'DATABASE_PORT' => 'database_db_port', - 'MYSQL_CHARSET' => 'mysql_utf8mb3', - 'MYSQL_COLLATION' => 'mysql_utf8mb3_bin', - ], - [ + 'DATABASE_DATABASE' => 'database_db_name', + 'DATABASE_USERNAME' => 'database_db_user', + 'DATABASE_PASSWORD' => 'database_db_pass', + 'DATABASE_HOST' => 'database_db_host', + 'DATABASE_PORT' => 'database_db_port', + 'MYSQL_CHARSET' => 'mysql_utf8mb3', + 'MYSQL_COLLATION' => 'mysql_utf8mb3_bin', + ], + [ + 'default' => [ 'default' => [ - 'default' => [ - 'database' => 'database_db_name', - 'username' => 'database_db_user', - 'password' => 'database_db_pass', - 'host' => 'database_db_host', - 'port' => 'database_db_port', - 'charset' => 'mysql_utf8mb3', - 'collation' => 'mysql_utf8mb3_bin', - 'driver' => 'mysql', - 'prefix' => '', - ], + 'database' => 'database_db_name', + 'username' => 'database_db_user', + 'password' => 'database_db_pass', + 'host' => 'database_db_host', + 'port' => 'database_db_port', + 'charset' => 'mysql_utf8mb3', + 'collation' => 'mysql_utf8mb3_bin', + 'driver' => 'mysql', + 'prefix' => '', ], - // phpcs:ignore #;< MIGRATION - 'migrate' => [ - 'default' => [ - 'database' => 'drupal', - 'username' => 'drupal', - 'password' => 'drupal', - 'host' => 'localhost', - 'port' => '', - 'prefix' => '', - 'driver' => 'mysql', - ], + ], + // phpcs:ignore #;< MIGRATION + 'migrate' => [ + 'default' => [ + 'database' => 'drupal', + 'username' => 'drupal', + 'password' => 'drupal', + 'host' => 'localhost', + 'port' => '', + 'prefix' => '', + 'driver' => 'mysql', ], - // phpcs:ignore #;> MIGRATION ], + // phpcs:ignore #;> MIGRATION ], - // phpcs:ignore #;< MIGRATION + ]; + + // phpcs:ignore #;< MIGRATION + yield [ [ - [ - 'DATABASE2_NAME' => 'migrate_db_name', - 'DATABASE2_USERNAME' => 'migrate_db_user', - 'DATABASE2_PASSWORD' => 'migrate_db_pass', - 'DATABASE2_HOST' => 'migrate_db_host', - 'DATABASE2_PORT' => '3307', - ], - [ + 'DATABASE2_NAME' => 'migrate_db_name', + 'DATABASE2_USERNAME' => 'migrate_db_user', + 'DATABASE2_PASSWORD' => 'migrate_db_pass', + 'DATABASE2_HOST' => 'migrate_db_host', + 'DATABASE2_PORT' => '3307', + ], + [ + 'default' => [ 'default' => [ - 'default' => [ - 'database' => 'drupal', - 'username' => 'drupal', - 'password' => 'drupal', - 'host' => 'localhost', - 'port' => '3306', - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_general_ci', - 'driver' => 'mysql', - 'prefix' => '', - ], + 'database' => 'drupal', + 'username' => 'drupal', + 'password' => 'drupal', + 'host' => 'localhost', + 'port' => '3306', + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_general_ci', + 'driver' => 'mysql', + 'prefix' => '', ], - 'migrate' => [ - 'default' => [ - 'database' => 'migrate_db_name', - 'username' => 'migrate_db_user', - 'password' => 'migrate_db_pass', - 'host' => 'migrate_db_host', - 'port' => '3307', - 'prefix' => '', - 'driver' => 'mysql', - ], + ], + 'migrate' => [ + 'default' => [ + 'database' => 'migrate_db_name', + 'username' => 'migrate_db_user', + 'password' => 'migrate_db_pass', + 'host' => 'migrate_db_host', + 'port' => '3307', + 'prefix' => '', + 'driver' => 'mysql', ], ], ], - // phpcs:ignore #;> MIGRATION ]; + // phpcs:ignore #;> MIGRATION } } diff --git a/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 38ce8d897..9191c5f84 100644 --- a/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -38,256 +38,254 @@ public function testEnvironmentTypeDetection(array $vars, string $expected_env): /** * Data provider for testing environment type detection. */ - public static function dataProviderEnvironmentTypeDetection(): array { - return [ - // By default, the default environment type is local. - [[], self::ENVIRONMENT_LOCAL], + public static function dataProviderEnvironmentTypeDetection(): \Iterator { + // By default, the default environment type is local. + yield [[], self::ENVIRONMENT_LOCAL]; - // CI. + // CI. + yield [ [ - [ - 'CI' => 1, - ], - self::ENVIRONMENT_CI, + 'CI' => 1, ], + self::ENVIRONMENT_CI, + ]; - // Container. + // Container. + yield [ [ - [ - 'VORTEX_LOCALDEV_URL' => 'https://example-site.docker.amazee.io', - ], - self::ENVIRONMENT_LOCAL, + 'VORTEX_LOCALDEV_URL' => 'https://example-site.docker.amazee.io', ], + self::ENVIRONMENT_LOCAL, + ]; - // #;< SETTINGS_PROVIDER_ACQUIA - // Acquia. + // #;< SETTINGS_PROVIDER_ACQUIA + // Acquia. + yield [ [ - [ - 'AH_SITE_ENVIRONMENT' => TRUE, - ], - self::ENVIRONMENT_DEV, + 'AH_SITE_ENVIRONMENT' => TRUE, ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'AH_SITE_ENVIRONMENT' => 'prod', - ], - self::ENVIRONMENT_PROD, + 'AH_SITE_ENVIRONMENT' => 'prod', ], + self::ENVIRONMENT_PROD, + ]; + yield [ [ - [ - 'AH_SITE_ENVIRONMENT' => 'stage', - ], - self::ENVIRONMENT_STAGE, + 'AH_SITE_ENVIRONMENT' => 'stage', ], + self::ENVIRONMENT_STAGE, + ]; + yield [ [ - [ - 'AH_SITE_ENVIRONMENT' => 'test', - ], - self::ENVIRONMENT_STAGE, + 'AH_SITE_ENVIRONMENT' => 'test', ], + self::ENVIRONMENT_STAGE, + ]; + yield [ [ - [ - 'AH_SITE_ENVIRONMENT' => 'dev', - ], - self::ENVIRONMENT_DEV, + 'AH_SITE_ENVIRONMENT' => 'dev', ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'AH_SITE_ENVIRONMENT' => 'ode1', - ], - self::ENVIRONMENT_DEV, + 'AH_SITE_ENVIRONMENT' => 'ode1', ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'AH_SITE_ENVIRONMENT' => 'nonode1', - ], - self::ENVIRONMENT_DEV, + 'AH_SITE_ENVIRONMENT' => 'nonode1', ], - // phpcs:ignore #;> SETTINGS_PROVIDER_ACQUIA + self::ENVIRONMENT_DEV, + ]; + // phpcs:ignore #;> SETTINGS_PROVIDER_ACQUIA - // phpcs:ignore #;< SETTINGS_PROVIDER_LAGOON - // Lagoon. + // phpcs:ignore #;< SETTINGS_PROVIDER_LAGOON + // Lagoon. + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'production', - ], - self::ENVIRONMENT_PROD, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'production', ], + self::ENVIRONMENT_PROD, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_GIT_BRANCH' => 'main', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - ], - self::ENVIRONMENT_PROD, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_GIT_BRANCH' => 'main', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'main', + 'LAGOON_ENVIRONMENT_TYPE' => 'development', ], + self::ENVIRONMENT_PROD, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_GIT_BRANCH' => 'main', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - ], - self::ENVIRONMENT_STAGE, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_GIT_BRANCH' => 'main', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'master', + 'LAGOON_ENVIRONMENT_TYPE' => 'development', ], + self::ENVIRONMENT_STAGE, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_GIT_BRANCH' => 'master', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - ], - self::ENVIRONMENT_STAGE, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_GIT_BRANCH' => 'master', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', ], + self::ENVIRONMENT_STAGE, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_GIT_BRANCH' => 'master', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, - 'LAGOON_ENVIRONMENT_TYPE' => 'production', - ], - self::ENVIRONMENT_PROD, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_GIT_BRANCH' => 'master', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'LAGOON_ENVIRONMENT_TYPE' => 'production', ], + self::ENVIRONMENT_PROD, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_GIT_BRANCH' => 'main', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - ], - self::ENVIRONMENT_STAGE, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_GIT_BRANCH' => 'main', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', ], + self::ENVIRONMENT_STAGE, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_GIT_BRANCH' => 'main', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, - 'LAGOON_ENVIRONMENT_TYPE' => 'production', - ], - self::ENVIRONMENT_PROD, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_GIT_BRANCH' => 'main', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, + 'LAGOON_ENVIRONMENT_TYPE' => 'production', ], + self::ENVIRONMENT_PROD, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => 'release', - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => 'release', ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => 'release/1.2.3', - ], - self::ENVIRONMENT_STAGE, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => 'release/1.2.3', ], + self::ENVIRONMENT_STAGE, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => 'hotfix', - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => 'hotfix', ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => 'hotfix/1.2.3', - ], - self::ENVIRONMENT_STAGE, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => 'hotfix/1.2.3', ], + self::ENVIRONMENT_STAGE, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => FALSE, - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => FALSE, ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => FALSE, - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => FALSE, + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => 'somebranch', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => 'somebranch', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => FALSE, ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => FALSE, - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => FALSE, + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => 'somebranch', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => 'somebranch', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'otherbranch', ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => '', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => '', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => '', ], + self::ENVIRONMENT_DEV, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - 'LAGOON_GIT_BRANCH' => 'mainbranch', - 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', - ], - self::ENVIRONMENT_PROD, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', + 'LAGOON_GIT_BRANCH' => 'mainbranch', + 'VORTEX_LAGOON_PRODUCTION_BRANCH' => 'mainbranch', ], + self::ENVIRONMENT_PROD, + ]; + yield [ [ - [ - 'LAGOON_KUBERNETES' => 1, - 'LAGOON_ENVIRONMENT_TYPE' => 'development', - ], - self::ENVIRONMENT_DEV, + 'LAGOON_KUBERNETES' => 1, + 'LAGOON_ENVIRONMENT_TYPE' => 'development', ], - // phpcs:ignore #;> SETTINGS_PROVIDER_LAGOON + self::ENVIRONMENT_DEV, ]; + // phpcs:ignore #;> SETTINGS_PROVIDER_LAGOON } /** diff --git a/tests/phpunit/Drupal/SwitchableSettingsTest.php b/tests/phpunit/Drupal/SwitchableSettingsTest.php index 64e19c60d..1719fbc39 100644 --- a/tests/phpunit/Drupal/SwitchableSettingsTest.php +++ b/tests/phpunit/Drupal/SwitchableSettingsTest.php @@ -98,71 +98,69 @@ public function testConfigSplit(string $env, array $expected_present, array $exp /** * Data provider for testConfigSplit(). */ - public static function dataProviderConfigSplit(): array { - return [ + public static function dataProviderConfigSplit(): \Iterator { + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_LOCAL, - [ - 'config_split.config_split.local' => ['status' => TRUE], - ], - [ - 'config_split.config_split.stage' => NULL, - 'config_split.config_split.dev' => NULL, - 'config_split.config_split.ci' => NULL, - ], + 'config_split.config_split.local' => ['status' => TRUE], ], [ - self::ENVIRONMENT_CI, - [ - 'config_split.config_split.ci' => ['status' => TRUE], - ], - [ - 'config_split.config_split.stage' => NULL, - 'config_split.config_split.dev' => NULL, - 'config_split.config_split.local' => NULL, - ], + 'config_split.config_split.stage' => NULL, + 'config_split.config_split.dev' => NULL, + 'config_split.config_split.ci' => NULL, ], + ]; + yield [ + self::ENVIRONMENT_CI, [ - self::ENVIRONMENT_DEV, - [ - 'config_split.config_split.dev' => ['status' => TRUE], - ], - [ - 'config_split.config_split.stage' => NULL, - 'config_split.config_split.ci' => NULL, - 'config_split.config_split.local' => NULL, - ], + 'config_split.config_split.ci' => ['status' => TRUE], ], [ - self::ENVIRONMENT_STAGE, - [ - 'config_split.config_split.stage' => ['status' => TRUE], - ], - [ - 'config_split.config_split.dev' => NULL, - 'config_split.config_split.ci' => NULL, - 'config_split.config_split.local' => NULL, - ], + 'config_split.config_split.stage' => NULL, + 'config_split.config_split.dev' => NULL, + 'config_split.config_split.local' => NULL, ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_PROD, - [], - [ - 'config_split.config_split.stage' => NULL, - 'config_split.config_split.dev' => NULL, - 'config_split.config_split.ci' => NULL, - 'config_split.config_split.local' => NULL, - ], + 'config_split.config_split.dev' => ['status' => TRUE], ], [ - self::ENVIRONMENT_SUT, - [], - [ - 'config_split.config_split.stage' => NULL, - 'config_split.config_split.dev' => NULL, - 'config_split.config_split.ci' => NULL, - 'config_split.config_split.local' => NULL, - ], + 'config_split.config_split.stage' => NULL, + 'config_split.config_split.ci' => NULL, + 'config_split.config_split.local' => NULL, + ], + ]; + yield [ + self::ENVIRONMENT_STAGE, + [ + 'config_split.config_split.stage' => ['status' => TRUE], + ], + [ + 'config_split.config_split.dev' => NULL, + 'config_split.config_split.ci' => NULL, + 'config_split.config_split.local' => NULL, + ], + ]; + yield [ + self::ENVIRONMENT_PROD, + [], + [ + 'config_split.config_split.stage' => NULL, + 'config_split.config_split.dev' => NULL, + 'config_split.config_split.ci' => NULL, + 'config_split.config_split.local' => NULL, + ], + ]; + yield [ + self::ENVIRONMENT_SUT, + [], + [ + 'config_split.config_split.stage' => NULL, + 'config_split.config_split.dev' => NULL, + 'config_split.config_split.ci' => NULL, + 'config_split.config_split.local' => NULL, ], ]; } @@ -188,49 +186,47 @@ public function testEnvironmentIndicator(string $env, array $expected_present, a /** * Data provider for testEnvironmentIndicator(). */ - public static function dataProviderEnvironmentIndicator(): array { - return [ + public static function dataProviderEnvironmentIndicator(): \Iterator { + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_LOCAL, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_LOCAL, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_LOCAL, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], + ]; + yield [ + self::ENVIRONMENT_CI, [ - self::ENVIRONMENT_CI, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_CI, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_CI, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_DEV, 'bg_color' => '#4caf50', 'fg_color' => '#000000'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_DEV, 'bg_color' => '#4caf50', 'fg_color' => '#000000'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], + ]; + yield [ + self::ENVIRONMENT_STAGE, [ - self::ENVIRONMENT_STAGE, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_STAGE, 'bg_color' => '#fff176', 'fg_color' => '#000000'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_STAGE, 'bg_color' => '#fff176', 'fg_color' => '#000000'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], + ]; + yield [ + self::ENVIRONMENT_PROD, [ - self::ENVIRONMENT_PROD, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_PROD, 'bg_color' => '#ef5350', 'fg_color' => '#000000'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_PROD, 'bg_color' => '#ef5350', 'fg_color' => '#000000'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], + ]; + yield [ + self::ENVIRONMENT_SUT, [ - self::ENVIRONMENT_SUT, - [ - 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_SUT, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], - 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], - ], + 'environment_indicator.indicator' => ['name' => self::ENVIRONMENT_SUT, 'bg_color' => '#006600', 'fg_color' => '#ffffff'], + 'environment_indicator.settings' => ['toolbar_integration' => [TRUE], 'favicon' => TRUE], ], ]; } @@ -330,358 +326,356 @@ public function testShield(string $env, array $vars, array $expected_present, ar /** * Data provider for testShield(). */ - public static function dataProviderShield(): array { - return [ + public static function dataProviderShield(): \Iterator { + yield [ + self::ENVIRONMENT_LOCAL, + [], [ - self::ENVIRONMENT_LOCAL, - [], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], - [ - 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'shield.settings' => ['shield_enable' => FALSE], ], [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], - [ - 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], ], + ]; + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + ], + [ + 'shield.settings' => ['shield_enable' => FALSE], + ], + [ + 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], ], + ]; + yield [ + self::ENVIRONMENT_LOCAL, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + ], + [ + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_CI, [ - self::ENVIRONMENT_CI, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', ], + [ + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', ], + [ + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_STAGE, [ - self::ENVIRONMENT_STAGE, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + ], + [ + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], ], + ]; + yield [ + self::ENVIRONMENT_PROD, [ - self::ENVIRONMENT_PROD, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', ], + [ + 'shield.settings' => ['credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + [ + 'shield.settings' => ['shield_enable' => FALSE], + ], + ]; + yield [ + self::ENVIRONMENT_SUT, [ - self::ENVIRONMENT_SUT, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', ], + [ + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => '', - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => '', ], + [ + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => 0, - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => 0, ], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => 1, - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], ], + ]; + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => 1, + ], + [ + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => '0', - ], - [ - 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => '0', ], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => '1', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'shield.settings' => ['shield_enable' => TRUE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => 'false', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => '1', ], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', - 'DRUPAL_SHIELD_DISABLED' => 'true', - ], - [ - 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], - ], + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => 'false', + ], + [ + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_PRINT' => 'drupal_shield_print', + 'DRUPAL_SHIELD_DISABLED' => 'true', ], + [ + 'shield.settings' => ['shield_enable' => FALSE, 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], 'print' => 'drupal_shield_print'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], + 'DRUPAL_SHIELD_DISABLED' => TRUE, ], [ - self::ENVIRONMENT_STAGE, - [ - 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], + 'shield.settings' => ['shield_enable' => FALSE], ], + ]; + yield [ + self::ENVIRONMENT_STAGE, [ - self::ENVIRONMENT_PROD, - [ - 'DRUPAL_SHIELD_DISABLED' => TRUE, - ], - [ - 'shield.settings' => ['shield_enable' => FALSE], - ], + 'DRUPAL_SHIELD_DISABLED' => TRUE, + ], + [ + 'shield.settings' => ['shield_enable' => FALSE], + ], + ]; + yield [ + self::ENVIRONMENT_PROD, + [ + 'DRUPAL_SHIELD_DISABLED' => TRUE, ], + [ + 'shield.settings' => ['shield_enable' => FALSE], + ], + ]; - // ACME challenge passthrough tests. + // ACME challenge passthrough tests. + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ - 'shield.settings' => [ - 'shield_enable' => TRUE, - 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - 'method' => 0, - 'paths' => '/.well-known/acme-challenge/*', - ], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, ], [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ - 'shield.settings' => [ - 'shield_enable' => FALSE, - 'method' => 0, - 'paths' => '/.well-known/acme-challenge/*', - ], + 'shield.settings' => [ + 'shield_enable' => TRUE, + 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], + 'method' => 0, + 'paths' => '/.well-known/acme-challenge/*', ], ], - // ACME challenge disabled - verify settings are absent. + ]; + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'shield.settings' => [ - 'shield_enable' => TRUE, - 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], - ], - [ - 'shield.settings' => ['method' => NULL, 'paths' => NULL], - ], + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, ], - // ACME challenge with empty value - should not set. [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => '', - ], - [ - 'shield.settings' => [ - 'shield_enable' => TRUE, - 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], - ], - [ - 'shield.settings' => ['method' => NULL, 'paths' => NULL], + 'shield.settings' => [ + 'shield_enable' => FALSE, + 'method' => 0, + 'paths' => '/.well-known/acme-challenge/*', ], ], - // ACME challenge with 0 value - should not set. + ]; + // ACME challenge disabled - verify settings are absent. + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 0, + 'shield.settings' => [ + 'shield_enable' => TRUE, + 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], ], - [ - 'shield.settings' => [ - 'shield_enable' => TRUE, - 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], - ], + ], + [ + 'shield.settings' => ['method' => NULL, 'paths' => NULL], + ], + ]; + // ACME challenge with empty value - should not set. + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => '', + ], + [ + 'shield.settings' => [ + 'shield_enable' => TRUE, + 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], ], - [ - 'shield.settings' => ['method' => NULL, 'paths' => NULL], + ], + [ + 'shield.settings' => ['method' => NULL, 'paths' => NULL], + ], + ]; + // ACME challenge with 0 value - should not set. + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 0, + ], + [ + 'shield.settings' => [ + 'shield_enable' => TRUE, + 'credentials' => ['shield' => ['user' => 'drupal_shield_user', 'pass' => 'drupal_shield_pass']], ], ], + [ + 'shield.settings' => ['method' => NULL, 'paths' => NULL], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ - 'shield.settings' => [ - 'method' => 0, - 'paths' => "/custom/path/*\n/.well-known/acme-challenge/*", - ], - ], - [], - [ - 'shield.settings' => ['paths' => '/custom/path/*'], - ], + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, ], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ - 'shield.settings' => [ - 'method' => 0, - 'paths' => "/.well-known/acme-challenge/*\n/other/path/*", - ], - ], - [], - [ - 'shield.settings' => ['paths' => "/.well-known/acme-challenge/*\n/other/path/*"], + 'shield.settings' => [ + 'method' => 0, + 'paths' => "/custom/path/*\n/.well-known/acme-challenge/*", ], ], + [], [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, - ], - [ - 'shield.settings' => [ - 'method' => 0, - 'paths' => "/admin/*\n/api/*\n/.well-known/acme-challenge/*", - ], + 'shield.settings' => ['paths' => '/custom/path/*'], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, + ], + [ + 'shield.settings' => [ + 'method' => 0, + 'paths' => "/.well-known/acme-challenge/*\n/other/path/*", ], - [], - [ - 'shield.settings' => ['paths' => "/admin/*\n/api/*"], + ], + [], + [ + 'shield.settings' => ['paths' => "/.well-known/acme-challenge/*\n/other/path/*"], + ], + ]; + yield [ + self::ENVIRONMENT_DEV, + [ + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + 'DRUPAL_SHIELD_ALLOW_ACME_CHALLENGE' => 1, + ], + [ + 'shield.settings' => [ + 'method' => 0, + 'paths' => "/admin/*\n/api/*\n/.well-known/acme-challenge/*", ], ], + [], + [ + 'shield.settings' => ['paths' => "/admin/*\n/api/*"], + ], ]; } @@ -704,114 +698,112 @@ public function testStageFileProxy(string $env, array $vars, array $expected_pre /** * Data provider for testStageFileProxy(). */ - public static function dataProviderStageFileProxy(): array { - return [ - [ - self::ENVIRONMENT_LOCAL, - [], - [], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], - ], + public static function dataProviderStageFileProxy(): \Iterator { + yield [ + self::ENVIRONMENT_LOCAL, + [], + [], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], ], + ]; + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', ], [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], - [], + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], ], + [], + ]; + yield [ + self::ENVIRONMENT_LOCAL, [ - self::ENVIRONMENT_LOCAL, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], + ], + [], + ]; + yield [ + self::ENVIRONMENT_LOCAL, + [ + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://example.com/'], ], + [], + ]; + yield [ + self::ENVIRONMENT_CI, [ - self::ENVIRONMENT_CI, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], ], + [], + ]; + yield [ + self::ENVIRONMENT_DEV, [ - self::ENVIRONMENT_DEV, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], ], + [], + ]; + yield [ + self::ENVIRONMENT_STAGE, [ - self::ENVIRONMENT_STAGE, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], + ], + [], + ]; + yield [ + self::ENVIRONMENT_PROD, [ - self::ENVIRONMENT_PROD, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], + [], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], ], + ]; + yield [ + self::ENVIRONMENT_SUT, [ - self::ENVIRONMENT_SUT, - [ - 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', - 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', - 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', - ], - [ - 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], - ], - [], + 'DRUPAL_STAGE_FILE_PROXY_ORIGIN' => 'https://example.com/', + 'DRUPAL_SHIELD_USER' => 'drupal_shield_user', + 'DRUPAL_SHIELD_PASS' => 'drupal_shield_pass', + ], + [ + 'stage_file_proxy.settings' => ['hotlink' => FALSE, 'origin' => 'https://drupal_shield_user:drupal_shield_pass@example.com/'], ], + [], ]; } @@ -832,83 +824,81 @@ public function testTrustedHostPatterns(array $vars, array $expected_patterns): /** * Data provider for testTrustedHostPatterns(). */ - public static function dataProviderTrustedHostPatterns(): array { - return [ - 'empty environment variable' => [ - [], - [ - '^localhost$', - ], + public static function dataProviderTrustedHostPatterns(): \Iterator { + yield 'empty environment variable' => [ + [], + [ + '^localhost$', ], - 'single domain' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'example.com'], - [ - '^localhost$', - '^example\.com$', - ], + ]; + yield 'single domain' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'example.com'], + [ + '^localhost$', + '^example\.com$', ], - 'multiple domains' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'example.com,www.example.com,cdn.example.org'], - [ - '^localhost$', - '^example\.com$', - '^www\.example\.com$', - '^cdn\.example\.org$', - ], + ]; + yield 'multiple domains' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'example.com,www.example.com,cdn.example.org'], + [ + '^localhost$', + '^example\.com$', + '^www\.example\.com$', + '^cdn\.example\.org$', ], - 'whitespace and empty values' => [ - ['DRUPAL_TRUSTED_HOSTS' => ' example.com , , www.example.com '], - [ - '^localhost$', - '^example\.com$', - '^www\.example\.com$', - ], + ]; + yield 'whitespace and empty values' => [ + ['DRUPAL_TRUSTED_HOSTS' => ' example.com , , www.example.com '], + [ + '^localhost$', + '^example\.com$', + '^www\.example\.com$', ], - 'special regex characters' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'sub-domain.example.com,test.example-site.org'], - [ - '^localhost$', - '^sub\-domain\.example\.com$', - '^test\.example\-site\.org$', - ], + ]; + yield 'special regex characters' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'sub-domain.example.com,test.example-site.org'], + [ + '^localhost$', + '^sub\-domain\.example\.com$', + '^test\.example\-site\.org$', ], - 'complex domains' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'api.v2.example.com,cdn-assets.example-site.co.uk'], - [ - '^localhost$', - '^api\.v2\.example\.com$', - '^cdn\-assets\.example\-site\.co\.uk$', - ], + ]; + yield 'complex domains' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'api.v2.example.com,cdn-assets.example-site.co.uk'], + [ + '^localhost$', + '^api\.v2\.example\.com$', + '^cdn\-assets\.example\-site\.co\.uk$', ], - 'duplicates' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'example.com,test.org,example.com,another.com,test.org'], - [ - '^localhost$', - '^example\.com$', - '^test\.org$', - '^example\.com$', - '^another\.com$', - '^test\.org$', - ], + ]; + yield 'duplicates' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'example.com,test.org,example.com,another.com,test.org'], + [ + '^localhost$', + '^example\.com$', + '^test\.org$', + '^example\.com$', + '^another\.com$', + '^test\.org$', ], - 'uppercase hosts' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'EXAMPLE.COM,Test.ORG,www.EXAMPLE-SITE.CO.UK'], - [ - '^localhost$', - '^example\.com$', - '^test\.org$', - '^www\.example\-site\.co\.uk$', - ], + ]; + yield 'uppercase hosts' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'EXAMPLE.COM,Test.ORG,www.EXAMPLE-SITE.CO.UK'], + [ + '^localhost$', + '^example\.com$', + '^test\.org$', + '^www\.example\-site\.co\.uk$', ], - 'explicit localhost' => [ - ['DRUPAL_TRUSTED_HOSTS' => 'localhost,example.com,localhost,test.org'], - [ - '^localhost$', - '^localhost$', - '^example\.com$', - '^localhost$', - '^test\.org$', - ], + ]; + yield 'explicit localhost' => [ + ['DRUPAL_TRUSTED_HOSTS' => 'localhost,example.com,localhost,test.org'], + [ + '^localhost$', + '^localhost$', + '^example\.com$', + '^localhost$', + '^test\.org$', ], ]; } diff --git a/web/modules/custom/ys_base/tests/src/Kernel/ExampleTest.php b/web/modules/custom/ys_base/tests/src/Kernel/ExampleTest.php index e28b77024..17a5c1afa 100644 --- a/web/modules/custom/ys_base/tests/src/Kernel/ExampleTest.php +++ b/web/modules/custom/ys_base/tests/src/Kernel/ExampleTest.php @@ -37,11 +37,9 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; } /** @@ -64,12 +62,10 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; } /** @@ -93,12 +89,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/web/modules/custom/ys_base/tests/src/Unit/ExampleTest.php b/web/modules/custom/ys_base/tests/src/Unit/ExampleTest.php index 47d8d75ab..d1d4fd76c 100644 --- a/web/modules/custom/ys_base/tests/src/Unit/ExampleTest.php +++ b/web/modules/custom/ys_base/tests/src/Unit/ExampleTest.php @@ -37,11 +37,9 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; } /** @@ -64,12 +62,10 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; } /** @@ -93,12 +89,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/web/themes/custom/your_site_theme/tests/src/Kernel/ExampleTest.php b/web/themes/custom/your_site_theme/tests/src/Kernel/ExampleTest.php index 96755de4c..aee42a906 100644 --- a/web/themes/custom/your_site_theme/tests/src/Kernel/ExampleTest.php +++ b/web/themes/custom/your_site_theme/tests/src/Kernel/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [3, 1, 4], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [3, 1, 4]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } } diff --git a/web/themes/custom/your_site_theme/tests/src/Unit/ExampleTest.php b/web/themes/custom/your_site_theme/tests/src/Unit/ExampleTest.php index 3f902f89c..9d00208f0 100644 --- a/web/themes/custom/your_site_theme/tests/src/Unit/ExampleTest.php +++ b/web/themes/custom/your_site_theme/tests/src/Unit/ExampleTest.php @@ -37,12 +37,10 @@ public function testAdd(int $a, int $b, int $expected, string|null $expectExcept /** * Data provider for testAdd(). */ - public static function dataProviderAdd(): array { - return [ - [0, 0, 0], - [1, 1, 2], - [2, 1, 3], - ]; + public static function dataProviderAdd(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 2]; + yield [2, 1, 3]; } /** @@ -65,13 +63,11 @@ public function testSubtract(int $a, int $b, int $expected, string|null $expectE /** * Data provider for testSubtract(). */ - public static function dataProviderSubtract(): array { - return [ - [0, 0, 0], - [1, 1, 0], - [2, 1, 1], - [3, 1, 2], - ]; + public static function dataProviderSubtract(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 0]; + yield [2, 1, 1]; + yield [3, 1, 2]; } /** @@ -95,12 +91,10 @@ public function testMultiplication(int $a, int $b, int $expected, string|null $e /** * Data provider for testMultiplication(). */ - public static function dataProviderMultiplication(): array { - return [ - [0, 0, 0], - [1, 1, 1], - [2, 1, 2], - ]; + public static function dataProviderMultiplication(): \Iterator { + yield [0, 0, 0]; + yield [1, 1, 1]; + yield [2, 1, 2]; } }