EntityMockFactory.php in Hook Event Dispatcher 3.x
File
modules/preprocess_event_dispatcher/tests/src/Unit/Helpers/EntityMockFactory.php
View source
<?php
namespace Drupal\Tests\preprocess_event_dispatcher\Unit\Helpers;
use Drupal\Core\Entity\EntityInterface;
use Mockery;
final class EntityMockFactory {
public static function getMock(string $class, string $type, string $bundle, string $viewMode) : EntityInterface {
return Mockery::mock($class, EntityInterface::class, [
'getEntityType' => $type,
'bundle' => $bundle,
'getViewMode' => $viewMode,
]);
}
}