aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-12 21:51:07 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-12 21:51:07 +0000
commit19b7ea9a394af6e8366c64faa77badb716d743a5 (patch)
tree81382762378c7e5c2f62f4208c5cf6ff3a048b1d /js/tests
parent120488c29722c1cde9a4715ccbe0f1626d4738ae (diff)
downloadelgg-19b7ea9a394af6e8366c64faa77badb716d743a5.tar.gz
elgg-19b7ea9a394af6e8366c64faa77badb716d743a5.tar.bz2
Fixes #3065, #3089. Merged JS events and hooks to a single system. Updated plugins and core to use it. Added elgg.getURLFragment() and using it elgg.ui.popsUp().
git-svn-id: http://code.elgg.org/elgg/trunk@8671 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/ElggEventsTest.js28
-rw-r--r--js/tests/ElggHooksTest.js28
2 files changed, 28 insertions, 28 deletions
diff --git a/js/tests/ElggEventsTest.js b/js/tests/ElggEventsTest.js
deleted file mode 100644
index 4765878cf..000000000
--- a/js/tests/ElggEventsTest.js
+++ /dev/null
@@ -1,28 +0,0 @@
-ElggEventsTest = TestCase("ElggEventsTest");
-
-ElggEventsTest.prototype.setUp = function() {
- elgg.config.events = {};
- elgg.provide('elgg.config.events.all.all');
-};
-
-ElggEventsTest.prototype.testEventHandlersMustBeFunctions = function () {
- assertException(function() { elgg.register_event_handler('str', 'str', 'oops'); });
-};
-
-ElggEventsTest.prototype.testReturnValueDefaultsToTrue = function () {
- assertTrue(elgg.trigger_event('fee', 'fum'));
-
- elgg.register_event_handler('fee', 'fum', elgg.nullFunction);
- assertTrue(elgg.trigger_event('fee', 'fum'));
-};
-
-ElggEventsTest.prototype.testCanGlomEventsWithAll = function () {
- elgg.register_event_handler('all', 'bar', elgg.abstractMethod);
- assertException("all,bar", function() { elgg.trigger_event('foo', 'bar'); });
-
- elgg.register_event_handler('foo', 'all', elgg.abstractMethod);
- assertException("foo,all", function() { elgg.trigger_event('foo', 'baz'); });
-
- elgg.register_event_handler('all', 'all', elgg.abstractMethod);
- assertException("all,all", function() { elgg.trigger_event('pinky', 'winky'); });
-}; \ No newline at end of file
diff --git a/js/tests/ElggHooksTest.js b/js/tests/ElggHooksTest.js
new file mode 100644
index 000000000..e7a2440e7
--- /dev/null
+++ b/js/tests/ElggHooksTest.js
@@ -0,0 +1,28 @@
+ElggHooksTest = TestCase("ElggHooksTest");
+
+ElggHooksTest.prototype.setUp = function() {
+ elgg.config.hooks = {};
+ elgg.provide('elgg.config.hooks.all.all');
+};
+
+ElggHooksTest.prototype.testHookHandlersMustBeFunctions = function () {
+ assertException(function() { elgg.register_hook_handler('str', 'str', 'oops'); });
+};
+
+ElggHooksTest.prototype.testReturnValueDefaultsToTrue = function () {
+ assertTrue(elgg.trigger_hook('fee', 'fum'));
+
+ elgg.register_hook_handler('fee', 'fum', elgg.nullFunction);
+ assertTrue(elgg.trigger_hook('fee', 'fum'));
+};
+
+ElggHooksTest.prototype.testCanGlomHooksWithAll = function () {
+ elgg.register_hook_handler('all', 'bar', elgg.abstractMethod);
+ assertException("all,bar", function() { elgg.trigger_hook('foo', 'bar'); });
+
+ elgg.register_hook_handler('foo', 'all', elgg.abstractMethod);
+ assertException("foo,all", function() { elgg.trigger_hook('foo', 'baz'); });
+
+ elgg.register_hook_handler('all', 'all', elgg.abstractMethod);
+ assertException("all,all", function() { elgg.trigger_hook('pinky', 'winky'); });
+}; \ No newline at end of file