rdlowrey/Auryn — pull request #34 by Danack (2013-11-30 04:05:08+00:00)
Title: More code coverage

Most of this is just adding test cases. There are two changes that are not:

1) Removing the "catch ReflectionException" - I'm pretty sure that that exception can't be thrown from the functions inside the try block, unless something goes really wrong with `strtolower`. It wasn't reached in the test cases.

2) The place where [CyclicDependencyException was being thrown](https://github.com/rdlowrey/Auryn/blob/master/src/Auryn/Provider.php#L121) had a missing parameter. This made the test where CyclicDependencyException was caught and re-thrown be the wrong way around.

The code before [tried to only throw a new CyclicDependencyException](https://github.com/rdlowrey/Auryn/blob/master/src/Auryn/Provider.php#L164) when it was necessary. However for the cyclic dependencies where there are multiple steps in the cycle, it turns out the exception always has to be throw.

With this PR the tests pass, but there may be an backwards compatibility issue if people were depending on the exact chain of exceptions. @morrisonlevi might want to cast an eye over this, just in case I've missed some subtlely in the code.

cheers
Dan