1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace PhpCsFixer\Tests\Fixer;
- use PhpCsFixer\Tests\Fixtures\Test\AbstractFixerTest\UnconfigurableFixer;
- use PhpCsFixer\WhitespacesFixerConfig;
- use PHPUnit\Framework\TestCase;
- final class AbstractFixerTest extends TestCase
- {
- public function testConfigureUnconfigurable()
- {
- $fixer = new UnconfigurableFixer();
- $this->expectException(\LogicException::class, 'Cannot configure using Abstract parent, child not implementing "PhpCsFixer\Fixer\ConfigurationDefinitionFixerInterface".');
- $fixer->configure(['foo' => 'bar']);
- }
- public function testGetConfigurationDefinitionUnconfigurable()
- {
- $fixer = new UnconfigurableFixer();
- $this->expectException(\LogicException::class, 'Cannot get configuration definition using Abstract parent, child not implementing "PhpCsFixer\Fixer\ConfigurationDefinitionFixerInterface".');
- $fixer->getConfigurationDefinition();
- }
- public function testCreateConfigurationDefinitionUnconfigurable()
- {
- $fixer = new UnconfigurableFixer();
- $this->expectException(\LogicException::class, 'Cannot create configuration definition using Abstract parent, child not implementing "PhpCsFixer\Fixer\ConfigurationDefinitionFixerInterface".');
- $fixer->doSomethingWithCreateConfigDefinition();
- }
- public function testSetWhitespacesConfigUnconfigurable()
- {
- $fixer = new UnconfigurableFixer();
- $this->expectException('LogicException');
- $this->expectExceptionMessage('Cannot run method for class not implementing "PhpCsFixer\Fixer\WhitespacesAwareFixerInterface".');
- $fixer->setWhitespacesConfig(new WhitespacesFixerConfig());
- }
- }
|