mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-13 12:33:52 +01:00
Add a failing test for EncapsedStringsToSprintfRector.
This commit is contained in:
parent
c378a449e4
commit
1cf50c6aaf
@ -19,6 +19,7 @@ final class EncapsedStringsToSprintfRectorTest extends AbstractRectorTestCase
|
||||
public function provideDataForTest(): Iterator
|
||||
{
|
||||
yield [__DIR__ . '/Fixture/fixture.php.inc'];
|
||||
yield [__DIR__ . '/Fixture/fixture2.php.inc'];
|
||||
yield [__DIR__ . '/Fixture/numberz.php.inc'];
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Encapsed\EncapsedStringsToSprintfRector\Fixture;
|
||||
|
||||
final class SomeClassProperty
|
||||
{
|
||||
private $format = 'json';
|
||||
|
||||
public function run(string $format)
|
||||
{
|
||||
return "Unsupported format {$this->format}";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Encapsed\EncapsedStringsToSprintfRector\Fixture;
|
||||
|
||||
final class SomeClassProperty
|
||||
{
|
||||
private $format = 'json';
|
||||
|
||||
public function run(string $format)
|
||||
{
|
||||
return sprintf('Unsupported format %s', $this->format);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user