public function test_can_find_category_with_criteria()
 {
     $this->createCategoryDescription();
     $criteria1 = new FindByDescription('Description');
     $criteria2 = new FindByName('Category B');
     $this->repository->addCriteria($criteria1)->addCriteria($criteria2);
     $result = $this->repository->find(5);
     $this->assertEquals($result->name, "Category B");
 }
コード例 #2
0
 /**
  * @expectedException \Illuminate\Database\Eloquent\ModelNotFoundException
  */
 public function test_can_find_category_fail()
 {
     $this->repository->find(10);
 }