diff --git a/tests/Integration/Service/Parser/SchemaParserFactoryTest.php b/tests/Integration/Service/Parser/SchemaParserFactoryTest.php new file mode 100644 index 0000000..0987e22 --- /dev/null +++ b/tests/Integration/Service/Parser/SchemaParserFactoryTest.php @@ -0,0 +1,46 @@ +getMockBuilder(Connection::class) + ->disableOriginalConstructor() + ->onlyMethods(['getDriverName'])->getMock(); + $connection->method('getDriverName')->willReturn($dbType); + + $factory = new SchemaParserFactory(); + self::assertInstanceOf($expectedType, $factory->create($connection)); + } + + public function testFactoryThrowsException(): void + { + $dbType = uniqid('dbType', true); + $connection = $this->getMockBuilder(Connection::class) + ->disableOriginalConstructor() + ->onlyMethods(['getDriverName'])->getMock(); + $connection->method('getDriverName')->willReturn($dbType); + $this->expectException(\InvalidArgumentException::class); + (new SchemaParserFactory())->create($connection); + } +} \ No newline at end of file