diff --git a/rector.php b/rector.php index 2d35b37ec..360b18552 100644 --- a/rector.php +++ b/rector.php @@ -27,6 +27,7 @@ return static function (RectorConfig $rectorConfig): void { LevelSetList::UP_TO_PHP_82, \Rector\Symfony\Set\SymfonyLevelSetList::UP_TO_SYMFONY_44, \Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY, + \Rector\PHPUnit\Set\PHPUnitLevelSetList::UP_TO_PHPUNIT_90, ]); // some routes are added twice if it remains activated diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php index bf183ebca..252bd88d2 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php @@ -192,7 +192,7 @@ final class ActivityControllerTest extends WebTestCase $crawler = $client->followRedirect(); - $this->assertNotContains('January 25, 2015', $crawler->text()); + $this->assertStringNotContainsString('January 25, 2015', $crawler->text()); } /** diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonCategoryControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonCategoryControllerTest.php index 88d6535d2..cea8482dc 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonCategoryControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonCategoryControllerTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class ActivityReasonCategoryControllerTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testToWrite(): never { $this->markTestSkipped(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonControllerTest.php index eafa7ed0b..338e92c87 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonControllerTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class ActivityReasonControllerTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testToWrite(): never { $this->markTestSkipped(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityTypeControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityTypeControllerTest.php index 49c0c6a08..911198b1e 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityTypeControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityTypeControllerTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class ActivityTypeControllerTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testToWrite(): never { $this->markTestSkipped(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php index 82750a751..1bfa2878c 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php @@ -34,6 +34,9 @@ final class TranslatableActivityReasonTest extends TypeTestCase parent::setUp(); } + /** + * @doesNotPerformAssertions + */ public function testSimple(): never { $translatableActivityReasonType = new PickActivityReasonType( diff --git a/src/Bundle/ChillActivityBundle/Tests/Timeline/TimelineProviderTest.php b/src/Bundle/ChillActivityBundle/Tests/Timeline/TimelineProviderTest.php index ff6f46567..989565262 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Timeline/TimelineProviderTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Timeline/TimelineProviderTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class TimelineProviderTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testAnActivityIsShownOnTimeline(): never { $this->markTestSkipped('we have to write fixtures before writing this tests'); diff --git a/src/Bundle/ChillBudgetBundle/Tests/Controller/ElementControllerTest.php b/src/Bundle/ChillBudgetBundle/Tests/Controller/ElementControllerTest.php index 925506a99..6cdafa2c3 100644 --- a/src/Bundle/ChillBudgetBundle/Tests/Controller/ElementControllerTest.php +++ b/src/Bundle/ChillBudgetBundle/Tests/Controller/ElementControllerTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class ElementControllerTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testIndex() { $client = self::createClient(); @@ -26,6 +29,9 @@ final class ElementControllerTest extends WebTestCase $crawler = $client->request('GET', '/index'); } + /** + * @doesNotPerformAssertions + */ public function testList() { $client = self::createClient(); diff --git a/src/Bundle/ChillDocStoreBundle/Tests/StoredObjectManagerTest.php b/src/Bundle/ChillDocStoreBundle/Tests/StoredObjectManagerTest.php index 354a301e8..4ab576f75 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/StoredObjectManagerTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/StoredObjectManagerTest.php @@ -169,9 +169,7 @@ final class StoredObjectManagerTest extends TestCase $response = new stdClass(); $response->url = $storedObject->getFilename(); - $tempUrlGenerator = $this - ->getMockBuilder(TempUrlGeneratorInterface::class) - ->getMock(); + $tempUrlGenerator = $this->createMock(TempUrlGeneratorInterface::class); $tempUrlGenerator ->method('generate') diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/EventControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/EventControllerTest.php index cece09a99..a7e316d5d 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/EventControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/EventControllerTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class EventControllerTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testSkipped(): never { $this->markTestSkipped(); diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/EventTypeControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/EventTypeControllerTest.php index 8e351066d..d5fec449c 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/EventTypeControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/EventTypeControllerTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class EventTypeControllerTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testSkipped(): never { $this->markTestSkipped(); diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/RoleControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/RoleControllerTest.php index 3839a1647..aaa7fad5a 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/RoleControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/RoleControllerTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class RoleControllerTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testSkipped(): never { $this->markTestSkipped(); diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/StatusControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/StatusControllerTest.php index e573edaab..7a35a0a3f 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/StatusControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/StatusControllerTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class StatusControllerTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testSkipped(): never { $this->markTestSkipped(); diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php index 6c908246b..342236a6c 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php @@ -348,7 +348,7 @@ abstract class AbstractExportTest extends WebTestCase $client->getResponse()->isSuccessful(), 'test that the response of /fr/exports/ is successful' ); - $this->assertContains( + $this->assertStringContainsString( $title, $crawler->text(), 'test that the page /fr/exports/ contains the title of the ' diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/PermissionsGroupControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/PermissionsGroupControllerTest.php index 1c2ffe4d3..adec9119e 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/PermissionsGroupControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/PermissionsGroupControllerTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class PermissionsGroupControllerTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testEmpty(): never { $this->markTestSkipped(); diff --git a/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php b/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php index aada1b929..c80571aea 100644 --- a/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php @@ -38,6 +38,9 @@ final class AbstractSearchTest extends \PHPUnit\Framework\TestCase $this->assertEquals('01', $date->format('d')); } + /** + * @doesNotPerformAssertions + */ public function testRecompose(): never { $this->markTestSkipped(); diff --git a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php index 98345a0b4..0dd689d6d 100644 --- a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php @@ -40,6 +40,9 @@ final class AccompanyingPeriodConfidentialTest extends WebTestCase ]); } + /** + * @doesNotPerformAssertions + */ public function testConfidentialInvalid() { $this->markTestSkipped("test not written fully"); diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php index b94a1d2f3..bd45d9048 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php @@ -250,7 +250,7 @@ final class ReportControllerTest extends WebTestCase $link, 'There is a "add a report" link in menu' ); - $this->assertContains( + $this->assertStringContainsString( sprintf( '/fr/person/%d/report/select/type/for/creation', self::$person->getId() diff --git a/src/Bundle/ChillReportBundle/Tests/DependencyInjection/ChillReportExtensionTest.php b/src/Bundle/ChillReportBundle/Tests/DependencyInjection/ChillReportExtensionTest.php index e480ca960..b8a4e6eb6 100644 --- a/src/Bundle/ChillReportBundle/Tests/DependencyInjection/ChillReportExtensionTest.php +++ b/src/Bundle/ChillReportBundle/Tests/DependencyInjection/ChillReportExtensionTest.php @@ -23,6 +23,9 @@ final class ChillReportExtensionTest extends KernelTestCase /* * Check if class Chill\ReportBundle\Entity\Report is in chill_custom_fields.customizables_entities */ + /** + * @doesNotPerformAssertions + */ public function testDeclareReportAsCustomizable() { self::bootKernel(['environment' => 'test']); diff --git a/src/Bundle/ChillReportBundle/Tests/Search/ReportSearchTest.php b/src/Bundle/ChillReportBundle/Tests/Search/ReportSearchTest.php index b87902ef7..ec47d1357 100644 --- a/src/Bundle/ChillReportBundle/Tests/Search/ReportSearchTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Search/ReportSearchTest.php @@ -96,9 +96,9 @@ final class ReportSearchTest extends WebTestCase $crawlerSocial = $clientSocial->request('GET', '/fr/search', $params); $crawlerAdministrative = $clientAdministrative->request('GET', '/fr/search', $params); - $this->assertNotContains('social', $crawlerAdministrative->filter('.content') + $this->assertStringNotContainsString('social', $crawlerAdministrative->filter('.content') ->text()); - $this->assertNotContains('administrative', $crawlerAdministrative->filter('.content') + $this->assertStringNotContainsString('administrative', $crawlerAdministrative->filter('.content') ->text()); } diff --git a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php index 22e8d9e38..6c4ac1d10 100644 --- a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php @@ -123,7 +123,7 @@ final class TimelineProviderTest extends WebTestCase $client->getResponse()->isSuccessful(), 'The page timeline is loaded successfully' ); - $this->assertContains( + $this->assertStringContainsString( 'a ajouté un rapport', $crawler->text(), 'the page contains the text "a publié un rapport"' diff --git a/src/Bundle/ChillThirdPartyBundle/Tests/Controller/ThirdPartyControllerTest.php b/src/Bundle/ChillThirdPartyBundle/Tests/Controller/ThirdPartyControllerTest.php index e62e0772e..ca4cc2783 100644 --- a/src/Bundle/ChillThirdPartyBundle/Tests/Controller/ThirdPartyControllerTest.php +++ b/src/Bundle/ChillThirdPartyBundle/Tests/Controller/ThirdPartyControllerTest.php @@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class ThirdPartyControllerTest extends WebTestCase { + /** + * @doesNotPerformAssertions + */ public function testIndex() { $client = self::createClient(); @@ -26,6 +29,9 @@ final class ThirdPartyControllerTest extends WebTestCase $crawler = $client->request('GET', '/index'); } + /** + * @doesNotPerformAssertions + */ public function testNew() { $client = self::createClient(); @@ -33,6 +39,9 @@ final class ThirdPartyControllerTest extends WebTestCase $crawler = $client->request('GET', '/new'); } + /** + * @doesNotPerformAssertions + */ public function testUpdate() { $client = self::createClient();