diff --git a/composer.json b/composer.json index 8422101..34334fb 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ } ], "require": { - "pmvc/pmvc": "*" + "pmvc/pmvc": "*", + "pmvc-plugin/annotation": "*" }, "minimum-stability": "dev" } diff --git a/src/_throw.php b/src/_throw.php new file mode 100644 index 0000000..532c9b6 --- /dev/null +++ b/src/_throw.php @@ -0,0 +1,33 @@ +get($caller); + $expectedException = get($doc, 'expectedException'); + $expectedExceptionMessage = get($doc, 'expectedExceptionMessage'); + if (!empty($expectedException)) { + $phpunit->expectException($expectedException); + } + if (!empty($expectedExceptionMessage)) { + $phpunit->expectExceptionMessage($expectedExceptionMessage); + } + if (!$error) { + $willThrow(); + } else { + try { + $willThrow(); + } catch (Exception $e) { + throw new PMVCUnitException($e->getMessage(), 0); + } + } + } +}