Permalink
Browse files

Updating documentation of `\util\Set::check()` to clarify key format.

  • Loading branch information...
nateabele committed Jan 9, 2012
1 parent fcb2e62 commit 2319f7bbcfd2584adc44cb6da06cacec24dc6877
Showing with 9 additions and 5 deletions.
  1. +6 −4 tests/cases/util/SetTest.php
  2. +3 −1 util/Set.php
@@ -1110,10 +1110,12 @@ public function testRemove() {
}
public function testCheck() {
- $set = array(
- 'My Index 1' => array('First' => 'The first item')
- );
- $this->assertTrue(Set::check($set, 'My Index 1.First'));
+ $set = array('My Index 1' => array(
+ 'First' => 'The first item'
+ ));
+ $result = Set::check($set, 'My Index 1.First');
+ $this->assertTrue($result);
+
$this->assertTrue(Set::check($set, 'My Index 1'));
$this->assertTrue(Set::check($set, array()));
View
@@ -51,7 +51,9 @@ public static function append(array $array, array $array2) {
}
/**
- * Checks if a particular path is set in an array.
+ * Checks if a particular path is set in an array. Tests by key name, or dot-delimited key name, i.e.:
+ *
+ * {{{ embed:lithium\tests\cases\util\SetTest::testCheck(1-4) }}}
*
* @param mixed $data Data to check on.
* @param mixed $path A dot-delimited string.

0 comments on commit 2319f7b

Please sign in to comment.