Ensures that the default controller is used as a fallback.
function testEntityAccessDefaultController() {
// Remove the access controller definition from the test entity.
state()
->set('entity_test.default_access_controller', TRUE);
// Check that the default access controller is used for entities that don't
// have a specific access controller defined.
$controller = entity_access_controller('entity_test');
$this
->assertTrue($controller instanceof \Drupal\Core\Entity\EntityAccessController, 'The default entity controller is used for the entity_test entity type.');
$entity = entity_create('entity_test', array());
$this
->assertEntityAccess(array(
'create' => FALSE,
'update' => FALSE,
'delete' => FALSE,
'view' => FALSE,
), $entity);
}