Fix unit test in case no vendor/autoload.php, a=chris
Fix unit test in case no vendor/autoload.php, a=chris
diff --git a/src/controllers/SearchController.php b/src/controllers/SearchController.php
index 4c5240fc7..0e56d1e58 100755
--- a/src/controllers/SearchController.php
+++ b/src/controllers/SearchController.php
@@ -777,7 +777,8 @@ class SearchController extends Controller implements CrawlConstants
$data['PAGING_QUERY']['s'] = $this->subsearch_name;
}
$data['QUERY'] = urlencode($this->clean($query, "string"));
- if(C\nsdefined("ADVERTISEMENT_TYPE") &&
+ if(php_sapi_name() != 'cli' &&
+ C\nsdefined("ADVERTISEMENT_TYPE") &&
C\ADVERTISEMENT_TYPE == 'keyword_advertisements') {
$data['ELEMENT'] = "displayadvertisement";
$advertisement_model = $this->model("advertisement");
@@ -817,7 +818,7 @@ class SearchController extends Controller implements CrawlConstants
$data['PAGING_QUERY'][C\CSRF_TOKEN] = $data[C\CSRF_TOKEN];
}
$data['PAGING_QUERY']['its'] = empty($data['its']) ? 0 : $data['its'];
- if(C\REDIRECTS_ON) {
+ if(C\nsdefined("REDIRECTS_ON") && C\REDIRECTS_ON) {
unset($data['PAGING_QUERY']['s']);
}
$data['VIDEO_SOURCES'] =
diff --git a/src/library/Utility.php b/src/library/Utility.php
index d2c137a3a..cbaada7ee 100755
--- a/src/library/Utility.php
+++ b/src/library/Utility.php
@@ -314,7 +314,7 @@ function packPosting($doc_index, $position_list, $delta = true)
/**
* Given a packed integer string, uses the top three bytes to calculate
* a doc_index of a document in the shard, and uses the low order byte
- * to computer a number of occurences of a word in that document.
+ * to computer a number of occurrences of a word in that document.
*
* @param string $posting a string containing
* a doc index position list pair coded encoded using modified9
diff --git a/tests/index.php b/tests/index.php
index bbd3596a1..25b1a811a 100644
--- a/tests/index.php
+++ b/tests/index.php
@@ -47,8 +47,6 @@ define("seekquarry\\yioop\\configs\\PARENT_DIR",
-strlen("tests/index.php")));
define("seekquarry\\yioop\\configs\\BASE_DIR", C\PARENT_DIR . "/src");
header("X-FRAME-OPTIONS: DENY"); //prevent click jacking
-/** For class autoload **/
-require_once C\PARENT_DIR ."/vendor/autoload.php";
/**
* Load the crawlHash function
*/