class DoubleSlashTest
Same name and namespace in other branches
- 11.x core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php \Drupal\Tests\migrate_drupal_ui\Functional\d7\DoubleSlashTest
- 10 core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php \Drupal\Tests\migrate_drupal_ui\Functional\d7\DoubleSlashTest
Tests that a double slash is not in d7_file file not found migrate messages.
@group migrate_drupal_ui
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase uses \Drupal\migrate_drupal\MigrationConfigurationTrait extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase uses \Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait extends \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase
- class \Drupal\Tests\migrate_drupal_ui\Functional\d7\DoubleSlashTest extends \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase
- class \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase uses \Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait extends \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase
- class \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase uses \Drupal\migrate_drupal\MigrationConfigurationTrait extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of DoubleSlashTest
File
-
core/
modules/ migrate_drupal_ui/ tests/ src/ Functional/ d7/ DoubleSlashTest.php, line 13
Namespace
Drupal\Tests\migrate_drupal_ui\Functional\d7View source
class DoubleSlashTest extends MigrateUpgradeExecuteTestBase {
/**
* {@inheritdoc}
*/
protected $profile = 'testing';
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected static $modules = [
'file',
'migrate_drupal_ui',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->loadFixture(\Drupal::service('extension.list.module')->getPath('migrate_drupal') . '/tests/fixtures/drupal7.php');
}
/**
* Executes all steps of migrations upgrade.
*/
public function testMigrateUpgradeExecute() {
// Change fid 1 to a filename that does not exist.
$this->sourceDatabase
->update('file_managed')
->condition('fid', 1)
->fields([
'filename' => 'foo.txt',
'uri' => 'public://foo.txt',
])
->execute();
// Get valid credentials.
$edits = $this->translatePostValues($this->getCredentials());
// Start the upgrade process.
$this->drupalGet('/upgrade');
$this->submitForm([], 'Continue');
$this->submitForm($edits, 'Review upgrade');
$this->submitForm([], 'I acknowledge I may lose data. Continue anyway.');
$this->useTestMailCollector();
$this->submitForm([], 'Perform upgrade');
// Tests the migration log contains an error message.
$migration = $this->getMigrationPluginManager()
->createInstance('d7_file');
$messages = $migration->getIdMap()
->getMessages();
$count = 0;
foreach ($messages as $message) {
$count++;
$this->assertStringContainsString('/migrate_drupal_ui/tests/src/Functional/d7/files/sites/default/files/foo.txt', $message->message);
$this->assertSame(MigrationInterface::MESSAGE_ERROR, (int) $message->level);
}
$this->assertSame(1, $count);
}
/**
* {@inheritdoc}
*/
protected function getSourceBasePath() {
return __DIR__ . '/files';
}
/**
* {@inheritdoc}
*/
protected function getEntityCounts() {
return [];
}
/**
* {@inheritdoc}
*/
protected function getEntityCountsIncremental() {
return [];
}
/**
* {@inheritdoc}
*/
protected function getAvailablePaths() {
return [];
}
/**
* {@inheritdoc}
*/
protected function getMissingPaths() {
return [];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.