public function testCriteriaStringParameter()
 {
     $authorRepository = new AuthorRepository();
     $authorRepository->criteria(['WithPostsCriteria']);
     $this->assertTrue($authorRepository->hasCriteria());
     $this->assertTrue($authorRepository->count() == count($this->authors));
     $authors = $authorRepository->all();
     $this->assertTrue(isset($authors[0]['posts']));
 }
 public function testCriteriaAndScope()
 {
     $authorRepository = new AuthorRepository();
     $authorRepository->criteria([WithPostsCriteria::class])->scope(function ($query) {
         $query->where('id', '>', 1);
     });
     $authors = $authorRepository->all();
     $this->assertTrue(count($authors) == 2);
     $this->assertTrue(isset($authors[0]));
     $this->assertTrue(isset($authors[0]['posts']));
 }