From fc8611b003904f7820285ebbe09a897d9380619d Mon Sep 17 00:00:00 2001 From: the_undefined Date: Wed, 16 Apr 2008 19:40:01 +0000 Subject: [PATCH] Added support for regex modifiers git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6668 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/set.php | 2 +- cake/tests/cases/libs/set.test.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index f63138451..de5b6fccf 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -404,7 +404,7 @@ class Set extends Object { $contexts = array($data); } - $tokens = array_slice(preg_split('/(?assertEqual($r, $expected); - + $this->assertEqual($r, $expected); + + $expected = array(4); + $r = Set::extract('/User[name=/N/]/id', $tricky); + $this->assertEqual($r, $expected); + + $expected = array(1, 3, 4); + $r = Set::extract('/User[name=/N/i]/id', $tricky); + $this->assertEqual($r, $expected); + $common = array( array( 'Article' => array(