<?php
require_once 'Validator/String.php';
require_once 'Validator/EmailAddress.php';
$string = 'example text';
$stringValidator = new Validator_String($string);
echo 'Class Validator_String(\'example text\');<br>';
echo 'Validator_String->isValid() => ' .$stringValidator->isValid();
echo '<br>';
echo 'Validator_String->isValid(\'param in method\') : ' .$stringValidator->isValid('param in method');
echo '<br>';
echo 'Validator_String->isValid(3) : ' .$stringValidator->isValid(3);
echo '<br><br><br>';
$emailAddress = 'example@yourdomain.com';
$emailAddressValidator = new Validator_EmailAddress($emailAddress);
echo 'Class Validator_EmailAddress(\'example@yourdomain.com\');<br>';
echo 'Validator_EmailAddress->isValid() : ' .$emailAddressValidator->isValid();
echo '<br>';
echo 'Validator_EmailAddress->getDomain() : ' .$emailAddressValidator->getDomain();
echo '<br>';
echo 'Validator_EmailAddress->getUserAddress() : ' .$emailAddressValidator->getUserAddress();
echo '<br>';
$emailAddressValidator->set('wrongemail@fakedomain');
echo 'Validator_EmailAddress->set(\'wrongemail@fakedomain\')<br>';
echo 'Validator_EmailAddress->isValid() : ' .$emailAddressValidator->isValid();
?>
|