コード例 #1
0
 /**
  * @covers \Ixudra\Portfolio\Repositories\Eloquent\EloquentCustomerRepository::search()
  */
 public function testSearch_usesPagination()
 {
     $customer1 = Customer::create(array('first_name' => 'Foo_first_name'));
     $customer2 = Customer::create(array('first_name' => 'Bar_first_name'));
     $customer3 = Customer::create(array('first_name' => 'Bar_first_name'));
     $customer4 = Customer::create(array('first_name' => 'Foo_first_name'));
     $customer5 = Customer::create(array('first_name' => 'Foz_first_name'));
     $filters = array();
     $paginator = $this->customerRepository->search($filters, 2, true);
     $customers = $paginator->getCollection();
     $this->assertCount(2, $customers);
     $this->assertCollectionWithOnlyInstancesOf('\\Ixudra\\Portfolio\\Models\\Customer', $customers);
 }