projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website]
/
web
/
core
/
modules
/
editor
/
tests
/
src
/
Unit
/
EditorConfigEntityUnitTest.php
diff --git
a/web/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php
b/web/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php
index 4e96f4ac65139b46ad61243e56f4184b897f7235..e40e349a74253013aa7d2a0c8ae902af2c020749 100644
(file)
--- a/
web/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php
+++ b/
web/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php
@@
-3,6
+3,8
@@
namespace Drupal\Tests\editor\Unit;
use Drupal\Core\DependencyInjection\ContainerBuilder;
namespace Drupal\Tests\editor\Unit;
use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\EntityManager;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\editor\Entity\Editor;
use Drupal\Tests\UnitTestCase;
use Drupal\editor\Entity\Editor;
use Drupal\Tests\UnitTestCase;
@@
-22,9
+24,9
@@
class EditorConfigEntityUnitTest extends UnitTestCase {
/**
* The entity manager used for testing.
*
/**
* The entity manager used for testing.
*
- * @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Drupal\Core\Entity\Entity
Type
ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
*/
*/
- protected $entityManager;
+ protected $entity
Type
Manager;
/**
* The ID of the type of the entity under test.
/**
* The ID of the type of the entity under test.
@@
-66,8
+68,8
@@
class EditorConfigEntityUnitTest extends UnitTestCase {
->method('getProvider')
->will($this->returnValue('editor'));
->method('getProvider')
->will($this->returnValue('editor'));
- $this->entity
Manager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface'
);
- $this->entityManager->expects($this->any())
+ $this->entity
TypeManager = $this->getMock(EntityTypeManagerInterface::class
);
+ $this->entity
Type
Manager->expects($this->any())
->method('getDefinition')
->with($this->entityTypeId)
->will($this->returnValue($this->entityType));
->method('getDefinition')
->with($this->entityTypeId)
->will($this->returnValue($this->entityType));
@@
-78,10
+80,16
@@
class EditorConfigEntityUnitTest extends UnitTestCase {
->disableOriginalConstructor()
->getMock();
->disableOriginalConstructor()
->getMock();
+ $entity_manager = new EntityManager();
+
$container = new ContainerBuilder();
$container = new ContainerBuilder();
- $container->set('entity.manager', $this->entityManager);
+ $container->set('entity.manager', $entity_manager);
+ $container->set('entity_type.manager', $this->entityTypeManager);
$container->set('uuid', $this->uuid);
$container->set('plugin.manager.editor', $this->editorPluginManager);
$container->set('uuid', $this->uuid);
$container->set('plugin.manager.editor', $this->editorPluginManager);
+ // Inject the container into entity.manager so it can defer to
+ // entity_type.manager.
+ $entity_manager->setContainer($container);
\Drupal::setContainer($container);
}
\Drupal::setContainer($container);
}
@@
-120,7
+128,7
@@
class EditorConfigEntityUnitTest extends UnitTestCase {
->with($format_id)
->will($this->returnValue($filter_format));
->with($format_id)
->will($this->returnValue($filter_format));
- $this->entityManager->expects($this->once())
+ $this->entity
Type
Manager->expects($this->once())
->method('getStorage')
->with('filter_format')
->will($this->returnValue($storage));
->method('getStorage')
->with('filter_format')
->will($this->returnValue($storage));