function FieldDiscoveryTest::testGetAllFields

Same name in this branch
  1. 10 core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\FieldDiscoveryTest::testGetAllFields()
Same name in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\FieldDiscoveryTest::testGetAllFields()
  2. 9 core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\FieldDiscoveryTest::testGetAllFields()
  3. 8.9.x core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\FieldDiscoveryTest::testGetAllFields()
  4. 8.9.x core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\FieldDiscoveryTest::testGetAllFields()
  5. 11.x core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\FieldDiscoveryTest::testGetAllFields()
  6. 11.x core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\FieldDiscoveryTest::testGetAllFields()

Tests the getAllFields method.

@covers ::getAllFields

File

core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php, line 281

Class

FieldDiscoveryTest
Tests FieldDiscovery service against Drupal 6.

Namespace

Drupal\Tests\migrate_drupal\Kernel\d6

Code

public function testGetAllFields() : void {
    $field_discovery_test = new FieldDiscoveryTestClass($this->fieldPluginManager, $this->migrationPluginManager, $this->logger);
    $actual_fields = $field_discovery_test->getAllFields('6');
    $actual_node_types = array_keys($actual_fields['node']);
    sort($actual_node_types);
    $this->assertSame([
        'node',
    ], array_keys($actual_fields));
    $this->assertSame([
        'employee',
        'page',
        'story',
        'test_page',
        'test_planet',
    ], $actual_node_types);
    $this->assertCount(25, $actual_fields['node']['story']);
    foreach ($actual_fields['node'] as $bundle => $fields) {
        foreach ($fields as $field_name => $field_info) {
            $this->assertArrayHasKey('type', $field_info);
            $this->assertCount(22, $field_info);
            $this->assertEquals($bundle, $field_info['type_name']);
        }
    }
}

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