|
@@ -132,7 +132,7 @@ EOF;
|
|
$this->doTest($input);
|
|
$this->doTest($input);
|
|
}
|
|
}
|
|
|
|
|
|
- public function testLineBeforeDeclareIsNotBeRemoved(): void
|
|
|
|
|
|
+ public function testLineBeforeDeclareIsNotRemoved(): void
|
|
{
|
|
{
|
|
$expected = <<<'EOF'
|
|
$expected = <<<'EOF'
|
|
<?php
|
|
<?php
|
|
@@ -160,6 +160,57 @@ EOF;
|
|
$this->doTest($expected);
|
|
$this->doTest($expected);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @dataProvider provideLineBeforeIncludeOrRequireIsNotRemovedCases
|
|
|
|
+ */
|
|
|
|
+ public function testLineBeforeIncludeOrRequireIsNotRemoved(string $expected, ?string $input = null): void
|
|
|
|
+ {
|
|
|
|
+ $this->doTest($expected, $input);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static function provideLineBeforeIncludeOrRequireIsNotRemovedCases(): iterable
|
|
|
|
+ {
|
|
|
|
+ yield [<<<'EOF'
|
|
|
|
+<?php
|
|
|
|
+/**
|
|
|
|
+ * This describes what my script does.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+include 'vendor/autoload.php';
|
|
|
|
+EOF
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ yield [<<<'EOF'
|
|
|
|
+<?php
|
|
|
|
+/**
|
|
|
|
+ * This describes what my script does.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+include_once 'vendor/autoload.php';
|
|
|
|
+EOF
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ yield [<<<'EOF'
|
|
|
|
+<?php
|
|
|
|
+/**
|
|
|
|
+ * This describes what my script does.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+require 'vendor/autoload.php';
|
|
|
|
+EOF
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ yield [<<<'EOF'
|
|
|
|
+<?php
|
|
|
|
+/**
|
|
|
|
+ * This describes what my script does.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+require_once 'vendor/autoload.php';
|
|
|
|
+EOF
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+
|
|
public function testLineWithSpacesIsRemovedWhenNextTokenIsIndented(): void
|
|
public function testLineWithSpacesIsRemovedWhenNextTokenIsIndented(): void
|
|
{
|
|
{
|
|
$this->doTest(
|
|
$this->doTest(
|