Browse files

Bad test

- Test was ensuring that if a factory exists for a class, then the
  abstract factory will not be queried.
- Unfortunately, the way the test was written, an engine-level fatal
  error was raised due to a missing constructor argument, which in turn
  does not raise the ServiceNotCreatedException.
- Altered the constructor to raise an exception if the expected type is
  not provided.
  • Loading branch information...
1 parent 45d98b4 commit 9df6c79a5ed0e18f4ddfb2644e4b9132b00f7bd4 @weierophinney weierophinney committed Oct 10, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 tests/ZendTest/ServiceManager/TestAsset/Bar.php
View
5 tests/ZendTest/ServiceManager/TestAsset/Bar.php
@@ -12,7 +12,10 @@
class Bar
{
- public function __construct(array $foo)
+ public function __construct(array $foo = null)
{
+ if (null === $foo) {
+ throw new \RuntimeException();
+ }
}
}

0 comments on commit 9df6c79

Please sign in to comment.