From c30de39875f97b5447dc6f3392d108211c5a5d44 Mon Sep 17 00:00:00 2001 From: flack Date: Fri, 31 May 2024 15:16:09 +0200 Subject: [PATCH] Add cmd test --- test/command/__files/config.php | 15 +++++++++++++++ test/command/schemaTest.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 test/command/__files/config.php create mode 100644 test/command/schemaTest.php diff --git a/test/command/__files/config.php b/test/command/__files/config.php new file mode 100644 index 0000000..9cd36ed --- /dev/null +++ b/test/command/__files/config.php @@ -0,0 +1,15 @@ + true, + 'driver' => 'pdo_sqlite', +]; + +connection::initialize($driver, $db_config, true); \ No newline at end of file diff --git a/test/command/schemaTest.php b/test/command/schemaTest.php new file mode 100644 index 0000000..dd68b27 --- /dev/null +++ b/test/command/schemaTest.php @@ -0,0 +1,30 @@ + __DIR__ . '/__files/config.php']); + $output = new BufferedOutput; + $this->assertSame(Command::SUCCESS, $command->run($input, $output)); + + $this->assertStringStartsWith('Creating 5 new tables', $output->fetch()); + $vardir = dirname(__DIR__) . '/__output/commandTest/var/'; + $this->assertDirectoryExists($vardir . 'blobs/0/0'); + $this->assertFileExists($vardir . 'mgdschema_classes.php'); + $this->assertTrue(class_exists(\schemaCommandTest\midgard_group::class)); + } +} \ No newline at end of file