Source of file MockStateTwo.php
Size: 1,351 Bytes - Last Modified: 2021-12-24T06:47:24+00:00
/var/www/docs.ssmods.com/process/src/tests/mocks/MockStateTwo.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 | <?php namespace Firesphere\SolrSearch\Tests; use Firesphere\SolrSearch\Interfaces\SiteStateInterface; use Firesphere\SolrSearch\Queries\BaseQuery; use Firesphere\SolrSearch\States\SiteState; use SilverStripe\Dev\TestOnly; class MockStateTwo extends SiteState implements TestOnly, SiteStateInterface { protected $state = 'Cow'; public function appliesToEnvironment(): bool { return $this->enabled; } public function currentState(): string { return $this->state; } public function activateState($state) { $this->state = $state; } /** * Is this state applicable to this extension * E.g. in case of Fluent, the state "SubsiteID1" does not make sense * * @param string $state * @return bool */ public function stateIsApplicable($state): bool { return in_array($state, ['Cow', 'Sheep']); } /** * Reset the SiteState to it's default state * * @param null $state * @return mixed */ public function setDefaultState($state = null) { $this->state = 'Cow'; } /** * Method to alter the query. Can be no-op. * * @param BaseQuery $query * @return mixed */ public function updateQuery(&$query) { // TODO: Implement updateQuery() method. } } |