Skip to content

EncapsedStringsToSprintfRector fails when using class properties#2128

Merged
TomasVotruba merged 1 commit intorectorphp:masterfrom
gnutix:EncapsedStringsToSprintfRector/add-test
Oct 10, 2019
Merged

EncapsedStringsToSprintfRector fails when using class properties#2128
TomasVotruba merged 1 commit intorectorphp:masterfrom
gnutix:EncapsedStringsToSprintfRector/add-test

Conversation

@gnutix
Copy link
Copy Markdown
Contributor

@gnutix gnutix commented Oct 9, 2019

vendor/bin/phpunit packages/CodingStyle/tests/Rector/Encapsed/EncapsedStringsToSprintfRector/EncapsedStringsToSprintfRectorTest.php
PHPUnit 7.5.0 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.3.9-1+ubuntu18.04.1+deb.sury.org+1
Configuration: /home/gnutix/dev/oss/rectorphp/rector/phpunit.xml

.F.                                                                 3 / 3 (100%)

Time: 1.49 seconds, Memory: 56.50MB

There was 1 failure:

1) Rector\CodingStyle\Tests\Rector\Encapsed\EncapsedStringsToSprintfRector\EncapsedStringsToSprintfRectorTest::test with data set #1 ('/home/gnutix/dev/oss/rectorph...hp.inc')
Caused by /home/gnutix/dev/oss/rectorphp/rector/packages/CodingStyle/tests/Rector/Encapsed/EncapsedStringsToSprintfRector/Fixture/fixture2.php.inc
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 
     public function run(string $format)
     {
-        return sprintf('Unsupported format %s', $this->format);
+        return sprintf('Unsupported format ');
     }
 }

/home/gnutix/dev/oss/rectorphp/rector/src/Testing/PHPUnit/AbstractRectorTestCase.php:182
/home/gnutix/dev/oss/rectorphp/rector/src/Testing/PHPUnit/AbstractRectorTestCase.php:136
/home/gnutix/dev/oss/rectorphp/rector/packages/CodingStyle/tests/Rector/Encapsed/EncapsedStringsToSprintfRector/EncapsedStringsToSprintfRectorTest.php:16

@gnutix gnutix changed the title Add a failing test for EncapsedStringsToSprintfRector. EncapsedStringsToSprintfRector fails when using class properties Oct 9, 2019
@TomasVotruba
Copy link
Copy Markdown
Member

TomasVotruba commented Oct 9, 2019

Could fix that too in this PR?

@gnutix
Copy link
Copy Markdown
Contributor Author

gnutix commented Oct 9, 2019

Not my priority this week (see my latest email ;( ) unfortunately...

@TomasVotruba
Copy link
Copy Markdown
Member

Ok

@TomasVotruba TomasVotruba merged commit cdc8696 into rectorphp:master Oct 10, 2019
@TomasVotruba TomasVotruba deleted the EncapsedStringsToSprintfRector/add-test branch October 10, 2019 14:18
@TomasVotruba
Copy link
Copy Markdown
Member

I'll look at it

TomasVotruba added a commit that referenced this pull request Apr 22, 2022
rectorphp/rector-src@cd3f45d [TypeDeclaration][Strict] Skip different type assigned different method on TypedPropertyFromStrictConstructorRector (#2128)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants