File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -89,5 +89,20 @@ public function testFileDriverWithArrayArgument()
8989 $ p ->stop ();
9090 return $ this ->assertTrue (true );
9191 }
92+
93+ /**
94+ * @expectedException \Exception
95+ * @expectedExceptionMessage something exception
96+ */
97+ public function testLockedMethodThatThrowsException () {
98+ $ decorator = new Decorator (new TestService (), 'test_service ' );
99+ $ lock = new Lock ();
100+ $ lock ->setDriver (new Debug ())->setMethod ('doSomething ' );
101+ $ decorator ->addLock ($ lock );
102+
103+ $ decorator ->doSomething (function () {
104+ throw new \Exception ('something exception ' );
105+ });
106+ }
92107
93108}
Original file line number Diff line number Diff line change @@ -26,4 +26,9 @@ public function doNothing()
2626
2727 }
2828
29+ public function doSomething ($ something )
30+ {
31+ call_user_func ($ something );
32+ }
33+
2934}
You can’t perform that action at this time.
0 commit comments