diff --git a/src/Command/TestCommand.php b/src/Command/TestCommand.php index 9fe9cd91..7dc6ebd8 100644 --- a/src/Command/TestCommand.php +++ b/src/Command/TestCommand.php @@ -24,6 +24,7 @@ use Cake\Core\Configure; use Cake\Core\Exception\CakeException; use Cake\Core\Plugin; +use Cake\Datasource\RepositoryInterface; use Cake\Filesystem\Filesystem; use Cake\Http\Response; use Cake\Http\ServerRequest as Request; @@ -459,12 +460,15 @@ public function generateFixtureList($subject): array /** * Process a model, pull out model name + associations converted to fixture names. * - * @param \Cake\ORM\Table $subject A Model class to scan for associations and pull fixtures off of. + * @param @param \Cake\Datasource\RepositoryInterface $subject A Model class to scan for associations and pull fixtures off of. * @return void */ - protected function _processModel(Table $subject): void + protected function _processModel(RepositoryInterface $subject): void { $this->_addFixture($subject->getAlias()); + if (!method_exists($subject, 'associations')) { + return; + } foreach ($subject->associations()->keys() as $alias) { $assoc = $subject->getAssociation($alias); $target = $assoc->getTarget();