inklabs / kommerce-core

PHP shopping cart core platform
https://kommerce-laravel-demo.jamieisaacs.com/
Apache License 2.0
65 stars 14 forks source link

Remove @expectedException annotations in tests #23

Closed pdt256 closed 8 years ago

pdt256 commented 8 years ago

Should explicitly define the expected exception in code.

Example:

        $this->setExpectedException(
            EntityNotFoundException::class,
            'User not found'
        );

This makes refactoring easier and places the exception at the exact location it should be thrown. With annotations, a premature EntityNotFoundException could trigger the test to pass.