Skip to content

Commit

Permalink
classgenerator test
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Oct 23, 2019
1 parent 3a50fc4 commit 8e50943
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/Migrations/Generator/ClassNameGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public function generateClassName(string $namespace) : string
{
return $namespace . '\\' . $this->generateVersionNumber();
return $namespace . '\\Version' . $this->generateVersionNumber();
}

private function generateVersionNumber() : string
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Doctrine\Migrations\Tests\Generator;

use Doctrine\Migrations\Generator\ClassNameGenerator;
use PHPUnit\Framework\TestCase;

class ClassNameGeneratorTest extends TestCase
{
public function testName() : void
{
$generator = new ClassNameGenerator();
$fqcn = $generator->generateClassName('Foo');
self::assertRegExp('/^Foo\\\\Version[0-9]{14}$/', $fqcn);
}
}

0 comments on commit 8e50943

Please sign in to comment.