* @throws \CRM_Core_Exception
*/
public function run() {
+ $qunitJsFile = Civi::paths()->getPath('[civicrm.bower]/qunit/qunit/qunit.js');
+ $qunitJsUrl = Civi::paths()->getUrl('[civicrm.bower]/qunit/qunit/qunit.js');
+ $qunitCssUrl = Civi::paths()->getUrl('[civicrm.bower]/qunit/qunit/qunit.css');
+ if (!file_exists($qunitJsFile)) {
+ throw new \CRM_Core_Exception("QUnit is not available. Please install it in [civicrm.bower]/qunit.");
+ }
+
list ($ext, $suite) = $this->getRequestExtAndSuite();
if (empty($ext) || empty($suite)) {
throw new CRM_Core_Exception("FIXME: Not implemented: QUnit browser");
CRM_Utils_System::setTitle(ts('QUnit: %2 (%1)', [1 => $ext, 2 => $suite]));
CRM_Core_Resources::singleton()
- ->addScriptFile('civicrm', 'bower_components/qunit/qunit/qunit.js', 1, 'html-header')
- ->addStyleFile('civicrm', 'bower_components/qunit/qunit/qunit.css', 1, 'html-header');
+ ->addScriptUrl($qunitJsUrl, 1, 'html-header')
+ ->addStyleUrl($qunitCssUrl, 1, 'html-header');
parent::run();
}