diff --git a/tests/src/Kernel/MigrateNodeSettingPromoteTest.php b/tests/src/Kernel/MigrateNodeSettingPromoteTest.php new file mode 100644 index 0000000000000000000000000000000000000000..aa07579d2df5cdd046b4cf3a052537d3db3ba266 --- /dev/null +++ b/tests/src/Kernel/MigrateNodeSettingPromoteTest.php @@ -0,0 +1,37 @@ +<?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']); + } +} diff --git a/tests/src/Kernel/MigrateNodeSettingStatusTest.php b/tests/src/Kernel/MigrateNodeSettingStatusTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d4b291aadc6a22272dd3e49bb9ebe0bb2b563d58 --- /dev/null +++ b/tests/src/Kernel/MigrateNodeSettingStatusTest.php @@ -0,0 +1,37 @@ +<?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']); + } +} diff --git a/tests/src/Kernel/MigrateNodeSettingStickyTest.php b/tests/src/Kernel/MigrateNodeSettingStickyTest.php new file mode 100644 index 0000000000000000000000000000000000000000..496a80dabfb02532e36d99469cf3e98c99696872 --- /dev/null +++ b/tests/src/Kernel/MigrateNodeSettingStickyTest.php @@ -0,0 +1,37 @@ +<?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']); + } +}