Exemplo n.º 1
0
 public function itShouldHydrateArrayFindMany()
 {
     $this->conn->return_vals = array(array('sample_id' => 123, 'name' => 'Bob', 'is_true' => false), array('sample_id' => 140, 'name' => 'Robert', 'is_true' => true));
     $results = SampleModel::findAll();
     $this->expect($results)->toHaveCount(2);
     $model = $results[0];
     $this->expect($model)->toBeInstanceOf('SampleModel');
     $this->expect($model->name)->toEqual('Bob');
     $this->expect($model->is_true)->toBe(false);
     $this->expect($model->sample_id)->toBe(123);
     $model = $results[1];
     $this->expect($model)->toBeInstanceOf('SampleModel');
     $this->expect($model->name)->toEqual('Robert');
     $this->expect($model->is_true)->toBe(true);
     $this->expect($model->sample_id)->toBe(140);
 }