- var_dump: documentation ( source)
<?php
class A {}
class B extends A {}
class Test {
public function run(A $object){
return true;
}
}
$test = new Test;
$b = new B;
var_dump($test->run($b));
// My in my spec Test is a dependency
// $test->run($b)->shouldBeCalled();
// Error I get is "Argument 1 passed to run() should be instance of A, instance of B given" (paraphrased)