Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-11-09-14-08-33
[civicrm-core.git] / CRM / Core / Page / QUnit.php
index c0b0538ffe982c92991be5f55e171cc4c1d8c29e..5920d7779c6173da58180760dd526335b9815f0f 100644 (file)
@@ -9,7 +9,12 @@ require_once 'CRM/Core/Page.php';
 class CRM_Core_Page_QUnit extends CRM_Core_Page {
   protected $tplFile = NULL;
 
-  function run() {
+  /**
+   * Run.
+   *
+   * @throws \CRM_Core_Exception
+   */
+  public function run() {
     list ($ext, $suite) = $this->getRequestExtAndSuite();
     if (empty($ext) || empty($suite)) {
       throw new CRM_Core_Exception("FIXME: Not implemented: QUnit browser");
@@ -40,17 +45,17 @@ class CRM_Core_Page_QUnit extends CRM_Core_Page {
 
     CRM_Utils_System::setTitle(ts('QUnit: %2 (%1)', array(1 => $ext, 2 => $suite)));
     CRM_Core_Resources::singleton()
-      ->addScriptFile('civicrm', 'packages/qunit/qunit.js', 1, 'html-header')
-      ->addStyleFile('civicrm', 'packages/qunit/qunit.css', 1, 'html-header');
+      ->addScriptFile('civicrm', 'bower_components/qunit/qunit/qunit.js', 1, 'html-header')
+      ->addStyleFile('civicrm', 'bower_components/qunit/qunit/qunit.css', 1, 'html-header');
     parent::run();
   }
 
   /**
-   * Extrac the extension and suite from the request path
+   * Extract the extension and suite from the request path.
    *
    * @return array
    */
-  function getRequestExtAndSuite() {
+  public function getRequestExtAndSuite() {
     $config = CRM_Core_Config::singleton();
     $arg = explode('/', $_GET[$config->userFrameworkURLVar]);
 
@@ -68,4 +73,5 @@ class CRM_Core_Page_QUnit extends CRM_Core_Page {
       return array(NULL, NULL);
     }
   }
+
 }