MigrateNoMigrateDrupalTest.php in Drupal 8
File
core/modules/migrate/tests/src/Functional/MigrateNoMigrateDrupalTest.php
View source
<?php
namespace Drupal\Tests\migrate\Functional;
use Drupal\node\Entity\Node;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\node\Traits\ContentTypeCreationTrait;
class MigrateNoMigrateDrupalTest extends BrowserTestBase {
use ContentTypeCreationTrait;
protected $defaultTheme = 'stark';
protected static $modules = [
'migrate',
'migrate_no_migrate_drupal_test',
'node',
];
protected function setUp() {
parent::setUp();
$this
->writeSettings([
'settings' => [
'deployment_identifier' => (object) [
'value' => 'force-new-apcu-key',
'required' => TRUE,
],
],
]);
$this
->createContentType([
'type' => 'no_migrate_drupal',
]);
}
public function testExecutionNoMigrateDrupal() {
$this
->drupalGet('/migrate_no_migrate_drupal_test/execute');
$this
->assertSession()
->pageTextContains('Migration was successful.');
$node_1 = Node::load(1);
$node_2 = Node::load(2);
$this
->assertEquals('Node 1', $node_1
->label());
$this
->assertEquals('Node 2', $node_2
->label());
}
}