12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- declare(strict_types=1);
- /*
- * This file is part of PHP CS Fixer.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- * Dariusz Rumiński <dariusz.ruminski@gmail.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
- namespace PhpCsFixer\Tests\FixerDefinition;
- use PhpCsFixer\FixerDefinition\CodeSampleInterface;
- use PhpCsFixer\FixerDefinition\FixerDefinition;
- use PhpCsFixer\Tests\TestCase;
- /**
- * @internal
- *
- * @covers \PhpCsFixer\FixerDefinition\FixerDefinition
- */
- final class FixerDefinitionTest extends TestCase
- {
- public function testGetSummary(): void
- {
- $definition = new FixerDefinition('Foo', [], 'Bar');
- self::assertSame('Foo', $definition->getSummary());
- }
- public function testGetCodeSamples(): void
- {
- $samples = [
- $this->prophesize(CodeSampleInterface::class)->reveal(),
- $this->prophesize(CodeSampleInterface::class)->reveal(),
- ];
- $definition = new FixerDefinition('', $samples, '');
- self::assertSame($samples, $definition->getCodeSamples());
- }
- public function testGetDescription(): void
- {
- $definition = new FixerDefinition('', [], 'Foo');
- self::assertSame('Foo', $definition->getDescription());
- }
- public function testGetRiskyDescription(): void
- {
- $definition = new FixerDefinition('', [], 'Foo');
- self::assertNull($definition->getRiskyDescription());
- $definition = new FixerDefinition('', [], 'Foo', 'Bar');
- self::assertSame('Bar', $definition->getRiskyDescription());
- }
- }
|