Skip to content

Commit

Permalink
[+]: add more tests v2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Moelleken committed Jul 24, 2016
1 parent 3df7e06 commit 5b91c52
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/HooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public function testHasFunctions()
self::assertSame(true, $hooks->remove_all_filters('testFilter'));
self::assertSame(true, $hooks->remove_all_actions('testAction'));

self::assertFalse($hooks->has_filter(''));
self::assertFalse($hooks->has_filter(' '));
self::assertFalse($hooks->has_filter('testFilter'));
self::assertFalse($hooks->has_filter('testFilter', 'time'));
self::assertFalse($hooks->has_action('testAction', 'time'));

Expand Down Expand Up @@ -171,7 +174,9 @@ public function testRunHookFunctions()
self::assertSame(true, $hooks->add_action('testAction', array($mock, 'doSomeAction')));
self::assertSame(true, $hooks->add_filter('testFilter', array($mock, 'applySomeFilter')));

self::assertSame(2, $hooks->did_action('testAction'));
self::assertSame(true, $hooks->do_action('testAction'));
self::assertSame(3, $hooks->did_action('testAction'));
self::assertSame('foo', $hooks->apply_filters('testFilter', 'Foo'));

self::assertSame(true, $hooks->add_filter('all', array($mock, 'applySomeFilter')));
Expand Down

0 comments on commit 5b91c52

Please sign in to comment.