From a237fa1e875f1899f169b37631a6d83f6a7393da Mon Sep 17 00:00:00 2001 From: Kelvin Mo Date: Wed, 18 Nov 2026 08:38:03 +1100 Subject: [PATCH 1/4] Clean up integration testing code - Update RoboFile.php to prevent automatically installing dependencies on create-project, as we need to update composer.site.json first - Update RoboFile.php to use default robo tasks to update composer configuration - Update composer.site.json to ensure test modules are mirrored instead of symlinked (to prevent issues on Windows) --- RoboFile.php | 16 +++++++++------- tests/integration/composer.site.json | 10 ++++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index b6423f4..e8e3f7d 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -24,6 +24,7 @@ public function test() { $collection->taskComposerCreateProject() ->source('simpleid/simpleid:dev-master') ->target($workspace_dir) + ->noInstall(true) ->noDev() ->run(); @@ -33,13 +34,14 @@ public function test() { ->run(); // 4. Update minimum-stability in root composer.json - $collection->addCode(function() use ($workspace_dir) { - $root_composer_json = $workspace_dir . '/composer.json'; - $root_composer = json_decode(file_get_contents($root_composer_json), true); - $root_composer['minimum-stability'] = 'dev'; - $root_composer['prefer-stable'] = true; - file_put_contents($root_composer_json, json_encode($root_composer)); - }); + $collection->taskComposerConfig() + ->workingDir($workspace_dir) + ->set('minimum-stability', 'dev') + ->run(); + $collection->taskComposerConfig() + ->workingDir($workspace_dir) + ->set('prefer-stable', 'true') + ->run(); // 5. Try installing the test module $collection->taskComposerUpdate() diff --git a/tests/integration/composer.site.json b/tests/integration/composer.site.json index f2e6fa3..cf2e91e 100644 --- a/tests/integration/composer.site.json +++ b/tests/integration/composer.site.json @@ -2,11 +2,17 @@ "repositories": [ { "type": "path", - "url": "../simpleid-test-module" + "url": "../simpleid-test-module", + "options": { + "symlink": false + } }, { "type": "path", - "url": "../../.." + "url": "../../..", + "options": { + "symlink": false + } } ], "require": { From ba903f211e241a11d046d8c226d3f3c29128dbe7 Mon Sep 17 00:00:00 2001 From: Kelvin Mo Date: Wed, 18 Nov 2026 12:22:55 +1100 Subject: [PATCH 2/4] Separate `clean` task from `test` --- RoboFile.php | 38 ++++++++++++++++++++++++-------------- composer.json | 1 + 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index e8e3f7d..c42d71c 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -1,5 +1,6 @@ collectionBuilder(); - // 1. Clean workspace directory $collection->taskFilesystemStack() - ->remove($workspace_dir . '/.gitignore') + ->remove($this->workspace_dir . '/.gitignore') ->run(); - $collection->taskCleanDir([$workspace_dir])->run(); + $collection->taskCleanDir([$this->workspace_dir])->run(); + + return $collection->run(); + } + + public function test(ConsoleIO $io, $version = 'dev-master') { + $composer_json = 'tests/integration/composer.site.json'; + + $collection = $this->collectionBuilder(); + + // 1. Clean workspace directory + $this->clean(); // 2. Install base SimpleID $collection->taskComposerCreateProject() - ->source('simpleid/simpleid:dev-master') - ->target($workspace_dir) + ->source('simpleid/simpleid:' . $version) + ->target($this->workspace_dir) ->noInstall(true) ->noDev() ->run(); // 3. Update composer.json to add local repository $collection->taskFilesystemStack() - ->copy($composer_json, $workspace_dir . '/composer.site.json') + ->copy($composer_json, $this->workspace_dir . '/composer.site.json') ->run(); // 4. Update minimum-stability in root composer.json $collection->taskComposerConfig() - ->workingDir($workspace_dir) + ->workingDir($this->workspace_dir) ->set('minimum-stability', 'dev') ->run(); $collection->taskComposerConfig() - ->workingDir($workspace_dir) + ->workingDir($this->workspace_dir) ->set('prefer-stable', 'true') ->run(); // 5. Try installing the test module $collection->taskComposerUpdate() - ->workingDir($workspace_dir) + ->workingDir($this->workspace_dir) ->noDev() ->run(); // 6. See if module exists in the right location - $collection->addCode(function() use ($workspace_dir) { - $expected_file = $workspace_dir . '/www/site/test/src/TestModule/TestModule.php'; + $collection->addCode(function() { + $expected_file = $this->workspace_dir . '/www/site/test/src/TestModule/TestModule.php'; if (!file_exists($expected_file)) return 1; }); diff --git a/composer.json b/composer.json index f49932f..f066d22 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "consolidation/robo": " ^5.2.3" }, "scripts": { + "clean": [ "@composer install", "robo clean" ], "test": [ "@composer install", "robo test" ], "update-copyright": [ "@composer install", "robo update_copyright" ] } From 065ee5179161cfd7b10265e01e3c277248055855 Mon Sep 17 00:00:00 2001 From: Kelvin Mo Date: Wed, 18 Nov 2026 12:41:13 +1100 Subject: [PATCH 3/4] Update tests --- RoboFile.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index c42d71c..25c1ca6 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -59,10 +59,27 @@ public function test(ConsoleIO $io, $version = 'dev-master') { ->noDev() ->run(); - // 6. See if module exists in the right location - $collection->addCode(function() { + // 6. See if module exists in the right location and is part of + // autoload + $collection->addCode(function() use ($io) { $expected_file = $this->workspace_dir . '/www/site/test/src/TestModule/TestModule.php'; - if (!file_exists($expected_file)) return 1; + if (!file_exists($expected_file)) { + $io->error('Test module not installed'); + return 1; + } else { + $io->success('Test module installed in expected location'); + } + }); + + $collection->addCode(function() use ($io) { + $autoload_file = $this->workspace_dir . '/www/vendor/composer/autoload_psr4.php'; + $autoloads = include($autoload_file); + if (!array_key_exists('SimpleID\\Modules\\TestModule\\', $autoloads)) { + $io->error('Test module not included in autoload'); + return 1; + } else { + $io->success('Test module included in autoload'); + } }); return $collection->run(); From c4136b7e73e0cfe0b9996bb4ad739e77f35fd8e4 Mon Sep 17 00:00:00 2001 From: Kelvin Mo Date: Wed, 18 Nov 2026 12:43:14 +1100 Subject: [PATCH 4/4] Update Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50ff3f3..ee9e61e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## Unreleased +- Changed: Updated dependencies and integration tests + +## Version 2.0.0 + - Changed: Support for Composer 2 API - Changed: SimpleID modules are now installed in `site`