[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/search/tests/fixtures/ -> mock_search_engine.php (source)

   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  namespace mock_search;
  18  
  19  /**
  20   * Search engine for testing purposes.
  21   *
  22   * @package   core_search
  23   * @category  phpunit
  24   * @copyright David Monllao {@link http://www.davidmonllao.com}
  25   * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  26   */
  27  
  28  defined('MOODLE_INTERNAL') || die;
  29  
  30  class engine extends \core_search\engine {
  31  
  32      public function is_installed() {
  33          return true;
  34      }
  35  
  36      public function is_server_ready() {
  37          return true;
  38      }
  39  
  40      public function add_document($document, $fileindexing = false) {
  41          // No need to implement.
  42      }
  43  
  44      public function execute_query($data, $usercontexts, $limit = 0) {
  45          // No need to implement.
  46      }
  47  
  48      public function delete($areaid = null) {
  49          return null;
  50      }
  51  
  52      public function to_document(\core_search\base $searcharea, $docdata) {
  53          return parent::to_document($searcharea, $docdata);
  54      }
  55  
  56      public function get_course($courseid) {
  57          return parent::get_course($courseid);
  58      }
  59  
  60      public function get_search_area($areaid) {
  61          return parent::get_search_area($areaid);
  62      }
  63  
  64      public function get_query_total_count() {
  65          return 0;
  66      }
  67  }


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1