Skip to content

Commit 6d56952

Browse files
committed
Update DatabaseMigrationWriterTest.php
1 parent b78c71a commit 6d56952

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ public function test02() {
113113
$this->assertEquals('Migration000', $writter->getName());
114114
$writter->writeClass();
115115
$clazz = "\\App\\Database\\Migrations\\Migration000";
116+
117+
// Check if file was written and require it
118+
$filePath = $writter->getPath() . DS . $writter->getName() . '.php';
119+
$this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
120+
require_once $filePath;
116121
$this->assertTrue(class_exists($clazz));
117122
$runner->register($clazz);
118123
$allClasses[] = $clazz;
@@ -128,7 +133,12 @@ public function test02() {
128133
$this->assertEquals('Migration001', $writter2->getName());
129134
$writter2->writeClass();
130135
$clazz2 = "\\App\\Database\\Migrations\\Migration001";
131-
$this->assertTrue(class_exists($clazz));
136+
137+
// Check if file was written and require it
138+
$filePath2 = $writter2->getPath() . DS . $writter2->getName() . '.php';
139+
$this->assertTrue(file_exists($filePath2), "Class file was not created: $filePath2");
140+
require_once $filePath2;
141+
$this->assertTrue(class_exists($clazz2));
132142
$runner->register($clazz);
133143
$allClasses[] = $clazz;
134144
$runner3 = new SchemaRunner(null);

0 commit comments

Comments
 (0)