diff --git a/lib/Doctrine/Migrations/Generator/ClassNameGenerator.php b/lib/Doctrine/Migrations/Generator/ClassNameGenerator.php index 99afb9ab07..3c9ca0c835 100644 --- a/lib/Doctrine/Migrations/Generator/ClassNameGenerator.php +++ b/lib/Doctrine/Migrations/Generator/ClassNameGenerator.php @@ -13,7 +13,7 @@ public function generateClassName(string $namespace) : string { - return $namespace . '\\' . $this->generateVersionNumber(); + return $namespace . '\\Version' . $this->generateVersionNumber(); } private function generateVersionNumber() : string diff --git a/tests/Doctrine/Migrations/Tests/Generator/ClassNameGeneratorTest.php b/tests/Doctrine/Migrations/Tests/Generator/ClassNameGeneratorTest.php new file mode 100644 index 0000000000..2e5cd82a35 --- /dev/null +++ b/tests/Doctrine/Migrations/Tests/Generator/ClassNameGeneratorTest.php @@ -0,0 +1,18 @@ +generateClassName('Foo'); + self::assertRegExp('/^Foo\\\\Version[0-9]{14}$/', $fqcn); + } +}