Commit fbb8e860 authored by catch's avatar catch
Browse files

Issue #3130606 by shaktik, mondrake, KapilV, longwave, daffie:...

Issue #3130606 by shaktik, mondrake, KapilV, longwave, daffie: MockBuilder::setMethods is deprecated in PHPUnit8 and removed from PHPUnit10
parent 9e96d1c8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ public function testSettingsForm() {
    ]);

    $test_processor = $this->getMockBuilder('Drupal\aggregator_test\Plugin\aggregator\processor\TestProcessor')
      ->setMethods(['buildConfigurationForm', 'validateConfigurationForm', 'submitConfigurationForm'])
      ->onlyMethods(['buildConfigurationForm', 'validateConfigurationForm', 'submitConfigurationForm'])
      ->setConstructorArgs([[], 'aggregator_test', ['description' => ''], $this->configFactory])
      ->getMock();
    $test_processor->expects($this->once())
+2 −2
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ public function testCalculateDependencies() {
    // Mock the entity under test so that we can mock getPluginCollections().
    $entity = $this->getMockBuilder('\Drupal\block\Entity\Block')
      ->setConstructorArgs([$values, $this->entityTypeId])
      ->setMethods(['getPluginCollections'])
      ->onlyMethods(['getPluginCollections'])
      ->getMock();
    // Create a configurable plugin that would add a dependency.
    $instance_id = $this->randomMachineName();
@@ -106,7 +106,7 @@ public function testCalculateDependencies() {
    // Create a plugin collection to contain the instance.
    $plugin_collection = $this->getMockBuilder('\Drupal\Core\Plugin\DefaultLazyPluginCollection')
      ->disableOriginalConstructor()
      ->setMethods(['get'])
      ->onlyMethods(['get'])
      ->getMock();
    $plugin_collection->expects($this->atLeastOnce())
      ->method('get')
+3 −3
Original line number Diff line number Diff line
@@ -47,9 +47,9 @@ class BlockPageVariantTest extends UnitTestCase {
  public function setUpDisplayVariant($configuration = [], $definition = []) {

    $container = new Container();
    $cache_context_manager = $this->getMockBuilder('Drupal\Core\Cache\CacheContextsManager')
    $cache_context_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
      ->disableOriginalConstructor()
      ->setMethods(['assertValidTokens'])
      ->onlyMethods(['assertValidTokens'])
      ->getMock();
    $container->set('cache_contexts_manager', $cache_context_manager);
    $cache_context_manager->expects($this->any())
@@ -62,7 +62,7 @@ public function setUpDisplayVariant($configuration = [], $definition = []) {

    return $this->getMockBuilder('Drupal\block\Plugin\DisplayVariant\BlockPageVariant')
      ->setConstructorArgs([$configuration, 'test', $definition, $this->blockRepository, $this->blockViewBuilder, ['config:block_list']])
      ->setMethods(['getRegionNames'])
      ->addMethods(['getRegionNames'])
      ->getMock();
  }

+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ public function testTransformException() {
    $migrate_lookup = $this->prophesize(MigrateLookupInterface::class);
    $this->row = $this->getMockBuilder('Drupal\migrate\Row')
      ->disableOriginalConstructor()
      ->setMethods(['getSourceProperty'])
      ->onlyMethods(['getSourceProperty'])
      ->getMock();
    $this->row->expects($this->exactly(2))
      ->method('getSourceProperty')
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ protected function setUp(): void {
    parent::setUp();
    $this->bookUninstallValidator = $this->getMockBuilder('Drupal\book\BookUninstallValidator')
      ->disableOriginalConstructor()
      ->setMethods(['hasBookOutlines', 'hasBookNodes'])
      ->onlyMethods(['hasBookOutlines', 'hasBookNodes'])
      ->getMock();
    $this->bookUninstallValidator->setStringTranslation($this->getStringTranslationStub());
  }
Loading