Skip to content
Permalink
Browse files

Moving failing test into new method for non-zero array extraction.

  • Loading branch information...
markstory committed Mar 25, 2010
1 parent e8e520d commit cbb65ca85f514df59486b4ac02517d78b9c7e5a5
Showing with 13 additions and 14 deletions.
  1. +13 −14 cake/tests/cases/libs/set.test.php
@@ -973,20 +973,6 @@ function testExtract() {
$result = Set::extract('/ParentNode/name', $hasMany);
$expected = array('Second');
$this->assertEqual($result, $expected);
$startingAtOne = array(
'Article' => array(
1=> array(
'id' => 1,
'approved' => 1,
),
)
);
$expected = array(0 => array('Article' => array('id' => 1, 'approved' => 1)));
$result = Set::extract('/Article[approved=1]', $startingAtOne);
$this->assertEqual($result, $expected);
}
/**
* test that extract() still works when arrays don't contain a 0 index.
@@ -1049,6 +1035,19 @@ function testExtractWithNonZeroArrays() {
$result = Set::extract('/User/id', $nonZero);
$this->assertEqual($result, $expected, 'Failed non zero array key extract');
$startingAtOne = array(
'Article' => array(
1=> array(
'id' => 1,
'approved' => 1,
),
)
);
$expected = array(0 => array('Article' => array('id' => 1, 'approved' => 1)));
$result = Set::extract('/Article[approved=1]', $startingAtOne);
$this->assertEqual($result, $expected);
}
/**
* testExtractWithArrays method

0 comments on commit cbb65ca

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