cvs: pear-core(PEAR_1_4) /tests/PEAR_Validate test_validate_date.phpt

From: Date: Mon, 17 Jul 2006 21:56:22 +0000
Subject: cvs: pear-core(PEAR_1_4) /tests/PEAR_Validate test_validate_date.phpt
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-4875@lists.php.net to get a copy of this message
pajoye Mon Jul 17 21:56:22 2006 UTC Modified files: (Branch: PEAR_1_4) /pear-core/tests/PEAR_Validate test_validate_date.phpt Log: - use really invalid dates http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_Validate/test_validate_date.phpt?r1=1.4&r2=1.4.2.1&diff_format=u Index: pear-core/tests/PEAR_Validate/test_validate_date.phpt diff -u pear-core/tests/PEAR_Validate/test_validate_date.phpt:1.4 pear-core/tests/PEAR_Validate/test_validate_date.phpt:1.4.2.1 --- pear-core/tests/PEAR_Validate/test_validate_date.phpt:1.4 Fri Feb 3 03:56:12 2006 +++ pear-core/tests/PEAR_Validate/test_validate_date.phpt Mon Jul 17 21:56:22 2006 @@ -313,6 +313,7 @@ </release> </changelog> </package>', 'package2.xml'); + $phpunit->assertNoErrors('parse'); $pf->validate(PEAR_VALIDATE_NORMAL); $phpunit->assertNoErrors('validate'); @@ -323,35 +324,35 @@ $phpunit->assertNoErrors('$val->validate'); $phpunit->assertTrue($res, '$val->validate'); -$pf->setDate('200-04-01'); +$pf->setDate('200-04-14'); $res = $val->validate(PEAR_VALIDATE_NORMAL); -$phpunit->assertFalse($res, '200-04-01'); +$phpunit->assertFalse($res, '200-04-14'); $phpunit->showall(); $phpunit->assertEquals(array ( - 'warnings' => + 'warnings' => array ( ), - 'errors' => + 'errors' => array ( - 0 => + 0 => array ( 'field' => 'date', - 'reason' => 'invalid release date "200-04-01"', + 'reason' => 'invalid release date "200-04-14"', ), ), -), $val->getFailures(), 'failures 200-04-01'); +), $val->getFailures(), 'failures 200-04-14'); $pf->setDate('2004_04-01'); $res = $val->validate(PEAR_VALIDATE_NORMAL); $phpunit->assertFalse($res, '2004_04-01'); $phpunit->showall(); $phpunit->assertEquals(array ( - 'warnings' => + 'warnings' => array ( ), - 'errors' => + 'errors' => array ( - 0 => + 0 => array ( 'field' => 'date', 'reason' => 'invalid release date "2004_04-01"', @@ -364,12 +365,12 @@ $phpunit->assertFalse($res, '2004-04-0'); $phpunit->showall(); $phpunit->assertEquals(array ( - 'warnings' => + 'warnings' => array ( ), - 'errors' => + 'errors' => array ( - 0 => + 0 => array ( 'field' => 'date', 'reason' => 'invalid release date "2004-04-0"', @@ -383,12 +384,12 @@ $phpunit->assertFalse($res, 'way future-04-05'); $phpunit->showall(); $phpunit->assertEquals(array ( - 'warnings' => + 'warnings' => array ( ), - 'errors' => + 'errors' => array ( - 0 => + 0 => array ( 'field' => 'date', 'reason' => 'invalid release date "' . str_repeat('141341', 5000) . '-04-05"', @@ -401,10 +402,10 @@ $phpunit->assertTrue($res, '2004-04-05'); $phpunit->showall(); $phpunit->assertEquals(array ( - 'warnings' => + 'warnings' => array ( ), - 'errors' => + 'errors' => array ( ), ), $val->getFailures(), 'failures 2004-04-05'); @@ -415,4 +416,4 @@ require_once dirname(__FILE__) . '/teardown.php.inc'; ?> --EXPECT-- -tests done \ No newline at end of file +tests done

« previous php.pear.core (#4875) next »