function SearchPageRepositoryTest::testIsSearchActive
Same name in other branches
- 9 core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php \Drupal\Tests\search\Unit\SearchPageRepositoryTest::testIsSearchActive()
- 8.9.x core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php \Drupal\Tests\search\Unit\SearchPageRepositoryTest::testIsSearchActive()
- 11.x 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 97
Class
- SearchPageRepositoryTest
- @coversDefaultClass \Drupal\search\SearchPageRepository @group search
Namespace
Drupal\Tests\search\UnitCode
public function testIsSearchActive() : void {
$this->query
->expects($this->once())
->method('condition')
->with('status', TRUE)
->willReturn($this->query);
$this->query
->expects($this->once())
->method('range')
->with(0, 1)
->willReturn($this->query);
$this->query
->expects($this->once())
->method('execute')
->willReturn([
'test' => 'test',
]);
$this->assertTrue($this->searchPageRepository
->isSearchActive());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.