test(modx): схема live-сьюта из Phinx-миграций - #698
Open
Ibochkarev wants to merge 3 commits into
Open
Conversation
Replace PackageDefinition::tables() with a once-per-process Phinx migrate and snapshot recapture so testbench exercises the same path as install resolvers (#695).
xPDO resolves metadata as {path}Model/metadata.mysql.php when the
namespacePrefix is MiniShop3\, so the package path must be .../src/
(same as ExtraTestCase), not .../src/Model/. Also fix product-field FK
in persist tests and compare schema against static mysql maps.
MySQL 8 hides cross-connection DDL from Phinx hasTable() while the migration transaction is open; verify via modx PDO and refresh the Phinx transaction before FK checks. Reset ExtraFields cache/map between live tests so ExtraFieldMapTest does not break later msVendor asserts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
Live-сьют testbench создаёт схему через полный прогон Phinx (как
resolver_02_migrations.php), а не черезPackageDefinition::tables(). Три миграции с bootstrap MODX принимают инжектированный$modx(migrations/_modx.php+$GLOBALS['modx']вphinx.php).Тип изменений
Связанные Issues
Closes #695
Как это было протестировано?
composer test:modxлокально не гонялся (нет доступа к MySQL testbench). Ожидается зелёный jobmodx-testbenchв CI.composer ci:php/ smoke; live — CItest:modx)Конфигурация тестирования:
test/issue-695-phinx-live-schemaСкриншоты (если применимо)
Чеклист
composer stan/ CI jobPHPStan) — затронут в основномtests/Modx+ миграцииnpm run lint:ciдля Vue) — не требуетсяДополнительные заметки
Способ запуска в testbench (AC):
PhinxSchemaBootstrap::ensure()доparent::setUp()— migrate (idempotent) + recapture snapshot + synctable_countчерезSchemaInventory::countTablesWithPrefix().Выпущенные миграции: меняется только bootstrap (
_modx.php), не схема/данные. На уже применённых сайтахup()не повторится. Нужна ручная проверка чистой установки на тестовом сайте (AC human gate).Вне скоупа: upgrade-path с дампом старого релиза; статическая сверка
schema.xml↔ карта.