diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-11-04 05:20:45 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-11-04 07:28:41 +0300 |
commit | 68d3487a0f7807e58cc7efdacfb561a2a000fa2c (patch) | |
tree | 061f0c7be4b799efe250b37fa7412fbc15477275 /tests/javascript/index.php | |
parent | da827372f3721461fab8cb8f524f8de84a268ddd (diff) |
refs #9163 use mysql instead of sqlite in tracker tests
Diffstat (limited to 'tests/javascript/index.php')
-rw-r--r-- | tests/javascript/index.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/tests/javascript/index.php b/tests/javascript/index.php index 702233d622..0cfd028493 100644 --- a/tests/javascript/index.php +++ b/tests/javascript/index.php @@ -5,7 +5,14 @@ <meta charset="utf-8"> <title>piwik.js: Unit Tests</title> <?php -require_once(dirname(__FILE__).'/SQLite.php'); +$root = dirname(__FILE__) . '/../..'; + +try { + $mysql = include_once $root . "/tests/PHPUnit/bootstrap.php"; +} catch (Exception $e) { + echo 'alert("' . $e->getMessage() . '")'; + $mysql = false; +} if(file_exists("stub.tpl")) { echo file_get_contents("stub.tpl"); @@ -22,17 +29,8 @@ function getHeartbeatToken() { return "<?php $token = md5(uniqid(mt_rand(), true)); echo $token; ?>"; } <?php -$sqlite = false; -if (file_exists("enable_sqlite")) { - if (class_exists('SQLite')) { - $sqlite = true; - } -} -if(!$sqlite) { - echo 'alert("WARNING: Javascript integration tests require sqlite, \n1) ensure this PHP extension is enabled to make sure you run all tests \napt-get install php5-sqlite \n2) Then please create an empty file enable_sqlite in tests/javascript/enable_sqlite \n3) Re-execute this page and make sure this popup does not display ");'; -} -if ($sqlite) { +if ($mysql) { echo ' var _paq = _paq || []; @@ -2710,7 +2708,7 @@ function PiwikTest() { }); <?php -if ($sqlite) { +if ($mysql) { ?> module("request", { |