Ejemplo n.º 1
0
 /**
  * Sets PHPUnit_Fixture's field property.
  *
  * @access  public
  * @param   Array 	$fields	The Fields we want to set for our fixture.
  * @return  bool			True if set, false otherwise.
  * 
  */
 public function setFields(array $fields)
 {
     if (0 === count($fields)) {
         throw new ErrorException('Illegal field format.');
     }
     foreach ($fields as $name => $data) {
         if (!is_string($name)) {
             throw new ErrorException('Field name must be a string.');
         }
         if (!is_array($data)) {
             throw new ErrorException('Data must be in an associative array.');
         }
         DataTypeChecker::validateDataTypeFields($data);
     }
     $this->_fields = $fields;
     return true;
 }