Код: Выделить всё
class SomeService implements SomeInterface
{
public function __construct(private SomeRepository $repo)
{}
public function createSomething(array $data)
{
}
}
Код: Выделить всё
class SomeServiceTest {
protected function setUp()
{
$this->service = new SomeService;
}
// some tests using above service...
}
Я что-то упустил? Вы не хотите снова передавать репозиторий конструктору в тесте.
Я подхожу к этому неправильно?
Подробнее здесь: https://stackoverflow.com/questions/790 ... tiate-serv