Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2016-07-10 23:16:25 +0300
committerGitHub <noreply@github.com>2016-07-10 23:16:25 +0300
commit044ad81c55c04b6d9d29f0cc237a647dbd82f9cc (patch)
tree21bca26ea27c24d6121cd97638ee5090ac689e80 /tests/javascript
parentd4cfa405c217695eb8e23e867cc22f152de69079 (diff)
Let plugins provide custom piwik.js tracker tests (#10270)
Plugins could provide custom tracker tests by creating a file 'tests/javascript/index.php' within the plugin. Won't be a documented feature for now but could add it to dev changelog if needed. Content within the test file could be eg ``` <script type="text/javascript"> test("MyPiwikTest", function() { expect(1); var tracker = Piwik.getTracker(); equal(typeof tracker.trackGoal, 'function', 'trackGoal' ); }); </script> ```
Diffstat (limited to 'tests/javascript')
-rw-r--r--tests/javascript/index.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/javascript/index.php b/tests/javascript/index.php
index 75c134a56b..f796b93cf3 100644
--- a/tests/javascript/index.php
+++ b/tests/javascript/index.php
@@ -4159,6 +4159,14 @@ function customAddEventListener(element, eventType, eventHandler, useCapture) {
}
})(PiwikTest);
</script>
+
+<?php
+ include_once $root . '/core/Filesystem.php';
+ $files = \Piwik\Filesystem::globr($root . '/plugins/*/tests/javascript', 'index.php');
+ foreach ($files as $file) {
+ include_once $file;
+ }
+?>
<div id="jashDiv">
<a href="#" onclick="javascript:loadJash();" title="Open JavaScript Shell"><img id="title" src="gnome-terminal.png" border="0" width="24" height="24" /></a>