File tree Expand file tree Collapse file tree
tests/TestCase/Shell/Task Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,6 +175,11 @@ public function all()
175175 */
176176 public function getTableObject ($ className , $ table )
177177 {
178+ $ plugin = $ this ->param ('plugin ' );
179+ if (!empty ($ plugin )) {
180+ $ className = $ plugin . '. ' . $ className ;
181+ }
182+
178183 if (TableRegistry::exists ($ className )) {
179184 return TableRegistry::get ($ className );
180185 }
Original file line number Diff line number Diff line change @@ -181,6 +181,10 @@ public function testGetTableObject()
181181 $ this ->assertInstanceOf ('Cake\ORM\Table ' , $ result );
182182 $ this ->assertEquals ('bake_articles ' , $ result ->table ());
183183 $ this ->assertEquals ('Article ' , $ result ->alias ());
184+
185+ $ this ->Task ->params ['plugin ' ] = 'BakeTest ' ;
186+ $ result = $ this ->Task ->getTableObject ('Authors ' , 'bake_articles ' );
187+ $ this ->assertInstanceOf ('BakeTest\Model\Table\AuthorsTable ' , $ result );
184188 }
185189
186190 /**
You can’t perform that action at this time.
0 commit comments