Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix incomplete test.

  • Loading branch information...
commit afa0329330f7eb8884024cd30daf6cf6b50bd37f 1 parent ae66682
@markstory markstory authored
Showing with 13 additions and 8 deletions.
  1. +13 −8 lib/Cake/Test/Case/Utility/Set2Test.php
View
21 lib/Cake/Test/Case/Utility/Set2Test.php
@@ -1346,18 +1346,23 @@ public function testFormat() {
* @return void
*/
public function testFormatNullValues() {
- $this->markTestIncomplete('Not done yet');
-
$data = array(
- array('Person' => array('first_name' => 'Nate', 'last_name' => 'Abele', 'city' => 'Boston', 'state' => 'MA', 'something' => '42')),
- array('Person' => array('first_name' => 'Larry', 'last_name' => 'Masters', 'city' => 'Boondock', 'state' => 'TN', 'something' => null)),
- array('Person' => array('first_name' => 'Garrett', 'last_name' => 'Woodworth', 'city' => 'Venice Beach', 'state' => 'CA', 'something' => null)));
-
- $result = Set2::format($data, '%s', array('{n}.Person.something'));
+ array('Person' => array(
+ 'first_name' => 'Nate', 'last_name' => 'Abele', 'city' => 'Boston', 'state' => 'MA', 'something' => '42'
+ )),
+ array('Person' => array(
+ 'first_name' => 'Larry', 'last_name' => 'Masters', 'city' => 'Boondock', 'state' => 'TN', 'something' => null
+ )),
+ array('Person' => array(
+ 'first_name' => 'Garrett', 'last_name' => 'Woodworth', 'city' => 'Venice Beach', 'state' => 'CA', 'something' => null
+ ))
+ );
+
+ $result = Set2::format($data, array('{n}.Person.something'), '%s');
$expected = array('42', '', '');
$this->assertEquals($expected, $result);
- $result = Set2::format($data, '{0}, {1}', array('{n}.Person.city', '{n}.Person.something'));
+ $result = Set2::format($data, array('{n}.Person.city', '{n}.Person.something'), '%s, %s');
$expected = array('Boston, 42', 'Boondock, ', 'Venice Beach, ');
$this->assertEquals($expected, $result);
}
Please sign in to comment.
Something went wrong with that request. Please try again.