Skip to content

Commit b7caf16

Browse files
committed
Merge pull request #20 from SignpostMarv/phpunit-update
phpunit update
2 parents 961dada + 6f0a7f9 commit b7caf16

File tree

6 files changed

+437
-12
lines changed

6 files changed

+437
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor
22
composer.lock
3+
/phpunit/

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"require": {
77
},
88
"require-dev": {
9-
"phpunit/phpunit": "~3.7"
9+
"phpunit/phpunit": "^5.1"
10+
},
11+
"suggest": {
12+
"fabpot/php-cs-fixer": "PHP CS Fixer (testing for PSR-2 compliance)"
1013
},
1114
"minimum-stability": "stable",
1215
"autoload": {

phpunit.xml.dist

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,24 @@
2323
<directory>./src</directory>
2424
</whitelist>
2525
</filter>
26+
27+
28+
<logging>
29+
<log
30+
type="coverage-html"
31+
target="phpunit"
32+
logIncompleteSkipped="true"
33+
/>
34+
<log
35+
type="testdox-text"
36+
target="phpunit/testdox.txt"
37+
logIncompleteSkipped="true"
38+
/>
39+
<log
40+
type="coverage-text"
41+
target="php://stdout"
42+
showUncoveredFiles="true"
43+
showOnlySummary="false"
44+
/>
45+
</logging>
2646
</phpunit>

src/VerbalExpressions/PHPVerbalExpressions/VerbalExpressions.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ public function any($value)
286286
*/
287287
public function range()
288288
{
289-
290289
$arg_num = func_num_args();
291290

292291
if ($arg_num%2 != 0) {
@@ -394,13 +393,10 @@ public function multiple($value)
394393
{
395394
$value = self::sanitize($value);
396395

397-
switch (substr($value, -1)) {
398-
case '+':
399-
case '*':
400-
break;
401-
default:
402-
$value .= '+';
403-
break;
396+
$last = substr($value, -1);
397+
398+
if ($last !== '+' && $last !== '*') {
399+
$value .= '+';
404400
}
405401

406402
return $this->add($value);
@@ -538,7 +534,7 @@ public function limit($min, $max = 0)
538534
// check if the expression has * or + for the last expression
539535
if (preg_match('/\*|\+/', $this->lastAdded)) {
540536
$l = 1;
541-
$this->source = strrev(str_replace(array('+','*'), strrev($value), strrev($this->source), $l));
537+
$this->source = strrev(str_replace(array('+', '*'), strrev($value), strrev($this->source), $l));
542538

543539
return $this;
544540
}

0 commit comments

Comments
 (0)