(make:unit-test) Generate test class from file path

by @yceruto

Some issues have been detected in this pull request

Issues that can be fixed by applying a patch

Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:

$ curl https://fabbot.io/patch/symfony/maker-bundle/89/20e17a3553c2e53a8088e89b6d90fcf2408369ca/cs.diff | patch -p0
diff -ru src/Maker/MakeUnitTest.php src/Maker/MakeUnitTest.php
--- src/Maker/MakeUnitTest.php	2017-12-13 05:56:00.735202766 +0000
+++ src/Maker/MakeUnitTest.php	2017-12-13 05:56:01.729180235 +0000
@@ -59,26 +59,26 @@
         $testClassName = Str::asClassName($testClassName, 'Test');
         Validator::validateClassName($testClassName);
 
-        return [
+        return array(
             'test_class_name' => $testClassName,
             'test_namespace' => $testNamespace,
             'test_path' => $testPath,
-        ];
+        );
     }
 
     public function getFiles(array $params): array
     {
-        return [
+        return array(
             __DIR__.'/../Resources/skeleton/test/Unit.tpl.php' => $params['test_path'].$params['test_class_name'].'.php',
-        ];
+        );
     }
 
     public function writeNextStepsMessage(array $params, ConsoleStyle $io)
     {
-        $io->text([
+        $io->text(array(
             'Next: Open your new test class and start customizing it.',
             'Find the documentation at <fg=yellow>https://symfony.com/doc/current/testing.html#unit-tests</>',
-        ]);
+        ));
     }
 
     public function configureDependencies(DependencyBuilder $dependencies)
@@ -100,6 +100,6 @@
             }
         }
 
-        return [$testPath, $testNamespace, $testClassName];
+        return array($testPath, $testNamespace, $testClassName);
     }
 }
diff -ru src/Resources/skeleton/test/Unit.tpl.php src/Resources/skeleton/test/Unit.tpl.php
--- src/Resources/skeleton/test/Unit.tpl.php	2017-12-13 05:56:01.038195898 +0000
+++ src/Resources/skeleton/test/Unit.tpl.php	2017-12-13 05:56:01.732180167 +0000
@@ -1,10 +1,10 @@
-<?= "<?php\n" ?>
+<?= "<?php\n"; ?>
 
-namespace <?= $test_namespace ?>;
+namespace <?= $test_namespace; ?>;
 
 use PHPUnit\Framework\TestCase;
 
-class <?= $test_class_name ?> extends TestCase
+class <?= $test_class_name; ?> extends TestCase
 {
     public function testSomething()
     {

0
Common Typos

0
File Permissions