Exemplo n.º 1
0
 function testValidateEnum()
 {
     $this->out($this->_header(__FUNCTION__));
     //$this->App->data = array($this->App->alias=>array('y'=>'efg'));
     $testModel = new TestModel();
     $is = $testModel->validateEnum(array('x' => '1'), true);
     $this->assertTrue($is);
     $is = $testModel->validateEnum(array('x' => '4'), true);
     $this->assertFalse($is);
     $is = $testModel->validateEnum(array('x' => '5'), true, array('4', '5'));
     $this->assertTrue($is);
     $is = $testModel->validateEnum(array('some_key' => '3'), 'x', array('4', '5'));
     $this->assertTrue($is);
 }