/** * プロパティの入力チェックを行う * @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); }
/** * 表示件数の入力チェック * @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); }
/** * 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; } }
/** * Validate the given subject. * * @param mixed $subject * @return bool */ public function validate($subject) : bool { return !$this->validator->validate($subject); }
/** * @param mixed $value * @param array $args * @return bool */ public function validate($value, array $args = array()) { return $this->validator->validate($value, $args); }
/** * Forward the invocation to the validate method of the validator. * * @return bool */ public function __invoke(...$args) : bool { return $this->validator->validate(...$args); }
/** * Performs validation. * * @return bool */ public function validate() { return $this->validator->validate(); }