Skip to content
Snippets Groups Projects
Commit ce0cda2a authored by Kurucz István's avatar Kurucz István
Browse files

Test node-type "promote", "status" and "sticky" checkbox.

parent ae40b9d6
No related branches found
No related tags found
No related merge requests found
<?php
namespace Drupal\Tests\migrate_drupal_d5\Kernel;
use Drupal\Core\Field\Entity\BaseFieldOverride;
/**
* @group migrate_drupal_5
*/
class MigrateNodeSettingPromoteTest extends MigrateDrupal5TestBase {
protected static $modules = ['node', 'text', 'menu_ui'];
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->installConfig(['node']);
$this->executeMigration('d5_node_type');
$this->executeMigration('d5_node_setting_promote');
}
/**
* Tests migration of the "promote" checkbox's settings for "page" node type.
*/
public function testPageNodeTypePromote() {
$this->assertSame(0, BaseFieldOverride::load('node.page.promote')->getDefaultValueLiteral()[0]['value']);
}
/**
* Tests migration of the "promote" checkbox's settings for "book" node type.
*/
public function testBookNodeTypePromote() {
$this->assertSame(1, BaseFieldOverride::load('node.book.promote')->getDefaultValueLiteral()[0]['value']);
}
}
<?php
namespace Drupal\Tests\migrate_drupal_d5\Kernel;
use Drupal\Core\Field\Entity\BaseFieldOverride;
/**
* @group migrate_drupal_5
*/
class MigrateNodeSettingStatusTest extends MigrateDrupal5TestBase {
protected static $modules = ['node', 'text', 'menu_ui'];
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->installConfig(['node']);
$this->executeMigration('d5_node_type');
$this->executeMigration('d5_node_setting_status');
}
/**
* Tests migration of the "status" checkbox's settings for "page" node type.
*/
public function testPageNodeTypeStatus() {
$this->assertSame(0, BaseFieldOverride::load('node.page.status')->getDefaultValueLiteral()[0]['value']);
}
/**
* Tests migration of the "status" checkbox's settings for "book" node type.
*/
public function testBookNodeTypeStatus() {
$this->assertSame(1, BaseFieldOverride::load('node.book.status')->getDefaultValueLiteral()[0]['value']);
}
}
<?php
namespace Drupal\Tests\migrate_drupal_d5\Kernel;
use Drupal\Core\Field\Entity\BaseFieldOverride;
/**
* @group migrate_drupal_5
*/
class MigrateNodeSettingStickyTest extends MigrateDrupal5TestBase {
protected static $modules = ['node', 'text', 'menu_ui'];
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->installConfig(['node']);
$this->executeMigration('d5_node_type');
$this->executeMigration('d5_node_setting_sticky');
}
/**
* Tests migration of the "sticky" checkbox's settings for "page" node type.
*/
public function testPageNodeTypeSticky() {
$this->assertSame(0, BaseFieldOverride::load('node.page.sticky')->getDefaultValueLiteral()[0]['value']);
}
/**
* Tests migration of the "sticky" checkbox's settings for "book" node type.
*/
public function testBookNodeTypeSticky() {
$this->assertSame(1, BaseFieldOverride::load('node.book.sticky')->getDefaultValueLiteral()[0]['value']);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment