title: How to make unit test for repository with laravel?
body: <p>Example: I have repository A inside <strong>__construct(repo B, repo C)</strong> and I want make unit test for function inside repo A but inside it has call <strong>b-&gt;func_b1 and C-&gt;func_c1</strong>, how to make? thank you so much!</p>
  <blockquote>
  <p>#Repo A</p>
  </blockquote>
  <pre><code> public function __construct(
      CandidateStepMasterInterface $stepMasterRepo,
      CandidateProcessInterface $processRepo,
      CandidateInterface $candidateRepo
  ) {
      parent::__construct();
      $this-&gt;stepMasterRepo = $stepMasterRepo;
      $this-&gt;processRepo    = $processRepo;
      $this-&gt;candidateRepo  = $candidateRepo;
  }
  </code></pre>
  <blockquote>
  <p>I make unit test for func here</p>
  </blockquote>
  <pre><code>    public function funcA($itemExample) {
      //code here
      $processes           = $this-&gt;stepMasterRepo-&gt;func_b1();
      $dataProcess         = $this-&gt;processRepo-&gt;func_c1($itemExample);
      $result = $this-&gt;candidateRepo-&gt;func_d1($itemExample);
      // code here
      return $result
  }
  </code></pre>
  <blockquote>
  <p>Unit test file</p>
  </blockquote>
  <pre><code>protected function setUp(): void
  {
      $this-&gt;stepMasterRepo = m::mock(CandidateStepMasterInterface::class)-&gt;makePartial();
      $this-&gt;processRepo = m::mock(CandidateProcessInterface::class)-&gt;makePartial();
      $this-&gt;candidateRepo = m::mock(CandidateInterface::class)-&gt;makePartial();
  
      $this-&gt;candidatePhaseMasterMock = m::mock(CandidatePhaseMasterRepository::class)-&gt;makePartial();
  
      $this-&gt;candidatePhaseMasterRepo = new CandidatePhaseMasterRepository(
          $this-&gt;stepMasterRepo,
          $this-&gt;processRepo,
          $this-&gt;candidateRepo,
      );
  
      parent::setUp(); // TODO: Change the autogenerated stub
  }
  public function test_funcA() {
      $dataExample = [];
      $result = $this-&gt;candidatePhaseMasterRepo-&gt;funcA(1);
      $this-&gt;assertEquals($dataExample, $result);
  }
  </code></pre>
  <blockquote>
  <p>Run unit test:::
  Mockery\Exception\BadMethodCallException: Received Mockery_0_App_Repositories_SaltCrm_Interfaces_CandidateStepMasterInterface::func_b1(), but no expectations were specified</p>
  </blockquote>