ProfileFieldCheckRequirementsTest.php

Same filename in this branch
  1. 11.x core/modules/user/tests/src/Kernel/Migrate/d6/ProfileFieldCheckRequirementsTest.php
Same filename in other branches
  1. 9 core/modules/user/tests/src/Kernel/Migrate/d6/ProfileFieldCheckRequirementsTest.php
  2. 9 core/modules/user/tests/src/Kernel/Migrate/d7/ProfileFieldCheckRequirementsTest.php
  3. 8.9.x core/modules/user/tests/src/Kernel/Migrate/d6/ProfileFieldCheckRequirementsTest.php
  4. 8.9.x core/modules/user/tests/src/Kernel/Migrate/d7/ProfileFieldCheckRequirementsTest.php
  5. 10 core/modules/user/tests/src/Kernel/Migrate/d6/ProfileFieldCheckRequirementsTest.php
  6. 10 core/modules/user/tests/src/Kernel/Migrate/d7/ProfileFieldCheckRequirementsTest.php

Namespace

Drupal\Tests\user\Kernel\Migrate\d7

File

core/modules/user/tests/src/Kernel/Migrate/d7/ProfileFieldCheckRequirementsTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\user\Kernel\Migrate\d7;

use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
use Drupal\migrate\Exception\RequirementsException;

/**
 * Tests check requirements for profile_field source plugin.
 *
 * @group user
 */
class ProfileFieldCheckRequirementsTest extends MigrateDrupal7TestBase {
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        parent::setUp();
        $this->sourceDatabase
            ->schema()
            ->dropTable('profile_field');
    }
    
    /**
     * Tests exception is thrown when profile_fields tables do not exist.
     */
    public function testCheckRequirements() : void {
        $this->expectException(RequirementsException::class);
        $this->expectExceptionMessage('Profile module not enabled on source site');
        $this->getMigration('user_profile_field')
            ->getSourcePlugin()
            ->checkRequirements();
    }

}

Classes

Title Deprecated Summary
ProfileFieldCheckRequirementsTest Tests check requirements for profile_field source plugin.

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