Skip to content

Commit 4a2f276

Browse files
committed
applying php-cs-fixer to tests
1 parent 89f335b commit 4a2f276

File tree

2 files changed

+38
-24
lines changed

2 files changed

+38
-24
lines changed

tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ protected function buildUrlPatternAliased(VerbalExpressions $regex)
8080
}
8181

8282

83-
public function testTest(){
83+
public function testTest()
84+
{
8485
$regex = new VerbalExpressions();
8586
$regex->find('regex');
8687

@@ -284,7 +285,8 @@ public function testAnyOf()
284285
}
285286

286287

287-
public function testGetRegex(){
288+
public function testGetRegex()
289+
{
288290
$regex = new VerbalExpressions();
289291
$regex->startOfLine()
290292
->range(0, 9, 'a', 'z', 'A', 'Z')
@@ -299,7 +301,8 @@ public function testGetRegex(){
299301
/**
300302
* @depends testGetRegex
301303
*/
302-
public function testGetRegex_multiple(){
304+
public function testGetRegex_multiple()
305+
{
303306
$regex = new VerbalExpressions();
304307
$regex->startOfLine()
305308
->multiple('regex');
@@ -310,9 +313,10 @@ public function testGetRegex_multiple(){
310313
/**
311314
* @expectedException InvalidArgumentException
312315
*/
313-
public function testRange_throwsException(){
314-
$regex = new VerbalExpressions();
315-
$regex->range(1, 2, 3);
316+
public function testRange_throwsException()
317+
{
318+
$regex = new VerbalExpressions();
319+
$regex->range(1, 2, 3);
316320
}
317321

318322
/**
@@ -420,7 +424,8 @@ public function testRange_hexadecimal()
420424
/**
421425
* @depends testRange_hexadecimal
422426
*/
423-
public function testRange_md5(){
427+
public function testRange_md5()
428+
{
424429
$md5 = new VerbalExpressions();
425430
$md5->startOfLine()
426431
->range(0, 9, 'a', 'f')
@@ -438,7 +443,8 @@ public function testRange_md5(){
438443
/*
439444
* @depends testRange_hexadecimal
440445
*/
441-
public function testRange_sha1(){
446+
public function testRange_sha1()
447+
{
442448
$sha1 = new VerbalExpressions();
443449
$sha1->startOfLine()
444450
->range(0, 9, 'a', 'f')
@@ -456,7 +462,8 @@ public function testRange_sha1(){
456462
/**
457463
* @depends testGetRegex
458464
*/
459-
public function testRemoveModifier(){
465+
public function testRemoveModifier()
466+
{
460467
$regex = new VerbalExpressions();
461468
$regex->range('a', 'z');
462469

@@ -470,7 +477,8 @@ public function testRemoveModifier(){
470477
/**
471478
* @depends testRemoveModifier
472479
*/
473-
public function testWithAnyCase(){
480+
public function testWithAnyCase()
481+
{
474482
$regex = new VerbalExpressions();
475483
$regex->range('a', 'z')
476484
->searchOneLine(false)
@@ -486,7 +494,8 @@ public function testWithAnyCase(){
486494
/**
487495
* @depends testGetRegex
488496
*/
489-
public function testOr(){
497+
public function testOr()
498+
{
490499
$regex = new VerbalExpressions();
491500
$regex->find('foo')
492501
->_or('bar');
@@ -503,7 +512,8 @@ public function testOr(){
503512
* @depends testGetRegex
504513
* @todo fix VerbalExpressions::clean() so it matches initial state
505514
*/
506-
public function testClean(){
515+
public function testClean()
516+
{
507517
$regex = new VerbalExpressions();
508518
$regex->removeModifier('m')
509519
->stopAtFirst()
@@ -524,7 +534,8 @@ public function testClean(){
524534
/**
525535
* @depends testGetRegex
526536
*/
527-
public function testLimit(){
537+
public function testLimit()
538+
{
528539
$regex = new VerbalExpressions();
529540

530541
$regex->add('a')
@@ -549,7 +560,8 @@ public function testLimit(){
549560
/**
550561
* @depends testGetRegex
551562
*/
552-
public function testReplace(){
563+
public function testReplace()
564+
{
553565
$regex = new VerbalExpressions();
554566
$regex->add('foo');
555567

@@ -563,38 +575,39 @@ public function testReplace(){
563575
}
564576

565577

566-
public function testPsr2(){
578+
public function testPsr2()
579+
{
567580
$pathToRoot = dirname(dirname(dirname(__DIR__)));
568581
$pathToVendor = $pathToRoot . '/vendor';
569582
$pathToSrc = $pathToRoot . '/src';
570583
$pathToTests = $pathToRoot . '/tests';
571584

572-
if(
585+
if (
573586
!is_dir($pathToVendor)
574-
){
587+
) {
575588
$this->markTestSkipped('Vendor directory not found.');
576589
return;
577-
}else if(
590+
} elseif (
578591
!is_dir($pathToSrc)
579-
){
592+
) {
580593
$this->markTestSkipped('Source directory not found.');
581594
return;
582-
}else if(
595+
} elseif (
583596
!is_dir($pathToTests)
584-
){
597+
) {
585598
$this->markTestSkipped('Tests directory not found.');
586599
return;
587600
}
588601

589-
foreach(array(
602+
foreach (array(
590603
$pathToTests,
591604
$pathToSrc,
592-
) as $dirToCheck){
605+
) as $dirToCheck) {
593606
$cmd = escapeshellcmd(
594607
'php-cs-fixer fix --level=psr2 --dry-run ' . $dirToCheck
595608
);
596609
exec($cmd, $output, $return_var);
597-
if($output){
610+
if ($output) {
598611
array_pop($output);
599612
$output = array_map('trim', $output);
600613
}

tests/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
$loader = require dirname(__DIR__) . '/vendor/autoload.php';
44
//$loader->add('PHPVerbalExpressions\Tests', __DIR__);
5+

0 commit comments

Comments
 (0)