function UpdateManagerUpdateTest::incompatibleUpdatesTableProvider

Same name in other branches
  1. 9 core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php \Drupal\Tests\update\Functional\UpdateManagerUpdateTest::incompatibleUpdatesTableProvider()
  2. 8.9.x core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php \Drupal\Tests\update\Functional\UpdateManagerUpdateTest::incompatibleUpdatesTableProvider()
  3. 11.x core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php \Drupal\Tests\update\Functional\UpdateManagerUpdateTest::incompatibleUpdatesTableProvider()

Provides data for test scenarios involving incompatible updates.

These test cases rely on the following fixtures containing the following releases:

  • aaa_update_test.8.x-1.2.xml

    • 8.x-1.2 Compatible with 8.0.0 core.
  • aaa_update_test.core_compatibility.8.x-1.2_8.x-2.2.xml
    • 8.x-1.2 Requires 8.1.0 and above.
  • bbb_update_test.1_0.xml
    • 8.x-1.0 is the only available release.
  • bbb_update_test.1_1.xml
    • 8.x-1.1 is available and compatible with everything (does not define <core_compatibility> at all).
  • bbb_update_test.1_2.xml
    • 8.x-1.1 is available and compatible with everything (does not define <core_compatibility> at all).
    • 8.x-1.2 is available and requires Drupal 8.1.0 and above.

Return value

array[] Test data.

File

core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php, line 86

Class

UpdateManagerUpdateTest
Tests the Update Manager module's 'Update' form and functionality.

Namespace

Drupal\Tests\update\Functional

Code

public static function incompatibleUpdatesTableProvider() {
    return [
        'only one compatible' => [
            'core_fixture' => '8.1.1',
            // aaa_update_test.8.x-1.2.xml has core compatibility set and will test
            // the case where $recommended_release['core_compatible'] === TRUE in
            // \Drupal\update\Form\UpdateManagerUpdate.
'a_fixture' => '8.x-1.2',
            // Use a fixture with only a 8.x-1.0 release so BBB is up to date.
'b_fixture' => '1_0',
            'compatible' => [
                'AAA' => '8.x-1.2',
            ],
            'incompatible' => [],
        ],
        'only one incompatible' => [
            'core_fixture' => '8.1.1',
            'a_fixture' => 'core_compatibility.8.x-1.2_8.x-2.2',
            // Use a fixture with only a 8.x-1.0 release so BBB is up to date.
'b_fixture' => '1_0',
            'compatible' => [],
            'incompatible' => [
                'AAA' => [
                    'recommended' => '8.x-1.2',
                    'range' => '8.1.0 to 8.1.1',
                ],
            ],
        ],
        'two compatible, no incompatible' => [
            'core_fixture' => '8.1.1',
            'a_fixture' => '8.x-1.2',
            // bbb_update_test.1_1.xml does not have core compatibility set and will
            // test the case where $recommended_release['core_compatible'] === NULL
            // in \Drupal\update\Form\UpdateManagerUpdate.
'b_fixture' => '1_1',
            'compatible' => [
                'AAA' => '8.x-1.2',
                'BBB' => '8.x-1.1',
            ],
            'incompatible' => [],
        ],
        'two incompatible, no compatible' => [
            'core_fixture' => '8.1.1',
            'a_fixture' => 'core_compatibility.8.x-1.2_8.x-2.2',
            // bbb_update_test.1_2.xml has core compatibility set and will test the
            // case where $recommended_release['core_compatible'] === FALSE in
            // \Drupal\update\Form\UpdateManagerUpdate.
'b_fixture' => '1_2',
            'compatible' => [],
            'incompatible' => [
                'AAA' => [
                    'recommended' => '8.x-1.2',
                    'range' => '8.1.0 to 8.1.1',
                ],
                'BBB' => [
                    'recommended' => '8.x-1.2',
                    'range' => '8.1.0 to 8.1.1',
                ],
            ],
        ],
        'one compatible, one incompatible' => [
            'core_fixture' => '8.1.1',
            'a_fixture' => 'core_compatibility.8.x-1.2_8.x-2.2',
            'b_fixture' => '1_1',
            'compatible' => [
                'BBB' => '8.x-1.1',
            ],
            'incompatible' => [
                'AAA' => [
                    'recommended' => '8.x-1.2',
                    'range' => '8.1.0 to 8.1.1',
                ],
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.