DX: apply rector rules for phpunit up to 90

This commit is contained in:
Julien Fastré 2023-08-31 11:08:42 +02:00
parent e4e52234ad
commit b85cd1b994
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
22 changed files with 62 additions and 9 deletions

View File

@ -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

View File

@ -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());
}
/**

View File

@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class ActivityReasonCategoryControllerTest extends WebTestCase
{
/**
* @doesNotPerformAssertions
*/
public function testToWrite(): never
{
$this->markTestSkipped();

View File

@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class ActivityReasonControllerTest extends WebTestCase
{
/**
* @doesNotPerformAssertions
*/
public function testToWrite(): never
{
$this->markTestSkipped();

View File

@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class ActivityTypeControllerTest extends WebTestCase
{
/**
* @doesNotPerformAssertions
*/
public function testToWrite(): never
{
$this->markTestSkipped();

View File

@ -34,6 +34,9 @@ final class TranslatableActivityReasonTest extends TypeTestCase
parent::setUp();
}
/**
* @doesNotPerformAssertions
*/
public function testSimple(): never
{
$translatableActivityReasonType = new PickActivityReasonType(

View File

@ -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');

View File

@ -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();

View File

@ -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')

View File

@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class EventControllerTest extends WebTestCase
{
/**
* @doesNotPerformAssertions
*/
public function testSkipped(): never
{
$this->markTestSkipped();

View File

@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class EventTypeControllerTest extends WebTestCase
{
/**
* @doesNotPerformAssertions
*/
public function testSkipped(): never
{
$this->markTestSkipped();

View File

@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class RoleControllerTest extends WebTestCase
{
/**
* @doesNotPerformAssertions
*/
public function testSkipped(): never
{
$this->markTestSkipped();

View File

@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class StatusControllerTest extends WebTestCase
{
/**
* @doesNotPerformAssertions
*/
public function testSkipped(): never
{
$this->markTestSkipped();

View File

@ -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 '

View File

@ -19,6 +19,9 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class PermissionsGroupControllerTest extends WebTestCase
{
/**
* @doesNotPerformAssertions
*/
public function testEmpty(): never
{
$this->markTestSkipped();

View File

@ -38,6 +38,9 @@ final class AbstractSearchTest extends \PHPUnit\Framework\TestCase
$this->assertEquals('01', $date->format('d'));
}
/**
* @doesNotPerformAssertions
*/
public function testRecompose(): never
{
$this->markTestSkipped();

View File

@ -40,6 +40,9 @@ final class AccompanyingPeriodConfidentialTest extends WebTestCase
]);
}
/**
* @doesNotPerformAssertions
*/
public function testConfidentialInvalid()
{
$this->markTestSkipped("test not written fully");

View File

@ -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()

View File

@ -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']);

View File

@ -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());
}

View File

@ -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"'

View File

@ -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();