Skip to content
Permalink
Browse files

Adding fail tests to Xml::toArray().

  • Loading branch information...
jrbasso committed Aug 23, 2010
1 parent 84cf5d5 commit 52b09188f78702dba07d31c432779bb982e947e5
Showing with 22 additions and 0 deletions.
  1. +22 −0 cake/tests/cases/libs/xml.test.php
@@ -406,4 +406,26 @@ function testToArray() {
$this->assertEqual(Xml::toArray($obj), $expected);
}
/**
* data provider for toArray() failures
*
* @return array
*/
public static function invalidToArrayDataProvider() {
return array(
array(new DateTime()),
array(array())
);
}
/**
* testToArrayFail method
*
* @dataProvider invalidToArrayDataProvider
* @expectedException Exception
*/
function testToArrayFail($value) {
Xml::toArray($value);
}
}

0 comments on commit 52b0918

Please sign in to comment.
You can’t perform that action at this time.