/** * 表示件数の入力チェック * @test * @dataProvider displayCountValidateDataProvider */ public function invalidDisplayCountCase($expected, $data, $msg) { $dto = new DnsUserCriteriaDto(); EntitySupport::autoSet($dto, $data); $errors = $this->validator->validate($dto); $this->assertEquals($expected, count($errors), $msg); }
/** * プロパティの入力チェックを行う * @test * @dataProvider dataProvider */ public function validateProperty($expected, $data, $msg) { $dto = new DnsUserExportDto(); EntitySupport::autoSet($dto, $data); $errors = $this->validator->validate($dto); $this->assertEquals($expected, count($errors), $msg); }
/** * @param mixed $value * @return \hergot\databroker\DataAdapter\Parameter * @throws \InvalidArgumentException */ public function setValue($value) { if ($this->validator instanceof ValidatorInterface && !$this->validator->isValid($value)) { throw new \InvalidArgumentException('Setting value for parameter "' . $this->getName() . '" failed. Validator: "' . get_class($this->validator) . '"'); } $this->value = $value; return $this; }
/** * Deletes asset by ID * * @param string $id ID of the asset * @return response * @throws \Exception */ public function deleteAsset($id) { $params = array('id' => $id); $params = $this->validator->validate($params); try { return $this->client->sendRequest('assets/{id}', $params, 'DELETE'); } catch (\Exception $ex) { throw $ex; } }
/** * @param ValidatorInterface $validator */ public function add(ValidatorInterface $validator) { $this->validators[$validator->name()] = $validator; }
/** * Validate the given subject. * * @param mixed $subject * @return bool */ public function validate($subject) : bool { return !$this->validator->validate($subject); }
/** * @return mixed */ public function getValidationErrors() { return $this->validation->errors(); }
/** * @return array */ public function getParams() { return $this->validator->getParams(); }
/** * Forward the invocation to the validate method of the validator. * * @return bool */ public function __invoke(...$args) : bool { return $this->validator->validate(...$args); }
/** * @expectedException Chippyash\SDO\Exceptions\SDOException * @expectedExceptionMessage No mapper set */ public function testFetchWillThrowExceptionIfMapperNotSet() { $this->validator->expects($this->once())->method('isValid')->will($this->returnValue(true)); $sut = $this->getMockForAbstractClass('Chippyash\\SDO\\AbstractSDO', array($this->transport, null, $this->validator)); $sut->fetch(); }
/** * execute a validator * @param mixed $value * @param \oat\oatbox\validator\ValidatorInterface $validator * @return boolena */ protected function executeTest($value, ValidatorInterface $validator) { return $validator->evaluate($value); }
/** * Performs validation. * * @return bool */ public function validate() { return $this->validator->validate(); }