From 4c204a9564f393f578306c0d8791550c547ceafd Mon Sep 17 00:00:00 2001 From: NISHIMURA Daisuke Date: Mon, 18 Apr 2022 13:17:33 +0900 Subject: [PATCH 1/3] Fix class not found in test bootstrap of plugin Cake\TestSuite\Schema\SchemaManager changed to Cake\TestSuite\Fixture\SchemaLoader. https://github.com/cakephp/cakephp/pull/15804 https://github.com/cakephp/cakephp/pull/15614 --- templates/bake/Plugin/tests/bootstrap.php.twig | 4 ++-- tests/comparisons/Plugin/Company/Example/tests/bootstrap.php | 4 ++-- tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/bake/Plugin/tests/bootstrap.php.twig b/templates/bake/Plugin/tests/bootstrap.php.twig index 07b207ba..f253ad54 100644 --- a/templates/bake/Plugin/tests/bootstrap.php.twig +++ b/templates/bake/Plugin/tests/bootstrap.php.twig @@ -66,7 +66,7 @@ if (file_exists($root . '/config/bootstrap.php')) { * using migrations to provide schema for your plugin, * and using \Migrations\TestSuite\Migrator to load schema. */ -use Cake\TestSuite\Schema\SchemaManager; +use Cake\TestSuite\Fixture\SchemaLoader; // Load a schema dump file. -SchemaManager::create('test', 'tests/schema.sql'); +(new SchemaLoader())->loadSqlFiles('tests/schema.sql', 'test'); diff --git a/tests/comparisons/Plugin/Company/Example/tests/bootstrap.php b/tests/comparisons/Plugin/Company/Example/tests/bootstrap.php index d3d6d75c..15bbd7aa 100644 --- a/tests/comparisons/Plugin/Company/Example/tests/bootstrap.php +++ b/tests/comparisons/Plugin/Company/Example/tests/bootstrap.php @@ -49,7 +49,7 @@ * using migrations to provide schema for your plugin, * and using \Migrations\TestSuite\Migrator to load schema. */ -use Cake\TestSuite\Schema\SchemaManager; +use Cake\TestSuite\Fixture\SchemaLoader; // Load a schema dump file. -SchemaManager::create('test', 'tests/schema.sql'); +(new SchemaLoader())->loadSqlFiles('tests/schema.sql', 'test'); diff --git a/tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php b/tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php index 5f8949b0..1ad70017 100644 --- a/tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php +++ b/tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php @@ -49,7 +49,7 @@ * using migrations to provide schema for your plugin, * and using \Migrations\TestSuite\Migrator to load schema. */ -use Cake\TestSuite\Schema\SchemaManager; +use Cake\TestSuite\Fixture\SchemaLoader; // Load a schema dump file. -SchemaManager::create('test', 'tests/schema.sql'); +(new SchemaLoader())->loadSqlFiles('tests/schema.sql', 'test'); From 6e87b8cf962af96140070d059e4f468d965062f2 Mon Sep 17 00:00:00 2001 From: NISHIMURA Daisuke Date: Mon, 18 Apr 2022 13:39:29 +0900 Subject: [PATCH 2/3] Fix class does not exist in plugin test typo at 79cc47ba85bc042685dab7b25352abaa8a5c03bf --- templates/bake/Plugin/phpunit.xml.dist.twig | 2 +- tests/comparisons/Plugin/Company/Example/phpunit.xml.dist | 2 +- tests/comparisons/Plugin/SimpleExample/phpunit.xml.dist | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/bake/Plugin/phpunit.xml.dist.twig b/templates/bake/Plugin/phpunit.xml.dist.twig index 3736109e..a9f75563 100644 --- a/templates/bake/Plugin/phpunit.xml.dist.twig +++ b/templates/bake/Plugin/phpunit.xml.dist.twig @@ -34,7 +34,7 @@ - + diff --git a/tests/comparisons/Plugin/Company/Example/phpunit.xml.dist b/tests/comparisons/Plugin/Company/Example/phpunit.xml.dist index 9ed38ac9..5cbafd47 100644 --- a/tests/comparisons/Plugin/Company/Example/phpunit.xml.dist +++ b/tests/comparisons/Plugin/Company/Example/phpunit.xml.dist @@ -19,7 +19,7 @@ - + diff --git a/tests/comparisons/Plugin/SimpleExample/phpunit.xml.dist b/tests/comparisons/Plugin/SimpleExample/phpunit.xml.dist index d9885c3a..4aa48fb4 100644 --- a/tests/comparisons/Plugin/SimpleExample/phpunit.xml.dist +++ b/tests/comparisons/Plugin/SimpleExample/phpunit.xml.dist @@ -19,7 +19,7 @@ - + From 39bfecc30ee9344ffb63b51c89c10931dd41dc3d Mon Sep 17 00:00:00 2001 From: NISHIMURA Daisuke Date: Mon, 18 Apr 2022 13:43:38 +0900 Subject: [PATCH 3/3] Change quotes of string in plugin test bootstrap --- templates/bake/Plugin/tests/bootstrap.php.twig | 2 +- tests/comparisons/Plugin/Company/Example/tests/bootstrap.php | 2 +- tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/bake/Plugin/tests/bootstrap.php.twig b/templates/bake/Plugin/tests/bootstrap.php.twig index f253ad54..bfb1dadc 100644 --- a/templates/bake/Plugin/tests/bootstrap.php.twig +++ b/templates/bake/Plugin/tests/bootstrap.php.twig @@ -34,7 +34,7 @@ $findRoot = function ($root) { } } while ($root !== $lastRoot); - throw new Exception("Cannot find the root of the application, unable to run tests"); + throw new Exception('Cannot find the root of the application, unable to run tests'); }; $root = $findRoot(__FILE__); unset($findRoot); diff --git a/tests/comparisons/Plugin/Company/Example/tests/bootstrap.php b/tests/comparisons/Plugin/Company/Example/tests/bootstrap.php index 15bbd7aa..401fcb40 100644 --- a/tests/comparisons/Plugin/Company/Example/tests/bootstrap.php +++ b/tests/comparisons/Plugin/Company/Example/tests/bootstrap.php @@ -17,7 +17,7 @@ } } while ($root !== $lastRoot); - throw new Exception("Cannot find the root of the application, unable to run tests"); + throw new Exception('Cannot find the root of the application, unable to run tests'); }; $root = $findRoot(__FILE__); unset($findRoot); diff --git a/tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php b/tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php index 1ad70017..445c88c0 100644 --- a/tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php +++ b/tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php @@ -17,7 +17,7 @@ } } while ($root !== $lastRoot); - throw new Exception("Cannot find the root of the application, unable to run tests"); + throw new Exception('Cannot find the root of the application, unable to run tests'); }; $root = $findRoot(__FILE__); unset($findRoot);