public static function registerSearch($name, $class) { parent::registerSearch($name, $class); self::$_searches[$name] = $class; }
* CoOrg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with CoOrg. If not, see <http://www.gnu.org/licenses/>. */ $fooSearch = new stdClass; $fooSearch->title = 'Foos'; $fooSearch->module = 'search'; $fooSearch->file = 'foo-search-results.html.tpl'; Searchable::registerSearch('SearchFoo', $fooSearch); class SearchControllerTest extends CoOrgControllerTest { const dataset = 'search.dataset.xml'; public function setUp() { parent::setUp(); $bar = new SearchBar; $bar->title = 'Bar Title'; $bar->someOtherPrimary = 'The Primary'; $bar->body = 'Lorem Ipsum'; $bar->language = 'en';
<?php $pageSearch = new stdClass; $pageSearch->title = t('Content'); $pageSearch->module = 'page'; $pageSearch->file = 'search-results.html.tpl'; Searchable::registerSearch('Page', $pageSearch); ?>