You are here

function DrupalSolrOfflineSearchPagesWebTestCase::testCloneSearchPage in Apache Solr Search 6.3

Same name and namespace in other branches
  1. 8 tests/apachesolr_base.test \DrupalSolrOfflineSearchPagesWebTestCase::testCloneSearchPage()
  2. 7 tests/apachesolr_base.test \DrupalSolrOfflineSearchPagesWebTestCase::testCloneSearchPage()

Asserts that we can clone a search page

File

tests/apachesolr_base.test, line 355
Unit test class that provides tests for base functionality of the Apachesolr Module without having the need of a Solr Server

Class

DrupalSolrOfflineSearchPagesWebTestCase
@file Unit test class that provides tests for base functionality of the Apachesolr Module without having the need of a Solr Server

Code

function testCloneSearchPage() {
  $this
    ->drupalLogin($this->admin_user);
  $this
    ->drupalGet('admin/settings/apachesolr/search-pages');

  // Reset static var
  apachesolr_search_page_load('core_search', TRUE);
  $this
    ->assertText(t('Clone'), t('Clone button is available'));
  $this
    ->drupalGet('admin/settings/apachesolr/search-pages/core_search/clone');
  $this
    ->assertText(t('Are you sure you want to clone search page'), t('Clone confirmation page was successfully loaded'));
  $this
    ->drupalPost($this
    ->getUrl(), array(), t('Clone'));
  $this
    ->assertResponse(200);

  // Reset static var
  apachesolr_search_page_load('core_search', TRUE);
  $this
    ->drupalGet('admin/settings/apachesolr/search-pages');
  $this
    ->assertText(t('Core Search [cloned]'), 'Search page was successfully cloned');
}