You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a test class that should run migrations in all namespaces:
namespaceTests\App\Libraries;
useApp\Libraries\InvoicesLib;
useApp\Models\InvoicesModel;
useCodeIgniter\Test\CIUnitTestCase;
useCodeIgniter\Test\DatabaseTestTrait;
useTests\Support\Database\Seeds\ClientsSeeder;
useTests\Support\Database\Seeds\IncomeTypesSeeder;
useTests\Support\Database\Seeds\InvoicesSeeder;
useTests\Support\Database\Seeds\ServiceTypesSeeder;
useTests\Support\Database\Seeds\SettingsSeeder;
/** * @internal */finalclass InvoicesLibTest extends CIUnitTestCase
{
use DatabaseTestTrait;
protected$DBGroup = 'tests';
// For Migrationsprotected$migrate = true;
protected$migrateOnce = false;
protected$refresh = true;
protected$namespace; // = from all namespaces
All migrations are run except for IonAuth. Therefore I see errors like:
dg@tvenkinys:~/Programavimas/saskaitos$ vendor/bin/phpunit --filter InvoicesLib
PHPUnit 9.6.20 by Sebastian Bergmann and contributors.
Runtime: PHP 8.3.6
Configuration: /home/dg/Programavimas/saskaitos/phpunit.xml
Warning: XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set
EEEEEEEEE 9 / 9 (100%)
Time: 00:06.765, Memory: 14.00 MB
There were 9 errors:
1) Tests\App\Libraries\InvoicesLibTest::testCalculateInvoiceNumber
CodeIgniter\Database\Exceptions\DatabaseException: SQLite3::exec(): no such table: main.users
/home/dg/Programavimas/saskaitos/vendor/codeigniter4/framework/system/Database/BaseConnection.php:647
/home/dg/Programavimas/saskaitos/vendor/codeigniter4/framework/system/Database/BaseBuilder.php:2307
/home/dg/Programavimas/saskaitos/tests/_support/Database/Seeds/ClientsSeeder.php:81
/home/dg/Programavimas/saskaitos/vendor/codeigniter4/framework/system/Database/Seeder.php:145
/home/dg/Programavimas/saskaitos/vendor/codeigniter4/framework/system/Test/DatabaseTestTrait.php:223
/home/dg/Programavimas/saskaitos/vendor/codeigniter4/framework/system/Test/DatabaseTestTrait.php:209
/home/dg/Programavimas/saskaitos/vendor/codeigniter4/framework/system/Test/DatabaseTestTrait.php:190
/home/dg/Programavimas/saskaitos/vendor/codeigniter4/framework/system/Test/DatabaseTestTrait.php:58
/home/dg/Programavimas/saskaitos/vendor/codeigniter4/framework/system/Test/CIUnitTestCase.php:249
/home/dg/Programavimas/saskaitos/tests/app/Libraries/InvoicesLibTest.php:46
Caused by
CodeIgniter\Database\Exceptions\DatabaseException: SQLite3::exec(): no such table: main.users
What could be the cause of it?
also, when I run in an empty project
php spark migrate --all
The ionAuth migration is omitted, while other non App namespace migrations are included (I use only one, Settings).
I have to run
php spark migrate -n IonAuth
to get it to execute.
I am doing these tests on Codeigniter 4.4.8. On earlier versions (before 4.4.1, I would presume) this did work.
The text was updated successfully, but these errors were encountered:
dgvirtual
changed the title
Codeigniter does not run migration for IonAuth in tests (and in CLI php spark migrate --all)
Codeigniter does not run migration for IonAuth in tests (reopened)
Jul 23, 2024
I have upgraded my project to 4.5.3, and though php spark migrate --all now does include IonAuth migration, the tests class fails to run it during initiation.
I have a test class that should run migrations in all namespaces:
All migrations are run except for IonAuth. Therefore I see errors like:
What could be the cause of it?
also, when I run in an empty project
The ionAuth migration is omitted, while other non App namespace migrations are included (I use only one, Settings).
I have to run
to get it to execute.
I am doing these tests on Codeigniter 4.4.8. On earlier versions (before 4.4.1, I would presume) this did work.
The text was updated successfully, but these errors were encountered: