Skip to content

Commit

Permalink
Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Apr 25, 2016
1 parent dc22e5c commit fb4f62e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/TestCase/Validation/ValidationTest.php
Expand Up @@ -30,6 +30,16 @@
class ValidationTest extends TestCase
{

/**
* @var string
*/
protected $locale;

/**
* @var string
*/
protected $_appEncoding;

/**
* setUp method
*
Expand Down Expand Up @@ -60,7 +70,7 @@ public function tearDown()
*
* @return void
*/
public function testNotEmpty()
public function testNotBlank()
{
$this->assertTrue(Validation::notBlank('abcdefg'));
$this->assertTrue(Validation::notBlank('fasdf '));
Expand All @@ -69,6 +79,8 @@ public function testNotEmpty()
$this->assertTrue(Validation::notBlank('José'));
$this->assertTrue(Validation::notBlank('é'));
$this->assertTrue(Validation::notBlank('π'));
$this->assertTrue(Validation::notBlank('0'));
$this->assertTrue(Validation::notBlank(0));
$this->assertFalse(Validation::notBlank("\t "));
$this->assertFalse(Validation::notBlank(""));
}
Expand All @@ -78,7 +90,7 @@ public function testNotEmpty()
*
* @return void
*/
public function testNotEmptyISO88591AppEncoding()
public function testNotBlankIso88591AppEncoding()
{
Configure::write('App.encoding', 'ISO-8859-1');
$this->assertTrue(Validation::notBlank('abcdefg'));
Expand Down Expand Up @@ -1862,7 +1874,7 @@ public function testEmail()
*/
public function testEmailDeep()
{
$this->skipIf(gethostbynamel('example.abcd'), 'Your DNS service responds for non-existant domains, skipping deep email checks.');
$this->skipIf((bool)gethostbynamel('example.abcd'), 'Your DNS service responds for non-existant domains, skipping deep email checks.');

$this->assertTrue(Validation::email('abc.efg@cakephp.org', true));
$this->assertFalse(Validation::email('abc.efg@caphpkeinvalid.com', true));
Expand Down

0 comments on commit fb4f62e

Please sign in to comment.