Permalink
Browse files

implemented more tests

  • Loading branch information...
Matthimatiker committed Apr 5, 2012
1 parent bb4dc24 commit e475cb80a55ada933e4c1b256f112ac99c4106e4
Showing with 20 additions and 1 deletion.
  1. +20 −1 tests/library/AspectPHP/Transformation/Template/JoinPointHandlerTest.php
@@ -347,7 +347,14 @@ public function testHandlerReturnsReturnValueModifiedByAfterReturningAdvice()
*/
public function testHandlerDoesNotExecuteAfterThrowingAdviceIfNoExceptionOccurred()
{
-
+ $this->simulateManager($this->createManagerMock());
+
+ $adviceCallback = $this->createCallbackMock();
+ $adviceCallback->expects($this->never())
+ ->method(self::CALLBACK_METHOD);
+ $this->advices->afterThrowing()->add($this->toAdvice($adviceCallback));
+
+ $this->handle($this->createCallbackMock());
}
/**
@@ -356,7 +363,19 @@ public function testHandlerDoesNotExecuteAfterThrowingAdviceIfNoExceptionOccurre
*/
public function testHandlerExecutesAfterThrowingAdviceIfExceptionOccurred()
{
+ $this->simulateManager($this->createManagerMock());
+
+ $adviceCallback = $this->createCallbackMock();
+ $adviceCallback->expects($this->once())
+ ->method(self::CALLBACK_METHOD);
+ $this->advices->afterThrowing()->add($this->toAdvice($adviceCallback));
+ $mock = $this->createCallbackMock();
+ $mock->expects($this->any())
+ ->method(self::CALLBACK_METHOD)
+ ->will($this->throwException(new RuntimeException('Test exception.')));
+
+ $this->handle($mock);
}
/**

0 comments on commit e475cb8

Please sign in to comment.