If I'm right, SimpleTest will allow you to assert a PHP error. However, I cannot figure out how to use it, based on the documentation. I want to claim that the object I pass to my constructor is an instance of MyOtherObject
class Object { public function __construct(MyOtherObject $object) { //do something with $object } } //...and in my test I have... public function testConstruct_ExpectsAnInstanceOfMyOtherObject() { $notAnObject = 'foobar'; $object = new Object($notAnObject); $this->expectError($object); }
Where am I going wrong?
php unit-testing simpletest
Andrew
source share