Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions docs/AllRectorsOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4507,15 +4507,15 @@ services:
{
- public function test()
+ /**
+ * @dataProvider provideDataForTest()
+ * @dataProvider provideData()
+ */
+ public function test(int $number)
{
- $this->doTestMultiple([1, 2, 3]);
+ $this->doTestSingle($number);
+ }
+
+ public function provideDataForTest(): \Iterator
+ public function provideData(): \Iterator
+ {
+ yield [1];
+ yield [2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class ConstructorInjectionToActionInjectionRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
final class MoveEntitiesToEntityDirectoryRectorTest extends AbstractFileSystemRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $originalFile, string $expectedFileLocation, string $expectedFileContent): void
{
Expand All @@ -21,7 +21,7 @@ public function test(string $originalFile, string $expectedFileLocation, string
$this->assertFileEquals($expectedFileContent, $expectedFileLocation);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
yield [
__DIR__ . '/Source/Controller/RandomEntity.php',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
final class MoveInterfacesToContractNamespaceDirectoryRectorTest extends AbstractFileSystemRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $originalFile, string $expectedFileLocation, string $expectedFileContent): void
{
Expand All @@ -21,7 +21,7 @@ public function test(string $originalFile, string $expectedFileLocation, string
$this->assertFileEquals($expectedFileContent, $expectedFileLocation);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
yield [
__DIR__ . '/Source/Entity/RandomInterface.php',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
final class MoveServicesBySuffixToDirectoryRectorTest extends AbstractFileSystemRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $originalFile, string $expectedFileLocation, string $expectedFileContent): void
{
Expand All @@ -21,7 +21,7 @@ public function test(string $originalFile, string $expectedFileLocation, string
$this->assertFileEquals($expectedFileContent, $expectedFileLocation);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
yield [
__DIR__ . '/Source/Entity/AppleRepository.php',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
final class DoctrineTest extends AbstractPhpDocInfoPrinterTest
{
/**
* @dataProvider provideDataForTestClass()
* @dataProvider provideDataClass()
*/
public function testClass(string $docFilePath, Node $node): void
{
Expand All @@ -29,7 +29,7 @@ public function testClass(string $docFilePath, Node $node): void
);
}

public function provideDataForTestClass(): Iterator
public function provideDataClass(): Iterator
{
yield [__DIR__ . '/Source/Doctrine/index_in_table.txt', new Class_(IndexInTable::class)];
yield [__DIR__ . '/Source/Doctrine/case_sensitive.txt', new Class_(CaseSensitive::class)];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
final class ModalToGetSetRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
final class RenameMethodCallBasedOnParameterRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
Expand All @@ -21,7 +21,7 @@ public function test(string $file): void
/**
* @return string[]
*/
public function provideDataForTest(): iterable
public function provideData(): iterable
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class ChangeSnakedFixtureNameToCamelTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class ImplicitShortClassNameUseStatementRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class AppUsesStaticCallToUseStatementRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class CakePHPControllerActionToSymfonyControllerActionRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class CakePHPControllerRedirectToSymfonyRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class CakePHPControllerRenderToSymfonyRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace Rector\CakePHPToSymfony\Tests\Rector\Class_\CakePHPBeforeFilterToRequestEventSubscriberRector;

use Iterator;
use Rector\CakePHPToSymfony\Rector\Class_\CakePHPBeforeFilterToRequestEventSubscriberRector;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;

final class CakePHPBeforeFilterToRequestEventSubscriberRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
{
return CakePHPBeforeFilterToRequestEventSubscriberRector::class;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Rector\CakePHPToSymfony\Tests\Rector\Class_\CakePHPBeforeFilterToRequestEventSubscriberRector\Source;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;

class SuperadminControllerEventSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
KernelEvents::REQUEST => 'onKernelRequest',
];
}

public function onKernelRequest()
{
// something
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class CakePHPControllerComponentToSymfonyRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class CakePHPControllerHelperToSymfonyRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class CakePHPControllerToSymfonyControllerRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class CakePHPImplicitRouteToExplicitRouteAnnotationRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
final class CakePHPModelToDoctrineEntityRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideDataForTest()
* @dataProvider provideData()
*/
public function test(string $file): void
{
$this->doTestFile($file);
}

public function provideDataForTest(): Iterator
public function provideData(): Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}
Expand Down
Loading