Skip to content
Permalink
Browse files

Fix entity class inflection for mocked models.

  • Loading branch information...
ADmad committed Jul 24, 2018
1 parent 49dbe09 commit b6b8c24539d3cbc7aa9745c58b957f4f1147dcef
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/TestSuite/TestCase.php
@@ -699,7 +699,7 @@ public function getMockForModel($alias, array $methods = [], array $options = []
if (empty($options['entityClass']) && $mock->getEntityClass() === Entity::class) {
$parts = explode('\\', $className);
$entityAlias = Inflector::singularize(substr(array_pop($parts), 0, -5));
$entityAlias = Inflector::classify(Inflector::underscore(substr(array_pop($parts), 0, -5)));
$entityClass = implode('\\', array_slice($parts, 0, -1)) . '\\Entity\\' . $entityAlias;
if (class_exists($entityClass)) {
$mock->setEntityClass($entityClass);

0 comments on commit b6b8c24

Please sign in to comment.
You can’t perform that action at this time.