X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fbook%2Ftests%2Fsrc%2FKernel%2FPlugin%2Fmigrate%2Fsource%2FBookTest.php;fp=web%2Fcore%2Fmodules%2Fbook%2Ftests%2Fsrc%2FKernel%2FPlugin%2Fmigrate%2Fsource%2FBookTest.php;h=02594742591f6aaabfcaba31a296f67f4a8eea22;hp=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/book/tests/src/Kernel/Plugin/migrate/source/BookTest.php b/web/core/modules/book/tests/src/Kernel/Plugin/migrate/source/BookTest.php new file mode 100644 index 000000000..025947425 --- /dev/null +++ b/web/core/modules/book/tests/src/Kernel/Plugin/migrate/source/BookTest.php @@ -0,0 +1,100 @@ + '1', + 'nid' => '4', + 'bid' => '4', + ], + ]; + $tests[0]['source_data']['menu_links'] = [ + [ + 'menu_name' => 'book-toc-1', + 'mlid' => '1', + 'plid' => '0', + 'link_path' => 'node/4', + 'router_path' => 'node/%', + 'link_title' => 'Test top book title', + 'options' => 'a:0:{}', + 'module' => 'book', + 'hidden' => '0', + 'external' => '0', + 'has_children' => '1', + 'expanded' => '0', + 'weight' => '-10', + 'depth' => '1', + 'customized' => '0', + 'p1' => '1', + 'p2' => '0', + 'p3' => '0', + 'p4' => '0', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + 'updated' => '0', + ], + ]; + + // The expected results. + $tests[0]['expected_data'] = [ + [ + 'nid' => '4', + 'bid' => '4', + 'mlid' => '1', + 'plid' => '0', + 'weight' => '-10', + 'p1' => '1', + 'p2' => '0', + 'p3' => '0', + 'p4' => '0', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + ], + ]; + return $tests; + } + + /** + * @expectedDeprecation Book is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.x. Use \Drupal\book\Plugin\migrate\source\Book instead. See https://www.drupal.org/node/2947487 for more information. + */ + public function testDeprecatedPlugin() { + new D6Book( + [], + 'd6_book', + [], + $this->prophesize('Drupal\migrate\Plugin\MigrationInterface')->reveal(), + $this->prophesize('Drupal\Core\State\StateInterface')->reveal(), + $this->prophesize('Drupal\Core\Entity\EntityManagerInterface')->reveal() + ); + } + +}