12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- declare(strict_types=1);
- namespace PhpCsFixer\Tests;
- use PhpCsFixer\Tests\Test\AbstractIntegrationTestCase;
- use PhpCsFixer\Tests\Test\IntegrationCase;
- use PhpCsFixer\Tests\Test\IntegrationCaseFactoryInterface;
- use PhpCsFixer\Tests\Test\InternalIntegrationCaseFactory;
- final class IntegrationTest extends AbstractIntegrationTestCase
- {
- protected static function getFixturesDir(): string
- {
- return __DIR__.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.'Integration';
- }
- protected static function getTempFile(): string
- {
- return sys_get_temp_dir().\DIRECTORY_SEPARATOR.'MyClass.php';
- }
- protected static function createIntegrationCaseFactory(): IntegrationCaseFactoryInterface
- {
- return new InternalIntegrationCaseFactory();
- }
- protected static function assertRevertedOrderFixing(IntegrationCase $case, string $fixedInputCode, string $fixedInputCodeWithReversedFixers): void
- {
- parent::assertRevertedOrderFixing($case, $fixedInputCode, $fixedInputCodeWithReversedFixers);
- $settings = $case->getSettings();
- if (!isset($settings['isExplicitPriorityCheck'])) {
- self::markTestIncomplete('Missing `isExplicitPriorityCheck` extension setting.');
- }
- if ($settings['isExplicitPriorityCheck']) {
- self::assertNotSame(
- $fixedInputCode,
- $fixedInputCodeWithReversedFixers,
- \sprintf(
- 'Test "%s" in "%s" is expected to be priority check, but fixers applied in reversed order made the same changes.',
- $case->getTitle(),
- $case->getFileName(),
- )
- );
- }
- }
- }
|