Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vortex/installer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"require": {
"php": ">=8.2",
"alexskrypnyk/file": "^0.9",
"alexskrypnyk/file": "^0.11",
"alexskrypnyk/str2name": "^1.4",
"composer/composer": "^2.8",
"cweagans/composer-patches": "^1.7",
Expand All @@ -31,7 +31,7 @@
"symfony/yaml": "^7.2"
},
"require-dev": {
"alexskrypnyk/phpunit-helpers": "^0.8.2",
"alexskrypnyk/phpunit-helpers": "^0.10",
"bamarni/composer-bin-plugin": "^1.8",
"dealerdirect/phpcodesniffer-composer-installer": "^1",
"drupal/coder": "^8.3",
Expand Down
218 changes: 112 additions & 106 deletions .vortex/installer/composer.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .vortex/installer/src/Prompts/Handlers/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public static function getToolDefinitions(string $filter = 'all'): array {
},
'composer.json' => function (JsonManipulator $cj): void {
$cj->removeSubNode('require-dev', 'dealerdirect/phpcodesniffer-composer-installer');
$cj->removeConfigSetting('allow-plugins.dealerdirect/phpcodesniffer-composer-installer');
$cj->removeSubNode('require-dev', 'drupal/coder');
$cj->removeSubNode('require-dev', 'squizlabs/php_codesniffer');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
"vincentlanglet/twig-cs-fixer": "__VERSION__"
},
"conflict": {
@@ -79,7 +72,6 @@
@@ -74,12 +67,10 @@
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
- "dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"ergebnis/composer-normalize": true,
"oomphinc/composer-installers-extender": true,
"php-http/discovery": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
"vincentlanglet/twig-cs-fixer": "__VERSION__"
},
"conflict": {
@@ -79,7 +72,6 @@
@@ -74,12 +67,10 @@
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
- "dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"ergebnis/composer-normalize": true,
"oomphinc/composer-installers-extender": true,
"php-http/discovery": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@
"drevops/behat-format-progress-fail": "__VERSION__",
"drevops/behat-screenshot": "__VERSION__",
"drevops/behat-steps": "__VERSION__",
@@ -74,7 +73,6 @@
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
- "dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"ergebnis/composer-normalize": true,
"oomphinc/composer-installers-extender": true,
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@
"drevops/behat-format-progress-fail": "__VERSION__",
"drevops/behat-screenshot": "__VERSION__",
"drevops/behat-steps": "__VERSION__",
@@ -74,7 +73,6 @@
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
- "dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"ergebnis/composer-normalize": true,
"oomphinc/composer-installers-extender": true,
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"vincentlanglet/twig-cs-fixer": "__VERSION__"
},
"conflict": {
@@ -65,11 +51,6 @@
@@ -65,21 +51,14 @@
"scripts/composer/ScriptHandler.php"
]
},
Expand All @@ -35,7 +35,9 @@
"config": {
"allow-plugins": {
"composer/installers": true,
@@ -79,7 +60,6 @@
"cweagans/composer-patches": true,
- "dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"ergebnis/composer-normalize": true,
"oomphinc/composer-installers-extender": true,
"php-http/discovery": true,
Expand Down
8 changes: 4 additions & 4 deletions .vortex/installer/tests/Functional/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ protected function assertSutContains(string|array $needles): void {

foreach ($needles as $needle) {
if (Strings::isRegex($needle)) {
$this->assertDirectoryContainsString($needle, static::$sut, [
$this->assertDirectoryContainsString(static::$sut, $needle, [
'scripts/vortex',
]);
}
else {
$this->assertDirectoryContainsWord($needle, static::$sut, [
$this->assertDirectoryContainsWord(static::$sut, $needle, [
'scripts/vortex',
]);
}
Expand All @@ -141,12 +141,12 @@ protected function assertSutNotContains(string|array $needles): void {

foreach ($needles as $needle) {
if (Strings::isRegex($needle)) {
$this->assertDirectoryNotContainsString($needle, static::$sut, [
$this->assertDirectoryNotContainsString(static::$sut, $needle, [
'scripts/vortex',
]);
}
else {
$this->assertDirectoryNotContainsWord($needle, static::$sut, [
$this->assertDirectoryNotContainsWord(static::$sut, $needle, [
'scripts/vortex',
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function dataProviderInstall(): array {
static::cw(fn() => Env::put(PromptManager::makeEnvName(CodeProvider::id()), CodeProvider::GITHUB)),
static::cw(function (FunctionalTestCase $test): void {
$test->assertFileDoesNotExist(static::$sut . '/.github/PULL_REQUEST_TEMPLATE.dist.md');
$test->assertFileContainsString('Checklist before requesting a review', static::$sut . '/.github/PULL_REQUEST_TEMPLATE.md');
$test->assertFileContainsString(static::$sut . '/.github/PULL_REQUEST_TEMPLATE.md', 'Checklist before requesting a review');
}),
],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,25 @@ public static function dataProviderInstall(): array {
return [
'starter, demo db' => [
static::cw(fn() => Env::put(PromptManager::makeEnvName(Starter::id()), Starter::LOAD_DATABASE_DEMO)),
static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
'drupal/cms',
'wikimedia/composer-merge-plugin',
'vendor/drupal/cms/composer.json',
])),
Comment on lines +20 to +24

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Add missing check for symfony/http-client and use regex for vendor path to avoid word-boundary misses

The handler adds symfony/http-client only for the Drupal CMS profile; we should assert its absence here. Also switch the vendor path to a regex so it’s matched as a raw string, not a “word”.

-        static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
-          'drupal/cms',
-          'wikimedia/composer-merge-plugin',
-          'vendor/drupal/cms/composer.json',
-        ])),
+        static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
+          'drupal/cms',
+          'wikimedia/composer-merge-plugin',
+          'symfony/http-client',
+          '/vendor\/drupal\/cms\/composer\.json/',
+        ])),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
'drupal/cms',
'wikimedia/composer-merge-plugin',
'vendor/drupal/cms/composer.json',
])),
static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
'drupal/cms',
'wikimedia/composer-merge-plugin',
'symfony/http-client',
'/vendor\/drupal\/cms\/composer\.json/',
])),
🤖 Prompt for AI Agents
.vortex/installer/tests/Functional/Handlers/StarterInstallTest.php around lines
20 to 24: the test currently asserts absence of 'drupal/cms' and
'wikimedia/composer-merge-plugin' and a literal vendor path, but misses that
symfony/http-client should also be absent and the vendor path should be matched
as a raw regex to avoid word-boundary misses; update the asserted list to
include 'symfony/http-client' and replace the vendor path string with a regex
pattern (e.g. using a PHP regex literal) that matches
vendor/drupal/cms/composer.json as a raw string so the test checks the correct
negative conditions.

],

'starter, Drupal profile' => [
static::cw(fn() => Env::put(PromptManager::makeEnvName(Starter::id()), Starter::INSTALL_PROFILE_CORE)),
static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
'drupal/cms',
'wikimedia/composer-merge-plugin',
'vendor/drupal/cms/composer.json',
])),
Comment on lines +29 to +33

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Mirror negative assertions for CORE profile (include symfony/http-client; use regex for vendor path)

Keep parity with the “demo db” case and reduce false negatives on the vendor path by matching it as a string via regex.

-        static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
-          'drupal/cms',
-          'wikimedia/composer-merge-plugin',
-          'vendor/drupal/cms/composer.json',
-        ])),
+        static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
+          'drupal/cms',
+          'wikimedia/composer-merge-plugin',
+          'symfony/http-client',
+          '/vendor\/drupal\/cms\/composer\.json/',
+        ])),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
'drupal/cms',
'wikimedia/composer-merge-plugin',
'vendor/drupal/cms/composer.json',
])),
static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
'drupal/cms',
'wikimedia/composer-merge-plugin',
'symfony/http-client',
'/vendor\/drupal\/cms\/composer\.json/',
])),
🤖 Prompt for AI Agents
.vortex/installer/tests/Functional/Handlers/StarterInstallTest.php around lines
29-33: the negative assertions for the CORE profile need to mirror the demo-db
case by also asserting absence of 'symfony/http-client' and by changing the
literal vendor path check into a regex-based match to avoid false negatives;
update the array to include 'symfony/http-client' and replace
'vendor/drupal/cms/composer.json' with a regex string (e.g. a pattern that
matches vendor paths) or the test helper call that treats the entry as a regex
so the vendor path is matched via regex rather than an exact string.

],

'starter, Drupal CMS profile' => [
static::cw(fn() => Env::put(PromptManager::makeEnvName(Starter::id()), Starter::INSTALL_PROFILE_DRUPALCMS)),
static::cw(fn(FunctionalTestCase $test) => $test->assertSutNotContains([
static::cw(fn(FunctionalTestCase $test) => $test->assertSutContains([
'drupal/cms',
'wikimedia/composer-merge-plugin',
'vendor/drupal/cms/composer.json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static function dataProviderInstall(): array {
Env::put(PromptManager::makeEnvName(Theme::id()), '');
Env::put(PromptManager::makeEnvName(AiCodeInstructions::id()), AiCodeInstructions::CLAUDE);
}),
static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString('themes/custom', static::$sut, [
static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString(static::$sut, 'themes/custom', [
'.gitignore',
'scripts/vortex',
'composer.json',
Expand All @@ -31,7 +31,7 @@ public static function dataProviderInstall(): array {

'theme, custom' => [
static::cw(fn() => Env::put(PromptManager::makeEnvName(Theme::id()), 'light_saber')),
static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString('your_site_theme', static::$sut)),
static::cw(fn(FunctionalTestCase $test) => $test->assertDirectoryNotContainsString(static::$sut, 'your_site_theme')),
],

];
Expand Down
20 changes: 10 additions & 10 deletions .vortex/installer/tests/Functional/Handlers/TimezoneInstallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ public static function dataProviderInstall(): array {
}),
static::cw(function (FunctionalTestCase $test): void {
// Timezone should be replaced in .env file.
$test->assertFileContainsString('TZ=America/New_York', static::$sut . '/.env');
$test->assertFileNotContainsString('UTC', static::$sut . '/.env');
$test->assertFileContainsString(static::$sut . '/.env', 'TZ=America/New_York');
$test->assertFileNotContainsString(static::$sut . '/.env', 'UTC');

// Timezone should be replaced in Renovate config.
$test->assertFileContainsString('"timezone": "America/New_York"', static::$sut . '/renovate.json');
$test->assertFileNotContainsString('UTC', static::$sut . '/renovate.json');
$test->assertFileContainsString(static::$sut . '/renovate.json', '"timezone": "America/New_York"');
$test->assertFileNotContainsString(static::$sut . '/renovate.json', 'UTC');

// Timezone should not be replaced in GHA config in code as it should
// be overridden via UI.
$test->assertFileNotContainsString('America/New_York', static::$sut . '/.github/workflows/build-test-deploy.yml');
$test->assertFileContainsString('UTC', static::$sut . '/.github/workflows/build-test-deploy.yml');
$test->assertFileNotContainsString(static::$sut . '/.github/workflows/build-test-deploy.yml', 'America/New_York');
$test->assertFileContainsString(static::$sut . '/.github/workflows/build-test-deploy.yml', 'UTC');

// Timezone should not be replaced in Docker Compose config.
$test->assertFileNotContainsString('America/New_York', static::$sut . '/docker-compose.yml');
$test->assertFileContainsString('UTC', static::$sut . '/docker-compose.yml');
$test->assertFileNotContainsString(static::$sut . '/docker-compose.yml', 'America/New_York');
$test->assertFileContainsString(static::$sut . '/docker-compose.yml', 'UTC');
}),
],

Expand All @@ -50,8 +50,8 @@ public static function dataProviderInstall(): array {
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('TZ: America/New_York', static::$sut . '/.circleci/config.yml');
$test->assertFileContainsString('TZ: UTC', static::$sut . '/.circleci/config.yml');
$test->assertFileNotContainsString(static::$sut . '/.circleci/config.yml', 'TZ: America/New_York');
$test->assertFileContainsString(static::$sut . '/.circleci/config.yml', 'TZ: UTC');
}),
],
];
Expand Down
2 changes: 1 addition & 1 deletion .vortex/installer/tests/Unit/EnvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function testWriteValueDotenv(): void {
// Add new variable.
Env::writeValueDotenv('NEW_VAR', 'new_added_value', $actual_file);

$this->assertDirectoryEqualsDirectory($fixture_dir . '/after', static::$sut);
$this->assertDirectoryEqualsDirectory(static::$sut, $fixture_dir . '/after');
}

#[DataProvider('dataProviderFormatValueForDotenv')]
Expand Down
2 changes: 1 addition & 1 deletion .vortex/installer/tests/Unit/SelfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testVersionReplacement(): void {

static::replaceVersions(static::$sut);

$this->assertDirectoryEqualsDirectory($expected, static::$sut);
$this->assertDirectoryEqualsDirectory(static::$sut, $expected);
}

}
4 changes: 2 additions & 2 deletions .vortex/tests/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"php": ">=8.2"
},
"require-dev": {
"alexskrypnyk/file": "^0.9",
"alexskrypnyk/phpunit-helpers": "main-dev",
"alexskrypnyk/file": "^0.11.0",
"alexskrypnyk/phpunit-helpers": "^0.10",
"alexskrypnyk/shellvar": "^1.2",
"czproject/git-php": "^4.4",
"dealerdirect/phpcodesniffer-composer-installer": "^1",
Expand Down
21 changes: 9 additions & 12 deletions .vortex/tests/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading