Commit 9db39454 authored by legolasbo's avatar legolasbo Committed by Joris Vercammen

Issue #3042654 by legolasbo, arpitr, akshay_d, borisson_: Drupal 9 Deprecated Code Report

parent 54832c24
......@@ -57,15 +57,15 @@ class FacetSourcePluginManagerTest extends UnitTestCase {
* {@inheritdoc}
*/
public function setUp() {
$this->discovery = $this->getMock(DiscoveryInterface::class);
$this->discovery = $this->createMock(DiscoveryInterface::class);
$this->factory = $this->getMockBuilder(DefaultFactory::class)
->disableOriginalConstructor()
->getMock();
$this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
$this->moduleHandler = $this->createMock(ModuleHandlerInterface::class);
$this->cache = $this->getMock(CacheBackendInterface::class);
$this->cache = $this->createMock(CacheBackendInterface::class);
$namespaces = new ArrayObject();
......
......@@ -64,7 +64,7 @@ class ListItemProcessorTest extends UnitTestCase {
// Create a search api based facet source and make the property definition
// return null.
$data_definition = $this->getMock(ComplexDataDefinitionInterface::class);
$data_definition = $this->createMock(ComplexDataDefinitionInterface::class);
$data_definition->expects($this->any())
->method('getPropertyDefinition')
->willReturn(NULL);
......
......@@ -59,18 +59,18 @@ class TranslateEntityProcessorTest extends UnitTestCase {
parent::setUp();
// Mock the typed data chain.
$target_field_definition = $this->getMock(EntityDataDefinition::class);
$target_field_definition = $this->createMock(EntityDataDefinition::class);
$target_field_definition->expects($this->once())
->method('getEntityTypeId')
->willReturn('entity_type');
$property_definition = $this->getMock(DataReferenceDefinitionInterface::class);
$property_definition = $this->createMock(DataReferenceDefinitionInterface::class);
$property_definition->expects($this->any())
->method('getTargetDefinition')
->willReturn($target_field_definition);
$property_definition->expects($this->any())
->method('getDataType')
->willReturn('entity_reference');
$data_definition = $this->getMock(ComplexDataDefinitionInterface::class);
$data_definition = $this->createMock(ComplexDataDefinitionInterface::class);
$data_definition->expects($this->any())
->method('getPropertyDefinition')
->willReturn($property_definition);
......@@ -130,7 +130,7 @@ class TranslateEntityProcessorTest extends UnitTestCase {
$nodes = [
2 => $node,
];
$node_storage = $this->getMock(EntityStorageInterface::class);
$node_storage = $this->createMock(EntityStorageInterface::class);
$node_storage->expects($this->any())
->method('loadMultiple')
->willReturn($nodes);
......@@ -173,7 +173,7 @@ class TranslateEntityProcessorTest extends UnitTestCase {
$terms = [
2 => $term,
];
$term_storage = $this->getMock(EntityStorageInterface::class);
$term_storage = $this->createMock(EntityStorageInterface::class);
$term_storage->expects($this->any())
->method('loadMultiple')
->willReturn($terms);
......@@ -208,7 +208,7 @@ class TranslateEntityProcessorTest extends UnitTestCase {
*/
public function testDeletedEntityResults() {
// Set original results.
$term_storage = $this->getMock(EntityStorageInterface::class);
$term_storage = $this->createMock(EntityStorageInterface::class);
$term_storage->expects($this->any())
->method('loadMultiple')
->willReturn([]);
......
......@@ -39,9 +39,9 @@ class UidToUserNameCallbackProcessorTest extends UnitTestCase {
* Tests that results were correctly changed.
*/
public function testResultsChanged() {
$user_storage = $this->getMock(EntityStorageInterface::class);
$entity_manager = $this->getMock(EntityManagerInterface::class);
$entity_repository = $this->getMock(EntityTypeRepositoryInterface::class);
$user_storage = $this->createMock(EntityStorageInterface::class);
$entity_manager = $this->createMock(EntityManagerInterface::class);
$entity_repository = $this->createMock(EntityTypeRepositoryInterface::class);
$entity_repository->expects($this->any())
->method('getEntityTypeFromClass')
->willReturn('user');
......@@ -49,7 +49,7 @@ class UidToUserNameCallbackProcessorTest extends UnitTestCase {
->method('getStorage')
->willReturn($user_storage);
$user1 = $this->getMock(AccountInterface::class);
$user1 = $this->createMock(AccountInterface::class);
$user1->method('getDisplayName')
->willReturn('Admin');
......@@ -90,9 +90,9 @@ class UidToUserNameCallbackProcessorTest extends UnitTestCase {
* Tests that deleted entity results were correctly handled.
*/
public function testDeletedEntityResults() {
$user_storage = $this->getMock(EntityStorageInterface::class);
$entity_manager = $this->getMock(EntityManagerInterface::class);
$entity_repository = $this->getMock(EntityTypeRepositoryInterface::class);
$user_storage = $this->createMock(EntityStorageInterface::class);
$entity_manager = $this->createMock(EntityManagerInterface::class);
$entity_repository = $this->createMock(EntityTypeRepositoryInterface::class);
$entity_repository->expects($this->any())
->method('getEntityTypeFromClass')
->willReturn('user');
......
......@@ -107,7 +107,7 @@ class UrlProcessorHandlerTest extends UnitTestCase {
->method('createInstance')
->willReturn($url_processor);
$storage = $this->getMock(EntityStorageInterface::class);
$storage = $this->createMock(EntityStorageInterface::class);
$em = $this->getMockBuilder(EntityTypeManagerInterface::class)
->disableOriginalConstructor()
->getMock();
......
......@@ -87,7 +87,7 @@ class QueryStringTest extends UnitTestCase {
$discovery_property->setAccessible(TRUE);
$discovery_property->setValue($facet, 'test');
$storage = $this->getMock(EntityStorageInterface::class);
$storage = $this->createMock(EntityStorageInterface::class);
$storage->expects($this->any())
->method('loadByProperties')
->willReturn([$facet]);
......@@ -124,7 +124,7 @@ class QueryStringTest extends UnitTestCase {
$discovery_property->setAccessible(TRUE);
$discovery_property->setValue($facet, 'test');
$storage = $this->getMock(EntityStorageInterface::class);
$storage = $this->createMock(EntityStorageInterface::class);
$storage->expects($this->atLeastOnce())
->method('loadByProperties')
->willReturnOnConsecutiveCalls([$facet], [$facet], []);
......@@ -205,7 +205,7 @@ class QueryStringTest extends UnitTestCase {
$discovery_property->setAccessible(TRUE);
$discovery_property->setValue($facet, 'test');
$storage = $this->getMock(EntityStorageInterface::class);
$storage = $this->createMock(EntityStorageInterface::class);
$storage->expects($this->atLeastOnce())
->method('loadByProperties')
->willReturnOnConsecutiveCalls([$facet2], [$facet2], [$facet2], [$facet2], [$facet2], [$facet2]);
......@@ -271,7 +271,7 @@ class QueryStringTest extends UnitTestCase {
$facet_source = new FacetSource(['filter_key' => 'ab'], 'facets_facet_source');
// Override the container with the new facet source.
$storage = $this->getMock(EntityStorageInterface::class);
$storage = $this->createMock(EntityStorageInterface::class);
$storage->expects($this->once())
->method('load')
->willReturn($facet_source);
......@@ -403,7 +403,7 @@ class QueryStringTest extends UnitTestCase {
'_route' => 'test',
]);
$validator = $this->getMock(PathValidatorInterface::class);
$validator = $this->createMock(PathValidatorInterface::class);
$fsi = $this->getMockBuilder(FacetSourcePluginInterface::class)
->disableOriginalConstructor()
......@@ -426,7 +426,7 @@ class QueryStringTest extends UnitTestCase {
$facetentity->method('id')
->willReturn('king');
$storage = $this->getMock(EntityStorageInterface::class);
$storage = $this->createMock(EntityStorageInterface::class);
$storage->expects($this->any())
->method('loadByProperties')
->willReturn([$facetentity]);
......
......@@ -266,7 +266,7 @@ class LinksWidgetTest extends WidgetTestBase {
->method('createInstance')
->willReturn($url_processor);
$storage = $this->getMock(EntityStorageInterface::class);
$storage = $this->createMock(EntityStorageInterface::class);
$em = $this->getMockBuilder(EntityTypeManagerInterface::class)
->disableOriginalConstructor()
->getMock();
......
......@@ -65,17 +65,17 @@ class ProcessorPluginManagerTest extends UnitTestCase {
* {@inheritdoc}
*/
public function setUp() {
$this->discovery = $this->getMock(DiscoveryInterface::class);
$this->discovery = $this->createMock(DiscoveryInterface::class);
$this->factory = $this->getMockBuilder(DefaultFactory::class)
->disableOriginalConstructor()
->getMock();
$this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
$this->moduleHandler = $this->createMock(ModuleHandlerInterface::class);
$this->cache = $this->getMock(CacheBackendInterface::class);
$this->cache = $this->createMock(CacheBackendInterface::class);
$this->translator = $this->getMock(TranslationInterface::class);
$this->translator = $this->createMock(TranslationInterface::class);
$namespaces = new ArrayObject();
......
......@@ -56,7 +56,7 @@ class QueryTypePluginManagerTest extends UnitTestCase {
* {@inheritdoc}
*/
public function setUp() {
$this->discovery = $this->getMock(DiscoveryInterface::class);
$this->discovery = $this->createMock(DiscoveryInterface::class);
$this->factory = $this->getMockBuilder(DefaultFactory::class)
->disableOriginalConstructor()
......
......@@ -64,17 +64,17 @@ class UrlProcessorPluginManagerTest extends UnitTestCase {
* {@inheritdoc}
*/
public function setUp() {
$this->discovery = $this->getMock(DiscoveryInterface::class);
$this->discovery = $this->createMock(DiscoveryInterface::class);
$this->factory = $this->getMockBuilder(DefaultFactory::class)
->disableOriginalConstructor()
->getMock();
$this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
$this->moduleHandler = $this->createMock(ModuleHandlerInterface::class);
$this->cache = $this->getMock(CacheBackendInterface::class);
$this->cache = $this->createMock(CacheBackendInterface::class);
$this->translator = $this->getMock(TranslationInterface::class);
$this->translator = $this->createMock(TranslationInterface::class);
$namespaces = new ArrayObject();
......
......@@ -43,9 +43,9 @@ class FacetsDateHandlerTest extends UnitTestCase {
public function setUp() {
parent::setUp();
$entity_storage = $this->getMock(EntityStorageInterface::class);
$entity_storage = $this->createMock(EntityStorageInterface::class);
$em = $this->getMock(EntityManagerInterface::class);
$em = $this->createMock(EntityManagerInterface::class);
$em->expects($this->any())
->method('getStorage')
->with('date_format')
......@@ -53,11 +53,11 @@ class FacetsDateHandlerTest extends UnitTestCase {
$language = new Language(['id' => 'en']);
$lm = $this->getMock(LanguageManagerInterface::class);
$lm = $this->createMock(LanguageManagerInterface::class);
$lm->method('getCurrentLanguage')
->willReturn($language);
$st = $this->getMock(TranslationInterface::class);
$rs = $this->getMock(RequestStack::class);
$st = $this->createMock(TranslationInterface::class);
$rs = $this->createMock(RequestStack::class);
$cf = $this->getConfigFactoryStub();
$config_factory = $this->getConfigFactoryStub([
......
......@@ -64,17 +64,17 @@ class WidgetPluginManagerTest extends UnitTestCase {
* {@inheritdoc}
*/
public function setUp() {
$this->discovery = $this->getMock(DiscoveryInterface::class);
$this->discovery = $this->createMock(DiscoveryInterface::class);
$this->factory = $this->getMockBuilder(DefaultFactory::class)
->disableOriginalConstructor()
->getMock();
$this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);
$this->moduleHandler = $this->createMock(ModuleHandlerInterface::class);
$this->cache = $this->getMock(CacheBackendInterface::class);
$this->cache = $this->createMock(CacheBackendInterface::class);
$this->translator = $this->getMock(TranslationInterface::class);
$this->translator = $this->createMock(TranslationInterface::class);
$namespaces = new ArrayObject();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment