Example #1
0
 /**
  * Validate the data is correct
  *
  * @param string[] $data
  * @throws InvalidFieldException
  */
 protected function validate($data)
 {
     foreach ($data as $code => $item) {
         if (!Column::isValidColumn($code)) {
             throw new InvalidFieldException("The data provided [{$code}] was not a valid field code.");
         }
     }
 }
Example #2
0
 public function testIsValidColumn()
 {
     $this->assertTrue(Column::isValidColumn("At"));
     $this->assertFalse(Column::isValidColumn("Invalid"));
 }