You are here

public function SearchPageRepositoryTest::testIsSearchActive in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php \Drupal\Tests\search\Unit\SearchPageRepositoryTest::testIsSearchActive()

Tests the isSearchActive() method.

File

core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php, line 95
Contains \Drupal\Tests\search\Unit\SearchPageRepositoryTest.

Class

SearchPageRepositoryTest
@coversDefaultClass \Drupal\search\SearchPageRepository @group search

Namespace

Drupal\Tests\search\Unit

Code

public function testIsSearchActive() {
  $this->query
    ->expects($this
    ->once())
    ->method('condition')
    ->with('status', TRUE)
    ->will($this
    ->returnValue($this->query));
  $this->query
    ->expects($this
    ->once())
    ->method('range')
    ->with(0, 1)
    ->will($this
    ->returnValue($this->query));
  $this->query
    ->expects($this
    ->once())
    ->method('execute')
    ->will($this
    ->returnValue(array(
    'test' => 'test',
  )));
  $this
    ->assertSame(TRUE, $this->searchPageRepository
    ->isSearchActive());
}