Skip to content

Commit

Permalink
Fix more deprecated method usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 21, 2017
1 parent a3bec46 commit 7aadd8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Datasource/QueryTrait.php
Expand Up @@ -427,7 +427,7 @@ public function firstOrFail()
if (!$entity) {
throw new RecordNotFoundException(sprintf(
'Record not found in table "%s"',
$this->repository()->table()
$this->repository()->getTable()
));
}

Expand Down
4 changes: 2 additions & 2 deletions src/TestSuite/TestCase.php
Expand Up @@ -698,12 +698,12 @@ public function getMockForModel($alias, array $methods = [], array $options = []
->setConstructorArgs([$options])
->getMock();

if (empty($options['entityClass']) && $mock->entityClass() === '\Cake\ORM\Entity') {
if (empty($options['entityClass']) && $mock->getEntityClass() === '\Cake\ORM\Entity') {
$parts = explode('\\', $options['className']);
$entityAlias = Inflector::singularize(substr(array_pop($parts), 0, -5));
$entityClass = implode('\\', array_slice($parts, 0, -1)) . '\Entity\\' . $entityAlias;
if (class_exists($entityClass)) {
$mock->entityClass($entityClass);
$mock->setEntityClass($entityClass);
}
}

Expand Down

0 comments on commit 7aadd8b

Please sign in to comment.