File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66use Cake \Datasource \EntityInterface ;
77use Cake \Event \EventInterface ;
88use Cake \Event \EventManager ;
9- use Cake \ORM \TableRegistry ;
109use Muffin \Footprint \Event \FootprintListener ;
1110use RuntimeException ;
1211
@@ -151,7 +150,7 @@ protected function _circumventEventManager(string $method, array $args = [])
151150 {
152151 EventManager::instance ()->off ('Model.initialize ' , [$ this , 'footprint ' ]);
153152 $ result = call_user_func_array (
154- [TableRegistry:: getTableLocator ()->get ($ this ->_userModel ), $ method ],
153+ [$ this -> getTableLocator ()->get ($ this ->_userModel ), $ method ],
155154 $ args
156155 );
157156 EventManager::instance ()->on ('Model.initialize ' , [$ this , 'footprint ' ]);
Original file line number Diff line number Diff line change 77use Cake \Event \Event ;
88use Cake \Event \EventManager ;
99use Cake \ORM \Table ;
10- use Cake \ORM \TableRegistry ;
1110use Cake \TestSuite \TestCase ;
1211use TestApp \Controller \ArticlesController ;
1312
@@ -25,7 +24,7 @@ public function setUp(): void
2524 ->withData ('password ' , 'cake ' ));
2625 $ this ->controller ->Auth ->setConfig ('authenticate ' , ['Form ' ]);
2726
28- $ Users = TableRegistry:: getTableLocator ()->get ('Users ' );
27+ $ Users = $ this -> getTableLocator ()->get ('Users ' );
2928 $ Users ->updateAll (['password ' => password_hash ('cake ' , PASSWORD_BCRYPT )], []);
3029 }
3130
Original file line number Diff line number Diff line change 44namespace Muffin \Footprint \Test \TestCase \Model \Behavior ;
55
66use Cake \ORM \Entity ;
7- use Cake \ORM \TableRegistry ;
87use Cake \TestSuite \TestCase ;
98
109class FootprintBehaviorTest extends TestCase
@@ -17,7 +16,7 @@ public function setUp(): void
1716 {
1817 parent ::setUp ();
1918
20- $ table = TableRegistry:: get ('Muffin/Footprint.Articles ' );
19+ $ table = $ this -> getTableLocator ()-> get ('Muffin/Footprint.Articles ' );
2120 $ table ->addBehavior ('Muffin/Footprint.Footprint ' , [
2221 'events ' => [
2322 'Model.beforeSave ' => [
@@ -42,7 +41,7 @@ public function setUp(): void
4241 public function tearDown (): void
4342 {
4443 parent ::tearDown ();
45- TableRegistry:: clear ();
44+ $ this -> getTableLocator ()-> clear ();
4645 }
4746
4847 public function testSave ()
You can’t perform that action at this time.
0 commit comments