Skip to content

Commit

Permalink
[testing] change provideConfigFileInfo() to provideConfigFilePath() (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba authored Feb 12, 2021
1 parent fb1bf1f commit afdf583
Show file tree
Hide file tree
Showing 155 changed files with 318 additions and 316 deletions.
4 changes: 2 additions & 2 deletions packages/caching/tests/Detector/ChangedFilesDetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public function provideData(): Iterator
];
}

protected function provideConfigFileInfo(): SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config.php');
return __DIR__ . '/config.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ final class __Name__Test extends AbstractRectorTestCase
yield [new \Symplify\SmartFileSystem\SmartFileInfo(__DIR__ . '/Fixture/some_class.php.inc'), '__ExtraFileName__', __DIR__ . '/Source/extra_file.php'];
}

protected function provideConfigFileInfo(): ?\Symplify\SmartFileSystem\SmartFileInfo
protected function provideConfigFilePath(): string
{
return new \Symplify\SmartFileSystem\SmartFileInfo(__DIR__ . '/configured_rule.php');
return __DIR__ . '/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ final class __Name__Test extends AbstractRectorTestCase
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?\Symplify\SmartFileSystem\SmartFileInfo
protected function provideConfigFilePath(): string
{
return new \Symplify\SmartFileSystem\SmartFileInfo(__DIR__ . '/configured_rule.php');
return __DIR__ . '/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ final class WhateverRectorTest extends AbstractRectorTestCase
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?\Symplify\SmartFileSystem\SmartFileInfo
protected function provideConfigFilePath(): string
{
return new \Symplify\SmartFileSystem\SmartFileInfo(__DIR__ . '/configured_rule.php');
return __DIR__ . '/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ final class WhateverRectorTest extends AbstractRectorTestCase
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?\Symplify\SmartFileSystem\SmartFileInfo
protected function provideConfigFilePath(): string
{
return new \Symplify\SmartFileSystem\SmartFileInfo(__DIR__ . '/configured_rule.php');
return __DIR__ . '/configured_rule.php';
}
}
9 changes: 5 additions & 4 deletions packages/testing/src/PHPUnit/AbstractRectorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ protected function setUp(): void
{
$this->initializeDependencies();

if ($this->provideConfigFileInfo() !== null) {
$configFileInfos = self::$rectorConfigsResolver->resolveFromConfigFileInfo($this->provideConfigFileInfo());
if ($this->provideConfigFilePath() !== '') {
$configFileInfo = new SmartFileInfo($this->provideConfigFilePath());
$configFileInfos = self::$rectorConfigsResolver->resolveFromConfigFileInfo($configFileInfo);

$this->bootKernelWithConfigsAndStaticCache(RectorKernel::class, $configFileInfos);

Expand Down Expand Up @@ -143,10 +144,10 @@ protected function getRectorClass(): string
return '';
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
// can be implemented
return null;
return '';
}

protected function yieldFilesFromDirectory(string $directory, string $suffix = '*.php.inc'): Iterator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ public function provideData(): Iterator
yield [new SmartFileInfo(__DIR__ . '/Source/Contract/Foo/KeepThisSomeInterface.php'), null];
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/some_config.php');
return __DIR__ . '/config/some_config.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public function provideData(): Iterator
];
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public function provideData(): Iterator
yield [new SmartFileInfo(__DIR__ . '/Source/Utils/SomeSuffixedTest.php.inc'), null];
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function provideData(): iterable
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/pre_union_types.php');
return __DIR__ . '/config/pre_union_types.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureForPhp72');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/php_72.php');
return __DIR__ . '/config/php_72.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureAutoImport');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/auto_import.php');
return __DIR__ . '/config/auto_import.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureDocBlock');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/import_doc_block_config.php');
return __DIR__ . '/config/import_doc_block_config.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public function provideDataGeneric(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureGeneric');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/import_config.php');
return __DIR__ . '/config/import_config.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public function provideData(): iterable
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureRoot');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/not_import_short_classes.php');
return __DIR__ . '/config/not_import_short_classes.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureNonNamespaced');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/import_config.php');
return __DIR__ . '/config/import_config.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureAttributes');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/import_config.php');
return __DIR__ . '/config/import_config.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureOpenSource');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/project_open_source.php');
return __DIR__ . '/config/project_open_source.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixturePhp80');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/property_promotion.php');
return __DIR__ . '/config/property_promotion.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureOpenSource');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/project_open_source.php');
return __DIR__ . '/config/project_open_source.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureOpenSource');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/projet_open_source.php');
return __DIR__ . '/config/projet_open_source.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureTypedProperties');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/typed_properties.php');
return __DIR__ . '/config/typed_properties.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/nette_config.php');
return __DIR__ . '/config/nette_config.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureSymfony');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/symfony_config.php');
return __DIR__ . '/config/symfony_config.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public function provideData(): Iterator
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function provideConfigFileInfo(): ?SmartFileInfo
protected function provideConfigFilePath(): string
{
return new SmartFileInfo(__DIR__ . '/config/configured_rule.php');
return __DIR__ . '/config/configured_rule.php';
}
}
Loading

0 comments on commit afdf583

Please sign in to comment.