Skip to content

Commit

Permalink
Merge pull request #823 from nishimura-d/plugin-tests
Browse files Browse the repository at this point in the history
Fix class not found in plugin test
  • Loading branch information
markstory committed Apr 19, 2022
2 parents 3933caa + 39bfecc commit 1770f75
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion templates/bake/Plugin/phpunit.xml.dist.twig
Expand Up @@ -34,7 +34,7 @@

<!-- Setup fixture extension -->
<extensions>
<extension class="Cake\TestSuite\Fixtures\PHPUnitExtension" />
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension" />
</extensions>

<filter>
Expand Down
6 changes: 3 additions & 3 deletions templates/bake/Plugin/tests/bootstrap.php.twig
Expand Up @@ -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);
Expand Down Expand Up @@ -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');
2 changes: 1 addition & 1 deletion tests/comparisons/Plugin/Company/Example/phpunit.xml.dist
Expand Up @@ -19,7 +19,7 @@

<!-- Setup fixture extension -->
<extensions>
<extension class="Cake\TestSuite\Fixtures\PHPUnitExtension" />
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension" />
</extensions>

<filter>
Expand Down
6 changes: 3 additions & 3 deletions tests/comparisons/Plugin/Company/Example/tests/bootstrap.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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');
2 changes: 1 addition & 1 deletion tests/comparisons/Plugin/SimpleExample/phpunit.xml.dist
Expand Up @@ -19,7 +19,7 @@

<!-- Setup fixture extension -->
<extensions>
<extension class="Cake\TestSuite\Fixtures\PHPUnitExtension" />
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension" />
</extensions>

<filter>
Expand Down
6 changes: 3 additions & 3 deletions tests/comparisons/Plugin/SimpleExample/tests/bootstrap.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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');

0 comments on commit 1770f75

Please sign in to comment.