Skip to content

Commit 2fcb0c5

Browse files
committed
fix: Writing Classes
1 parent 6a03b80 commit 2fcb0c5

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
*/
1010
class CreateMigrationTest extends CLITestCase {
1111

12+
protected function setUp(): void {
13+
parent::setUp();
14+
// Ensure migrations directory exists
15+
$migrationsDir = APP_PATH . DS . 'Database' . DS . 'Migrations';
16+
if (!is_dir($migrationsDir)) {
17+
mkdir($migrationsDir, 0755, true);
18+
}
19+
}
20+
1221
protected function tearDown(): void {
1322
// Clean up only specific migration files created by this test
1423
$migrationsDir = APP_PATH . DS . 'Database' . DS . 'Migrations';

tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@
1313
* @author Ibrahim
1414
*/
1515
class DBClassWritterTest extends CLITestCase {
16+
17+
protected function setUp(): void {
18+
parent::setUp();
19+
// Ensure directories exist for DB classes
20+
$dirs = [
21+
ROOT_PATH . DS . 'WebFiori' . DS . 'Db',
22+
ROOT_PATH . DS . 'WebFiori' . DS . 'Entity'
23+
];
24+
foreach ($dirs as $dir) {
25+
if (!is_dir($dir)) {
26+
mkdir($dir, 0755, true);
27+
}
28+
}
29+
}
1630
/**
1731
* @test
1832
*/

tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
*/
1313
class DatabaseMigrationWriterTest extends TestCase {
1414

15+
protected function setUp(): void {
16+
parent::setUp();
17+
// Ensure migrations directory exists
18+
$migrationsDir = APP_PATH . DS . 'Database' . DS . 'Migrations';
19+
if (!is_dir($migrationsDir)) {
20+
mkdir($migrationsDir, 0755, true);
21+
}
22+
}
23+
1524
protected function tearDown(): void {
1625
// Clean up only the Migration files created by this test (Migration000, Migration001, etc.)
1726
$migrationsDir = APP_PATH . DS . 'Database' . DS . 'Migrations';

0 commit comments

Comments
 (0)