55
66
77use N3XT0R \MigrationGenerator \Service \Generator \Compiler \Mapper \IndexMapper ;
8+ use N3XT0R \MigrationGenerator \Service \Generator \Definition \Entity \ForeignKeyEntity ;
89use N3XT0R \MigrationGenerator \Service \Generator \Definition \Entity \IndexEntity ;
910use PHPUnit \Framework \TestCase ;
1011
@@ -20,12 +21,12 @@ public function setUp(): void
2021
2122 public function testMapWithAnyOtherDataThanIndexShouldNotWork (): void
2223 {
23- $ data = [1 , 2 , 3 ];
24+ $ data = [new ForeignKeyEntity (), new IndexEntity (), new IndexEntity () ];
2425 $ this ->assertCount (0 , $ this ->mapper ->map ($ data ));
2526 }
2627
2728 /**
28- * @param string $type
29+ * @param string $type
2930 * @testWith ["index"]
3031 * ["unique"]
3132 */
@@ -39,11 +40,11 @@ public function testMapWithSingleIndexWorks(string $type): void
3940 $ result = $ this ->mapper ->map ([$ index ]);
4041 $ this ->assertCount (1 , $ result );
4142
42- $ this ->assertStringContainsString ('$table-> ' . $ index ->getType () . '( \'test \', \'testIndex \'); ' , $ result [0 ]);
43+ $ this ->assertStringContainsString ('$table-> ' . $ index ->getType (). '( \'test \', \'testIndex \'); ' , $ result [0 ]);
4344 }
4445
4546 /**
46- * @param string $type
47+ * @param string $type
4748 * @testWith ["index"]
4849 * ["unique"]
4950 */
@@ -58,7 +59,7 @@ public function testMapWithMultipleIndexWorks(string $type): void
5859 $ this ->assertCount (1 , $ result );
5960
6061 $ this ->assertStringContainsString (
61- '$table-> ' . $ index ->getType () . '([ \'test \', \'test2 \'], \'testIndex2 \'); ' ,
62+ '$table-> ' . $ index ->getType (). '([ \'test \', \'test2 \'], \'testIndex2 \'); ' ,
6263 $ result [0 ]
6364 );
6465 }
0 commit comments