public function validateNotEmpty($value, $errorMessage, $errorField = null) { if (empty($value)) { $this->error($errorMessage); $this->_errorFields[] = $errorField; } }
/** * @test */ public function notEmptyShouldNotReturnErrorForNotEmpty() { //given $object = new stdClass(); $validatable = new Validatable(); //when $validatable->validateNotEmpty($object, 'error1'); //then $this->assertEmpty($validatable->getErrors()); }