Skip to content

Commit b78c71a

Browse files
committed
Update DatabaseMigrationWriterTest.php
1 parent 13da8b0 commit b78c71a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ public function test01() {
8585

8686
$writter->writeClass();
8787
$clazz = "\\App\\Database\\Migrations\\MyMigration";
88+
89+
// Check if file was written and require it
90+
$filePath = $writter->getPath() . DS . $writter->getName() . '.php';
91+
$this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
92+
require_once $filePath;
8893
$this->assertTrue(class_exists($clazz));
8994
$runner->register($clazz);
9095
$allClasses[] = $clazz;
@@ -159,6 +164,11 @@ public function test03() {
159164
$this->assertEquals($name, $writter->getName());
160165
$writter->writeClass();
161166
$clazz = "\\App\\Database\\Migrations\\".$name;
167+
168+
// Check if file was written and require it
169+
$filePath = $writter->getPath() . DS . $writter->getName() . '.php';
170+
$this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
171+
require_once $filePath;
162172
$this->assertTrue(class_exists($clazz));
163173
$runner->register($clazz);
164174
$allClasses[] = $clazz;

0 commit comments

Comments
 (0)