Permalink
Browse files

Adding a test case for nested array data and clean().

  • Loading branch information...
1 parent f6c7be9 commit fbb54e6a45b05c10ce3acaf325d4533df1a2549e @markstory markstory committed Jul 22, 2010
Showing with 23 additions and 0 deletions.
  1. +23 −0 cake/tests/cases/libs/sanitize.test.php
@@ -193,6 +193,29 @@ function testClean() {
$expected = '';
$result = Sanitize::clean($string);
$this->assertEqual($string, $expected);
+
+ $data = array(
+ 'Grant' => array(
+ 'title' => '2 o clock grant',
+ 'grant_peer_review_id' => 3,
+ 'institution_id' => 5,
+ 'created_by' => 1,
+ 'modified_by' => 1,
+ 'created' => '2010-07-15 14:11:00',
+ 'modified' => '2010-07-19 10:45:41'
+ ),
+ 'GrantsMember' => array(
+ 0 => array(
+ 'id' => 68,
+ 'grant_id' => 120,
+ 'member_id' => 16,
+ 'program_id' => 29,
+ 'pi_percent_commitment' => 1
+ )
+ )
+ );
+ $result = Sanitize::clean($data);
+ $this->assertEqual($result, $data);
}
/**

0 comments on commit fbb54e6

Please sign in to comment.