You are here

function DrupalSolrOfflineSearchPagesWebTestCase::testCloneSearchPage in Apache Solr Search 7

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

Asserts that we can clone a search page

File

tests/apachesolr_base.test, line 331
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/config/search/apachesolr/search-pages');
  $this
    ->assertText(t('Clone'), t('Clone button is available'));
  $this
    ->drupalGet('admin/config/search/apachesolr/search-pages/core_search/clone');
  $this
    ->assertText(t('Are you sure you want to clone search page Core Search?'), t('Clone confirmation page was successfully loaded'));
  $this
    ->drupalPost($this
    ->getUrl(), array(), t('Clone'));
  $this
    ->assertResponse(200);
  drupal_static_reset('apachesolr_search_load_all_search_pages');
  $this
    ->drupalGet('admin/config/search/apachesolr/search-pages');
  $this
    ->assertText(t('Core Search [cloned]'), 'Search page was successfully cloned');
}