Commit 27e48325 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Merge branch 'ISTWCMS-3002-l26yan-Add-and-enable-quick_node_clone-module' into '3.0.x'

ISTWCMS-3002 Add and enable quick node clone module

See merge request !178
parents 6fde7e98 45164f4d
......@@ -102,6 +102,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->bannerBlockTest();
$this->ofisTest();
$this->nodeRevisionDeleteTest();
$this->quickNodeCloneTest();
}
/**
......@@ -548,6 +549,15 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->drupalPostForm('node/add/' . $content_type, $edit, 'Save');
// Make sure no 'Revert to default' on the above content type layout page.
$this->assertSession()->buttonNotExists('Revert to defaults');
// Make sure 'Clone' tab not exist for site footer content type.
if ($content_type === 'uw_ct_site_footer') {
$this->assertSession()->linkNotExists('Clone');
}
// Make sure 'Clone' tab exist for web page, blog, news,
// events and catalog content types.
else {
$this->assertSession()->linkExists('Clone');
}
// Get the node ID of the newly-created node, store in $content_nids.
$nid = $this->xpath('//a[text() = "View"]');
......@@ -631,6 +641,8 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->drupalPostForm('node/add/uw_ct_sidebar', $edit, 'Save');
// Make sure no 'Revert to defaults' button on sidebar layout page.
$this->assertSession()->buttonNotExists('Revert to defaults');
// Make sure 'Clone' tab exist for sidebar content type.
$this->assertSession()->linkExists('Clone');
// Verify that the user is redirected to the layout edit page.
$this->assertSession()->addressMatches('/^\/[a-z0-9-\/]+\/layout$/');
......@@ -2179,6 +2191,8 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->submitForm($req_fields, 'Save');
// Make sure not 'Revert to defaults' button on profile layout page.
$this->assertSession()->buttonNotExists('Revert to defaults');
// Make sure 'Clone' tab found for profile content type.
$this->assertSession()->linkExists('Clone');
// Validate new content has been created with same name.
$this->assertSession()->pageTextContains('Profile ' . $profile_name . ' has been created.');
......@@ -2656,4 +2670,54 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->getSession()->getPage()->findField('edit-node-revision-delete-when-to-delete-time-time')->getValue('months');
}
/**
* Test for quick node clone.
*/
public function quickNodeCloneTest() {
$this->drupalLogin($this->drupalUsers['administrator']);
// Check quick node clone setting for node.
$this->drupalGet('admin/config/quick-node-clone');
$this->assertSession()->statusCodeEquals(200);
$this->getSession()->getPage()->findField('edit-text-to-prepend-to-title')->getValue('Clone of');
$this->assertSession()->checkboxNotChecked('edit-clone-status');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-ct-blog');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-ct-catalog-item');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-ct-contact');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-ct-event');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-ct-news-item');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-ct-profile');
$this->assertSession()->checkboxChecked('edit-bundle-names-uw-ct-sidebar');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-ct-site-footer');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-ct-web-page');
$this->assertSession()->checkboxChecked('edit-uw-ct-sidebar-field-uw-attach-page');
$this->assertSession()->checkboxNotChecked('edit-uw-ct-sidebar-layout-builder-layout');
$this->assertSession()->checkboxChecked('edit-allowed-bundles-uw-ct-blog');
$this->assertSession()->checkboxChecked('edit-allowed-bundles-uw-ct-catalog-item');
$this->assertSession()->checkboxChecked('edit-allowed-bundles-uw-ct-contact');
$this->assertSession()->checkboxChecked('edit-allowed-bundles-uw-ct-event');
$this->assertSession()->checkboxChecked('edit-allowed-bundles-uw-ct-news-item');
$this->assertSession()->checkboxChecked('edit-allowed-bundles-uw-ct-profile');
$this->assertSession()->checkboxChecked('edit-allowed-bundles-uw-ct-sidebar');
$this->assertSession()->checkboxNotChecked('edit-allowed-bundles-uw-ct-site-footer');
$this->assertSession()->checkboxChecked('edit-allowed-bundles-uw-ct-web-page');
// Check quick node clone setting for paragraph.
$this->drupalGet('admin/config/quick-node-clone-paragraph');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-para-call-to-action');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-para-fact-figure');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-para-ff');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-para-image-banner');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-para-local-video-banner');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-para-timeline');
$this->assertSession()->checkboxNotChecked('edit-bundle-names-uw-para-vimeo-video-banner');
$this->assertSession()->checkboxNotChecked('edit-allowed-bundles-uw-para-call-to-action');
$this->assertSession()->checkboxNotChecked('edit-allowed-bundles-uw-para-fact-figure');
$this->assertSession()->checkboxNotChecked('edit-allowed-bundles-uw-para-ff');
$this->assertSession()->checkboxNotChecked('edit-allowed-bundles-uw-para-image-banner');
$this->assertSession()->checkboxNotChecked('edit-allowed-bundles-uw-para-local-video-banner');
$this->assertSession()->checkboxNotChecked('edit-allowed-bundles-uw-para-timeline');
$this->assertSession()->checkboxNotChecked('edit-allowed-bundles-uw-para-vimeo-video-banner');
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment