I am getting stuck at a test where I want to Unit test my UserRepository for my application.
I have a class:
<?php
class EloquentUserRepository implements UserRepository {}
?>
And I want to inject that into my Unit test here:
<?php
use Converse\User\UserRepository as User;
class UserRepositoryTest extends TestCase
{
protected $user;
public function __construct(User $user)
{
$this->user = $user;
}
}
?>
I am getting this exception:
Catchable fatal error: Argument 1 passed to UserRepositoryTest::__construct() must be an instance of Converse\User\UserRepository, none given, called
in C:\Zend\Apache2\htdocs\pear\PHPUnit\Framework\TestSuite.php on line 473 and defined in C:\Zend\Apache2\htdocs\workspace\projects\converse\src\app\t
ests\Users\UserRepositoryTest.php on line 17
I can't seem to figure out why this repository is not available for injection for my unit test? Please assist?