17
17
class StiParentBehaviorTest extends TestCase
18
18
{
19
19
public $ fixtures = [
20
- 'plugin.Robotusers\TableInheritance.users '
20
+ 'plugin.Robotusers\TableInheritance.Users '
21
21
];
22
22
23
23
/**
@@ -39,16 +39,16 @@ public function setUp()
39
39
'' => User::class
40
40
];
41
41
42
- $ this ->table = TableRegistry::get ('Users ' );
43
- $ this ->table ->entityClass (User::class);
42
+ $ this ->table = TableRegistry::getTableLocator ()-> get ('Users ' );
43
+ $ this ->table ->setEntityClass (User::class);
44
44
45
- $ authors = TableRegistry::get ('Authors ' , [
45
+ $ authors = TableRegistry::getTableLocator ()-> get ('Authors ' , [
46
46
'table ' => 'users '
47
47
]);
48
- $ editors = TableRegistry::get ('Editors ' , [
48
+ $ editors = TableRegistry::getTableLocator ()-> get ('Editors ' , [
49
49
'table ' => 'users '
50
50
]);
51
- $ readers = TableRegistry::get ('Readers ' , [
51
+ $ readers = TableRegistry::getTableLocator ()-> get ('Readers ' , [
52
52
'table ' => 'users '
53
53
]);
54
54
@@ -68,18 +68,18 @@ public function setUp()
68
68
]
69
69
]);
70
70
71
- $ authors ->entityClass (Author::class);
72
- $ editors ->entityClass (Editor::class);
73
- $ readers ->entityClass (Reader::class);
71
+ $ authors ->setEntityClass (Author::class);
72
+ $ editors ->setEntityClass (Editor::class);
73
+ $ readers ->setEntityClass (Reader::class);
74
74
}
75
75
76
76
public function testStiTable ()
77
77
{
78
- $ this ->table ->behaviors ()->get ('StiParent ' )->config ('tableMap ' , [
78
+ $ this ->table ->behaviors ()->get ('StiParent ' )->setConfig ('tableMap ' , [
79
79
'Readers ' => 'reader_* '
80
80
], false );
81
- $ this ->table ->behaviors ()->get ('StiParent ' )->config ('discriminatorMap ' , [
82
- '*author ' => TableRegistry::get ('Authors ' )
81
+ $ this ->table ->behaviors ()->get ('StiParent ' )->setConfig ('discriminatorMap ' , [
82
+ '*author ' => TableRegistry::getTableLocator ()-> get ('Authors ' )
83
83
], false );
84
84
85
85
$ map = [
@@ -96,7 +96,7 @@ public function testStiTable()
96
96
'discriminator ' => $ discriminator
97
97
]);
98
98
$ table = $ this ->table ->stiTable ($ entity );
99
- $ this ->assertEquals ($ alias , $ table ->alias ());
99
+ $ this ->assertEquals ($ alias , $ table ->getAlias ());
100
100
}
101
101
}
102
102
0 commit comments