Skip to content

Instantly share code, notes, and snippets.

@icambridge
Created February 29, 2012 18:48
Show Gist options
  • Save icambridge/1943472 to your computer and use it in GitHub Desktop.
Save icambridge/1943472 to your computer and use it in GitHub Desktop.
Validation unit test
<?php
namespace app\tests\cases\extensions;
use lithium\util\Validator;
class ValidatorTest extends \lithium\test\Unit {
public function testValidationRule() {
$result = Validator::rule('match', 'match', 'any', array('other_field' => 'field', 'values' => array('field' => 'match')));
$this->assertTrue($result);
$result = Validator::rule('match', 'match2', 'any', array('other_field' => 'field', 'values' => array('field' => 'match')));
$this->assertFalse($result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment