public
Description: My mirror of phpspec
Homepage: http://www.phpspec.org/
Clone URL: git://github.com/tedkulp/phpspec.git
* Applying Predicate patch from Takagi Masahiro

git-svn-id: http://phpspec.googlecode.com/svn/trunk@186 
d6e91ea2-e33a-0410-98df-1d493bd67c58
padraic.brady (author)
Fri Jan 11 02:17:17 -0800 2008
commit  17a7b8b61d3df2f15afb499d9a6928006ff66af4
tree    bb3772ff3692b24bf996b753a391474f4f81bf3d
parent  34fb2884e0d75f581226998b41f898387779bbec
...
132
133
134
135
 
136
137
138
139
140
141
 
 
142
143
144
...
369
370
371
372
373
 
...
132
133
134
 
135
136
 
 
 
 
 
137
138
139
140
141
...
366
367
368
 
369
370
0
@@ -132,13 +132,10 @@ class PHPSpec_Specification
0
         }
0
 
0
         // check for any predicate style matching
0
- $result = preg_match("/^((be)|(have)|(beA)|(haveA)|(haveAn)|(beAn))*/", $method, $matches);
0
+ $result = preg_match("/^((?:be|have)A?n?)(.*)/", $method, $matches);
0
         if ($result && empty($args) && $this instanceof PHPSpec_Specification_Object) {
0
- $predicate = $matches[0];
0
- $predicateSuffix = substr($method, strlen($predicate));
0
- if (!isset($predicateSuffix) || empty($predicateSuffix)) {
0
- $predicateSuffix = '';
0
- }
0
+ $predicate = $matches[1];
0
+ $predicateSuffix = $matches[2];
0
 
0
             if (strpos($predicate, 'have') !== false) {
0
                 $predicateMethodPrefixes = array('has', 'hasA', 'hasAn');
0
@@ -369,4 +366,4 @@ class PHPSpec_Specification
0
         }
0
     }
0
 
0
-}
0
\ No newline at end of file
0
+}

Comments

    No one has commented yet.