/** * testFormatColumns method * * @access public * @return void */ function testFormatColumns() { $this->loadFixtures('DataTest', 'Article'); $this->DataTest =& new SanitizeDataTest(array('alias' => 'DataTest')); $data = array('DataTest' => array('id' => 'z', 'count' => '12a', 'float' => '2.31456', 'updated' => '2008-01-01')); $this->DataTest->set($data); $expected = array('DataTest' => array('id' => '0', 'count' => '12', 'float' => 2.31456, 'updated' => '2008-01-01 00:00:00')); Sanitize::formatColumns($this->DataTest); $result = $this->DataTest->data; $this->assertEqual($result, $expected); $this->Article =& new SanitizeArticle(array('alias' => 'Article')); $data = array('Article' => array('id' => 'ZB', 'user_id' => '12', 'title' => 'title of article', 'body' => 'body text', 'published' => 'QQQQQQQ')); $this->Article->set($data); $expected = array('Article' => array('id' => '0', 'user_id' => '12', 'title' => 'title of article', 'body' => 'body text', 'published' => 'QQQQQQQ')); Sanitize::formatColumns($this->Article); $result = $this->Article->data; $this->assertEqual($result, $expected); }