File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed
tests/Unit/Generator/Definition/Entity Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Generator \Definition \Entity ;
4+
5+ use N3XT0R \MigrationGenerator \Service \Generator \Definition \Entity \AbstractIndexEntity ;
6+ use Tests \TestCase ;
7+
8+ class AbstractIndexEntityTest extends TestCase
9+ {
10+ protected AbstractIndexEntity $ entity ;
11+
12+ public function setUp (): void
13+ {
14+ parent ::setUp ();
15+ $ this ->entity = new class () extends AbstractIndexEntity {
16+ };
17+ }
18+
19+ public function testSetGetNameIsSame (): void
20+ {
21+ $ name = uniqid ('TEST_ ' , true );
22+ $ this ->entity ->setName ($ name );
23+ $ gotName = $ this ->entity ->getName ();
24+ self ::assertSame ($ name , $ gotName );
25+ }
26+
27+ public function testSetGetIndexTypeIsSame (): void
28+ {
29+ $ indexType = uniqid ('TEST_ ' , true );
30+ $ this ->entity ->setIndexType ($ indexType );
31+ $ gotIndexType = $ this ->entity ->getIndexType ();
32+ self ::assertSame ($ indexType , $ gotIndexType );
33+ }
34+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Generator \Definition \Entity ;
4+
5+ use N3XT0R \MigrationGenerator \Service \Generator \Definition \Entity \PrimaryKeyEntity ;
6+ use Tests \TestCase ;
7+
8+ class PrimaryKeyDefinitionTest extends TestCase
9+ {
10+ protected PrimaryKeyEntity $ entity ;
11+
12+ public function setUp (): void
13+ {
14+ parent ::setUp ();
15+ $ this ->entity = new PrimaryKeyEntity ();
16+ }
17+
18+ public function testSetGetColumnsWorks (): void
19+ {
20+ $ columns = ['test ' , 'test2 ' ];
21+ $ this ->entity ->setColumns ($ columns );
22+ $ gotColumns = $ this ->entity ->getColumns ();
23+ $ this ->assertSame ($ columns , $ gotColumns );
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments