Exemple #1
0
 public function testArrayInput()
 {
     $uniqueValue1 = uniqid();
     $uniqueValue2 = uniqid();
     $model1 = new FakeModel();
     $model1->unique = $uniqueValue1;
     $model1->save();
     $model2 = new FakeModel();
     $model2->unique = $uniqueValue2;
     $model2->save();
     $values = array('unique' => array(0 => $uniqueValue1, 1 => $uniqueValue2));
     $messages = $this->validation->validate($values);
     $this->assertEquals(1, count($messages));
     $model2->delete();
     $messages = $this->validation->validate($values);
     $this->assertEquals(1, count($messages));
     $model1->delete();
     $messages = $this->validation->validate($values);
     $this->assertEquals(0, count($messages));
 }
Exemple #2
0
 private function createObjectCollection()
 {
     for ($i = 0; $i < 20; $i++) {
         $fakeModel = new FakeModel();
         $fakeModel->fake_field = uniqid();
         $fakeModel->test_name = 'PaginationTest';
         $fakeModel->save();
     }
 }