File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ protected function getMockedClient()
2020 {
2121 $ this ->mockGenerator ->orphanize ('__construct ' );
2222 $ this ->mockGenerator ->orphanize ('increment ' );
23+ $ this ->mockGenerator ->orphanize ('decrement ' );
2324 $ this ->mockGenerator ->orphanize ('timing ' );
2425 $ client = new \mock \M6Web \Bundle \StatsdBundle \Client \Client ();
2526 $ client ->clearToSend ();
@@ -51,6 +52,29 @@ public function testHandleEventWithValidConfigIncrement()
5152
5253 }
5354
55+ /**
56+ * testHandleEventWithValidConfig
57+ */
58+ public function testHandleEventWithValidConfigDecrement ()
59+ {
60+ $ client = $ this ->getMockedClient ();
61+
62+ $ event = new \Symfony \Component \EventDispatcher \Event ();
63+
64+ $ client ->addEventToListen ('test ' , array (
65+ 'decrement ' => 'stats.<name> '
66+ ));
67+
68+ $ this ->if ($ client ->handleEvent ($ event , 'test ' ))
69+ ->then
70+ ->mock ($ client )
71+ ->call ('decrement ' )
72+ ->withArguments ('stats.test ' )
73+ ->once ()
74+ ->call ('send ' )
75+ ->never ();
76+ }
77+
5478 /**
5579 * testHandleEventWithImmediateSend
5680 */
You can’t perform that action at this time.
0 commit comments