public function testGetErrorsShouldReturnListOfErrors() { $invalidStatement = $this->createInvalidStatement(); $validator = new IntegrityValidator($invalidStatement); $this->assertFalse($validator->validate()); $expected = ['ID' => ['Constraint do not exist in columns list'], 'invalidColumnsQuantityExpected' => ['Columns Quantity Expected: 3 Columns Quantity Found: 1']]; $result = $validator->getErrors(); $this->assertEquals($expected, $result, 'Expected: ' . print_r($expected, true) . 'Result: ' . print_r($result, true)); }
public function isValid() { $validator = new IntegrityValidator($this); return $validator->validate(); }