|
@@ 71-92 (lines=22) @@
|
| 68 |
|
parent::tearDown(); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
public function testGenerateRepositories() |
| 72 |
|
{ |
| 73 |
|
$this->generateRepositories('DDC3231User1'); |
| 74 |
|
|
| 75 |
|
$cname = 'Doctrine\Tests\Models\DDC3231\DDC3231User1Repository'; |
| 76 |
|
$fname = str_replace('\\', DIRECTORY_SEPARATOR, $cname) . '.php'; |
| 77 |
|
|
| 78 |
|
self::assertFileExists($this->path . DIRECTORY_SEPARATOR . $fname); |
| 79 |
|
self::assertFileExists($this->path . DIRECTORY_SEPARATOR . 'DDC3231User1NoNamespaceRepository.php'); |
| 80 |
|
|
| 81 |
|
require $this->path . DIRECTORY_SEPARATOR . $fname; |
| 82 |
|
require $this->path . DIRECTORY_SEPARATOR . 'DDC3231User1NoNamespaceRepository.php'; |
| 83 |
|
|
| 84 |
|
self::assertTrue(class_exists($cname)); |
| 85 |
|
self::assertTrue(class_exists('DDC3231User1NoNamespaceRepository')); |
| 86 |
|
|
| 87 |
|
$repo1 = new \ReflectionClass($cname); |
| 88 |
|
$repo2 = new \ReflectionClass('DDC3231User1NoNamespaceRepository'); |
| 89 |
|
|
| 90 |
|
self::assertSame(EntityRepository::class, $repo1->getParentClass()->getName()); |
| 91 |
|
self::assertSame(EntityRepository::class, $repo2->getParentClass()->getName()); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
public function testGenerateRepositoriesCustomDefaultRepository() |
| 95 |
|
{ |
|
@@ 94-115 (lines=22) @@
|
| 91 |
|
self::assertSame(EntityRepository::class, $repo2->getParentClass()->getName()); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
public function testGenerateRepositoriesCustomDefaultRepository() |
| 95 |
|
{ |
| 96 |
|
$this->generateRepositories('DDC3231User2', DDC3231EntityRepository::class); |
| 97 |
|
|
| 98 |
|
$cname = 'Doctrine\Tests\Models\DDC3231\DDC3231User2Repository'; |
| 99 |
|
$fname = str_replace('\\', DIRECTORY_SEPARATOR, $cname) . '.php'; |
| 100 |
|
|
| 101 |
|
self::assertFileExists($this->path . DIRECTORY_SEPARATOR . $fname); |
| 102 |
|
self::assertFileExists($this->path . DIRECTORY_SEPARATOR . 'DDC3231User2NoNamespaceRepository.php'); |
| 103 |
|
|
| 104 |
|
require $this->path . DIRECTORY_SEPARATOR . $fname; |
| 105 |
|
require $this->path . DIRECTORY_SEPARATOR . 'DDC3231User2NoNamespaceRepository.php'; |
| 106 |
|
|
| 107 |
|
self::assertTrue(class_exists($cname)); |
| 108 |
|
self::assertTrue(class_exists('DDC3231User2NoNamespaceRepository')); |
| 109 |
|
|
| 110 |
|
$repo1 = new \ReflectionClass($cname); |
| 111 |
|
$repo2 = new \ReflectionClass('DDC3231User2NoNamespaceRepository'); |
| 112 |
|
|
| 113 |
|
self::assertSame(DDC3231EntityRepository::class, $repo1->getParentClass()->getName()); |
| 114 |
|
self::assertSame(DDC3231EntityRepository::class, $repo2->getParentClass()->getName()); |
| 115 |
|
} |
| 116 |
|
|
| 117 |
|
/** |
| 118 |
|
* @param string $filter |