How to unit test the methods of a class whose constructor take some arguments?
问题 I have a class of form something like this: class A{ public function __constructor(classB b , classC c){ // } public function getSum(var1, var2){ return var1+var2; } } My test case class is something like this: use A; class ATest extends PHPUnit_Framework_TestCase{ public function testGetSum{ $a = new A(); $this->assertEquals(3, $a->getSum(1,2)); } } However when I run the phpunit, it throws some error like: Missing argument 1 for \..\::__construct(), called in /../A.php on line 5 Even if I