diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f648c91..09b41ee 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -54,7 +54,7 @@ jobs: if [ ${{ matrix.db-type }} == 'mysql' ]; then sudo service mysql start && mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE IF NOT EXISTS test_migrator;'; fi - composer run-tests-${{ matrix.db-type }} + composer ${{ matrix.db-type }} - name: Run Phpstan - run: composer run-phpstan + run: composer phpstan diff --git a/composer.json b/composer.json index 4b3eab0..cfe2eb2 100644 --- a/composer.json +++ b/composer.json @@ -29,12 +29,12 @@ } }, "scripts": { - "run-tests-mysql": "bash run_tests.sh Mysql", - "run-tests-pgsql": "bash run_tests.sh Postgres", - "run-tests-sqlite": "bash run_tests.sh Sqlite", - "run-phpstan": "./vendor/bin/phpstan analyse --memory-limit=-1" + "mysql": "bash run_tests.sh Mysql", + "pgsql": "bash run_tests.sh Postgres", + "sqlite": "bash run_tests.sh Sqlite", + "phpstan": "./vendor/bin/phpstan analyse --memory-limit=-1" }, "config": { "sort-packages": true } -} \ No newline at end of file +} diff --git a/tests/TestCase/MigratorTest.php b/tests/TestCase/MigratorTest.php index b03088b..813f6de 100644 --- a/tests/TestCase/MigratorTest.php +++ b/tests/TestCase/MigratorTest.php @@ -14,10 +14,9 @@ namespace CakephpTestMigrator\Test\TestCase; +use Cake\Datasource\ConnectionManager; use Cake\TestSuite\TestCase; use CakephpTestMigrator\Migrator; -use CakephpTestSuiteLight\FixtureManager; -use CakephpTestSuiteLight\Sniffer\BaseTableSniffer; class MigratorTest extends TestCase { @@ -26,22 +25,14 @@ class MigratorTest extends TestCase */ public $migrator; - /** - * @var BaseTableSniffer - */ - public $sniffer; - public function setUp(): void { $this->migrator = new Migrator(); - - $fm = new FixtureManager(); - $this->sniffer = $fm->getSniffer('test'); } private function fetchMigrationsInDB(string $dbTable): array { - return $this->sniffer->fetchQuery("SELECT migration_name FROM $dbTable"); + return ConnectionManager::get('test')->execute("SELECT migration_name FROM $dbTable")->fetch(); } public function testGetConfig()