mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Implementing Validation::equalTo() (Ticket #3594)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6187 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
5dd9847881
commit
e6af521843
2 changed files with 10 additions and 1 deletions
|
@ -471,7 +471,7 @@ class Validation extends Object {
|
|||
* @todo Implement
|
||||
*/
|
||||
function equalTo($check, $comparedTo) {
|
||||
|
||||
return ($check === $comparedTo);
|
||||
}
|
||||
/**
|
||||
* Check that value is a file.
|
||||
|
|
|
@ -1170,6 +1170,15 @@ class ValidationTestCase extends UnitTestCase {
|
|||
$this->assertFalse($this->Validation->email('abc.efg@com.caphpkeinvalid', null, '/^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i'));
|
||||
}
|
||||
|
||||
function testEqualTo() {
|
||||
$this->assertTrue($this->Validation->equalTo("1", "1"));
|
||||
$this->assertFalse($this->Validation->equalTo(1, "1"));
|
||||
$this->assertFalse($this->Validation->equalTo("", null));
|
||||
$this->assertFalse($this->Validation->equalTo("", false));
|
||||
$this->assertFalse($this->Validation->equalTo(0, false));
|
||||
$this->assertFalse($this->Validation->equalTo(null, false));
|
||||
}
|
||||
|
||||
function testIp() {
|
||||
$this->assertTrue($this->Validation->ip('0.0.0.0'));
|
||||
$this->assertTrue($this->Validation->ip('192.168.1.156'));
|
||||
|
|
Loading…
Add table
Reference in a new issue