function FieldDiscoveryTest::getCoreVersionData

Same name in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::getCoreVersionData()
  2. 8.9.x core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::getCoreVersionData()
  3. 10 core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::getCoreVersionData()

Provides data for testGetCoreVersion()

Return value

array The test data.

File

core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php, line 245

Class

FieldDiscoveryTest
Tests the FieldDiscovery Class.

Namespace

Drupal\Tests\migrate_drupal\Unit

Code

public static function getCoreVersionData() {
    return [
        'Drupal 7' => [
            'tags' => [
                'Drupal 7',
            ],
            'expected_result' => '7',
        ],
        'Drupal 6' => [
            'tags' => [
                'Drupal 6',
            ],
            'expected_result' => '6',
        ],
        'D7 with others' => [
            'tags' => [
                'Drupal 7',
                'Translation',
                'Other Tag',
            ],
            'expected_result' => '7',
        ],
        'Both (d7 has priority)' => [
            'tags' => [
                'Drupal 6',
                'Drupal 7',
            ],
            'expected_result' => '7',
        ],
        'Neither' => [
            'tags' => [
                'drupal 6',
                'Drupal_6',
                'This contains Drupal 7 but is not',
            ],
            'expected_result' => FALSE,
        ],
    ];
}

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