diff --git a/lib/Doctrine/Migrations/Configuration/XML/configuration.xsd b/lib/Doctrine/Migrations/Configuration/XML/configuration.xsd index 3c05f63048..0b5411018a 100644 --- a/lib/Doctrine/Migrations/Configuration/XML/configuration.xsd +++ b/lib/Doctrine/Migrations/Configuration/XML/configuration.xsd @@ -7,6 +7,7 @@ + diff --git a/lib/Doctrine/Migrations/Configuration/XmlConfiguration.php b/lib/Doctrine/Migrations/Configuration/XmlConfiguration.php index 79a95aa1ea..0c074828db 100644 --- a/lib/Doctrine/Migrations/Configuration/XmlConfiguration.php +++ b/lib/Doctrine/Migrations/Configuration/XmlConfiguration.php @@ -54,6 +54,10 @@ protected function doLoad(string $file) : void $config['name'] = (string) $xml->name; } + if (isset($xml->{'custom-template'})) { + $config['custom_template'] = (string) $xml->{'custom-template'}; + } + if (isset($xml->table['name'])) { $config['table_name'] = (string) $xml->table['name']; } diff --git a/tests/Doctrine/Migrations/Tests/Configuration/AbstractConfigurationTest.php b/tests/Doctrine/Migrations/Tests/Configuration/AbstractConfigurationTest.php index 99811eb21e..86b8c433e5 100644 --- a/tests/Doctrine/Migrations/Tests/Configuration/AbstractConfigurationTest.php +++ b/tests/Doctrine/Migrations/Tests/Configuration/AbstractConfigurationTest.php @@ -131,6 +131,13 @@ public function testVersionsOrganizationInvalid() : void $this->loadConfiguration('organize_invalid'); } + public function testCustomTemplate() : void + { + $config = $this->loadConfiguration('custom_template'); + + self::assertSame('template.tpl', $config->getCustomTemplate()); + } + public function testVersionsOrganizationIncompatibleFinder() : void { $this->expectException(MigrationException::class); diff --git a/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.json b/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.json new file mode 100644 index 0000000000..512256bc01 --- /dev/null +++ b/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.json @@ -0,0 +1,3 @@ +{ + "custom_template" : "template.tpl" +} diff --git a/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.php b/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.php new file mode 100644 index 0000000000..a5ea37c0f6 --- /dev/null +++ b/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.php @@ -0,0 +1,5 @@ + 'template.tpl']; diff --git a/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.xml b/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.xml new file mode 100644 index 0000000000..a81b572dff --- /dev/null +++ b/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.xml @@ -0,0 +1,8 @@ + + + + template.tpl + diff --git a/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.yml b/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.yml new file mode 100644 index 0000000000..75ed71ac1a --- /dev/null +++ b/tests/Doctrine/Migrations/Tests/Configuration/_files/config_custom_template.yml @@ -0,0 +1,2 @@ +--- +custom_template: "template.tpl"