Skip to content
Snippets Groups Projects
Commit a65d1f9d authored by catch's avatar catch
Browse files

Issue #3433052 by mondrake: Fix remaining return*() methods of class...

Issue #3433052 by mondrake: Fix remaining return*() methods of class PHPUnit\Framework\TestCase deprecated in PHPUnit 10

(cherry picked from commit d671f38a)
parent 8528858e
No related branches found
No related tags found
29 merge requests!122353526426-warning-for-missing,!12212Issue #3445525 by alexpott, japerry, catch, mglaman, longwave: Add BC layer...,!11958Issue #3490507 by alexpott, smustgrave: Fix bogus mocking in...,!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!10602Issue #3438769 by vinmayiswamy, antonnavi, michelle, amateescu: Sub workspace does not clear,!10301Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...,!10187Issue #3487488 by dakwamine: ExtensionMimeTypeGuesser::guessMimeType must support file names with "0" (zero) like foo.0.zip,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!9929Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9787Resolve issue 3479427 - bootstrap barrio issue under Windows,!9742Issue #3463908 by catch, quietone: Split OptionsFieldUiTest into two,!9526Issue #3458177 by mondrake, catch, quietone, godotislate, longwave, larowlan,...,!8738Issue #3424162 by camilledavis, dineshkumarbollu, smustgrave: Claro...,!8704Make greek characters available in ckeditor5,!8597Draft: Issue #3442259 by catch, quietone, dww: Reduce time of Migrate Upgrade tests...,!8533Issue #3446962 by kim.pepper: Remove incorrectly added...,!8517Issue #3443748 by NexusNovaz, smustgrave: Testcase creates false positive,!8325Update file Sort.php,!8095Expose document root on install,!7930Resolve #3427374 "Taxonomytid viewsargumentdefault plugin",!7627Issue #3439440 by nicxvan, Binoli Lalani, longwave: Remove country support from DateFormatter,!7445Issue #3440169: When using drupalGet(), provide an associative array for $headers,!7401#3271894 Fix documented StreamWrapperInterface return types for realpath() and dirname(),!7384Add constraints to system.advisories,!6622Issue #2559833 by piggito, mohit_aghera, larowlan, guptahemant, vakulrai,...,!6502Draft: Resolve #2938524 "Plach testing issue",!38582585169-10.1.x,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key
Pipeline #126892 passed
Pipeline: drupal

#126895

    ......@@ -57,17 +57,17 @@ protected function setUp(): void {
    $language_de = $this->createMock(LanguageInterface::class);
    $language_de->expects($this->any())
    ->method('getId')
    ->will($this->returnValue('de'));
    ->willReturn('de');
    $language_de->expects($this->any())
    ->method('getName')
    ->will($this->returnValue('German'));
    ->willReturn('German');
    $language_en = $this->createMock(LanguageInterface::class);
    $language_en->expects($this->any())
    ->method('getId')
    ->will($this->returnValue('en'));
    ->willReturn('en');
    $language_en->expects($this->any())
    ->method('getName')
    ->will($this->returnValue('English'));
    ->willReturn('English');
    $this->languages = [
    'de' => $language_de,
    'en' => $language_en,
    ......@@ -76,10 +76,10 @@ protected function setUp(): void {
    $language_manager = $this->createMock(ConfigurableLanguageManagerInterface::class);
    $language_manager->expects($this->any())
    ->method('getLanguages')
    ->will($this->returnValue($this->languages));
    ->willReturn($this->languages);
    $language_manager->expects($this->any())
    ->method('getNativeLanguages')
    ->will($this->returnValue($this->languages));
    ->willReturn($this->languages);
    $this->languageManager = $language_manager;
    $container = new ContainerBuilder();
    ......@@ -167,10 +167,10 @@ public function testProcessOutbound() {
    ['hasLowerLanguageNegotiationWeight', 'meetsContentEntityRoutesCondition', 'getLangcode']);
    $languageNegotiationContentEntityMock->expects($this->any())
    ->method('hasLowerLanguageNegotiationWeight')
    ->will($this->returnValue(TRUE));
    ->willReturn(TRUE);
    $languageNegotiationContentEntityMock->expects($this->any())
    ->method('meetsContentEntityRoutesCondition')
    ->will($this->returnValue(TRUE));
    ->willReturn(TRUE);
    $languageNegotiationContentEntityMock->expects($this->exactly(2))
    ->method('getLangcode')
    ->willReturnOnConsecutiveCalls(
    ......
    ......@@ -49,7 +49,7 @@ public function testFormatterLinkItemUrlMalformed() {
    $fieldTypePluginManager = $this->createMock(FieldTypePluginManagerInterface::class);
    $fieldTypePluginManager->expects($this->once())
    ->method('createFieldItem')
    ->will($this->returnValue($linkItem));
    ->willReturn($linkItem);
    $urlGenerator = $this->createMock(UrlGenerator::class);
    $urlGenerator->expects($this->once())
    ->method('generateFromRoute')
    ......@@ -91,7 +91,7 @@ public function testFormatterLinkItemUrlUnexpectedException() {
    $fieldTypePluginManager = $this->createMock(FieldTypePluginManagerInterface::class);
    $fieldTypePluginManager->expects($this->once())
    ->method('createFieldItem')
    ->will($this->returnValue($linkItem));
    ->willReturn($linkItem);
    $container = new ContainerBuilder();
    $container->set('plugin.manager.field.field_type', $fieldTypePluginManager);
    \Drupal::setContainer($container);
    ......@@ -128,7 +128,7 @@ public function testFormatterLinkItem() {
    $fieldTypePluginManager = $this->createMock(FieldTypePluginManagerInterface::class);
    $fieldTypePluginManager->expects($this->once())
    ->method('createFieldItem')
    ->will($this->returnValue($linkItem));
    ->willReturn($linkItem);
    $urlGenerator = $this->createMock(UrlGenerator::class);
    $urlGenerator->expects($this->once())
    ->method('generateFromRoute')
    ......
    ......@@ -54,7 +54,7 @@ protected function setUp(): void {
    ->expects($this->once())
    ->method('hasLinkTemplate')
    ->with('version-history')
    ->will($this->returnValue(TRUE));
    ->willReturn(TRUE);
    $entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
    $entityTypeManager->expects($this->any())
    ->method('getDefinitions')
    ......
    ......@@ -114,10 +114,10 @@ public function testUpdateEmail($notification_threshold, $params, $authorized, a
    $this->configFactory
    ->expects($this->exactly(2))
    ->method('get')
    ->will($this->returnValueMap([
    ->willReturnMap([
    ['system.site', $config_site_name],
    ['update.settings', $config_notification],
    ]));
    ]);
    // The calls to generateFromRoute differ if authorized.
    $count = 2;
    ......@@ -133,11 +133,11 @@ public function testUpdateEmail($notification_threshold, $params, $authorized, a
    $this->urlGenerator
    ->expects($this->exactly($count))
    ->method('generateFromRoute')
    ->will($this->returnValueMap([
    ->willReturnMap([
    ['update.status', [], ['absolute' => TRUE, 'language' => $langcode], FALSE, $update_settings_url],
    ['update.settings', [], ['absolute' => TRUE], FALSE, $available_updates_url],
    ['update.report_update', [], ['absolute' => TRUE, 'language' => $langcode], FALSE, $available_updates_url],
    ]));
    ]);
    // Set the container.
    $this->container->set('language_manager', $this->languageManager);
    ......
    ......@@ -74,7 +74,7 @@ public function testQuery() {
    ]);
    $this->view->expects($this->any())
    ->method('getRequest')
    ->will($this->returnValue($request));
    ->willReturn($request);
    $options = [];
    $this->pager->init($this->view, $this->display, $options);
    ......
    ......@@ -56,13 +56,13 @@ public function testDifferentServices() {
    $container->expects($this->exactly(2))
    ->method('get')
    ->will(
    $this->returnCallback(function ($service) use ($testFastCacheFactory, $testConsistentCacheFactory) {
    ->willReturnCallback(
    function ($service) use ($testFastCacheFactory, $testConsistentCacheFactory) {
    return match ($service) {
    'cache.backend.test_consistent' => $testConsistentCacheFactory,
    'cache.backend.test_fast' => $testFastCacheFactory,
    };
    })
    }
    );
    // The same bin should be retrieved from both backends.
    ......
    ......@@ -51,10 +51,10 @@ protected function setUp(): void {
    $this->sourceStorage->expects($this->atLeastOnce())
    ->method('getCollectionName')
    ->will($this->returnValue(StorageInterface::DEFAULT_COLLECTION));
    ->willReturn(StorageInterface::DEFAULT_COLLECTION);
    $this->targetStorage->expects($this->atLeastOnce())
    ->method('getCollectionName')
    ->will($this->returnValue(StorageInterface::DEFAULT_COLLECTION));
    ->willReturn(StorageInterface::DEFAULT_COLLECTION);
    $this->storageComparer = new StorageComparer($this->sourceStorage, $this->targetStorage);
    }
    ......
    ......@@ -36,10 +36,10 @@ protected function setUp(): void {
    $language = new Language(['langcode' => 'en']);
    $this->languageManager->expects($this->any())
    ->method('getDefaultLanguage')
    ->will($this->returnValue($language));
    ->willReturn($language);
    $this->languageManager->expects($this->any())
    ->method('getCurrentLanguage')
    ->will($this->returnValue($language));
    ->willReturn($language);
    $container->set('language_manager', $this->languageManager);
    \Drupal::setContainer($container);
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment