Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 202d0b8

Browse files
committed
Merge branch '2.3'
2 parents dd0f467 + 026565a commit 202d0b8

9 files changed

Lines changed: 503 additions & 9 deletions

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"symfony/finder": "^3.0",
2727
"symfony/options-resolver": "^3.0",
2828
"symfony/polyfill-php70": "^1.0",
29-
"symfony/polyfill-xml": "^1.3",
29+
"symfony/polyfill-php72": "^1.4",
3030
"symfony/process": "^3.0",
3131
"symfony/stopwatch": "^3.0"
3232
},
@@ -41,7 +41,6 @@
4141
},
4242
"suggest": {
4343
"ext-mbstring": "For handling non-UTF8 characters in cache signature.",
44-
"ext-xml": "For better performance.",
4544
"symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible."
4645
},
4746
"conflict": {

tests/AutoReview/ProjectCodeTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,12 @@ final class ProjectCodeTest extends TestCase
3535
* @var string[]
3636
*/
3737
private static $classesWithoutTests = [
38-
\PhpCsFixer\ConfigurationException\InvalidConfigurationException::class,
39-
\PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException::class,
40-
\PhpCsFixer\ConfigurationException\RequiredFixerConfigurationException::class,
41-
\PhpCsFixer\Console\Command\DescribeNameNotFoundException::class,
4238
\PhpCsFixer\Console\Command\SelfUpdateCommand::class,
4339
\PhpCsFixer\Console\Output\NullOutput::class,
4440
\PhpCsFixer\Differ\DiffConsoleFormatter::class,
4541
\PhpCsFixer\Differ\NullDiffer::class,
4642
\PhpCsFixer\Differ\SebastianBergmannDiffer::class,
4743
\PhpCsFixer\Differ\SebastianBergmannShortDiffer::class,
48-
\PhpCsFixer\Doctrine\Annotation\Token::class,
4944
\PhpCsFixer\Doctrine\Annotation\Tokens::class,
5045
\PhpCsFixer\FileRemoval::class,
5146
\PhpCsFixer\FixerConfiguration\FixerOptionValidatorGenerator::class,
@@ -55,10 +50,8 @@ final class ProjectCodeTest extends TestCase
5550
\PhpCsFixer\Fixer\Operator\AlignEqualsFixerHelper::class,
5651
\PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer::class,
5752
\PhpCsFixer\Indicator\PhpUnitIndicator::class,
58-
\PhpCsFixer\Linter\LintingException::class,
5953
\PhpCsFixer\Linter\ProcessLintingResult::class,
6054
\PhpCsFixer\Linter\TokenizerLintingResult::class,
61-
\PhpCsFixer\Linter\UnavailableLinterException::class,
6255
\PhpCsFixer\Report\ReportSummary::class,
6356
\PhpCsFixer\Runner\FileCachingLintingIterator::class,
6457
\PhpCsFixer\Runner\FileFilterIterator::class,
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
/*
4+
* This file is part of PHP CS Fixer.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
* Dariusz Rumiński <[email protected]>
8+
*
9+
* This source file is subject to the MIT license that is bundled
10+
* with this source code in the file LICENSE.
11+
*/
12+
13+
namespace PhpCsFixer\Tests\ConfigurationException;
14+
15+
use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException;
16+
use PhpCsFixer\Console\Command\FixCommand;
17+
use PHPUnit\Framework\TestCase;
18+
19+
/**
20+
* @author Andreas Möller <[email protected]>
21+
*
22+
* @internal
23+
*
24+
* @covers \PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException
25+
*/
26+
final class InvalidConfigurationExceptionTest extends TestCase
27+
{
28+
public function testIsInvalidConfigurationException()
29+
{
30+
$exception = new InvalidFixerConfigurationException(
31+
'hal',
32+
'I cannot do that, Dave.'
33+
);
34+
35+
$this->assertInstanceOf('PhpCsFixer\ConfigurationException\InvalidConfigurationException', $exception);
36+
}
37+
38+
public function testDefaults()
39+
{
40+
$fixerName = 'hal';
41+
$message = 'I cannot do that, Dave.';
42+
43+
$exception = new InvalidFixerConfigurationException(
44+
$fixerName,
45+
$message
46+
);
47+
48+
$this->assertSame(sprintf('[%s] %s', $fixerName, $message), $exception->getMessage());
49+
$this->assertSame(FixCommand::EXIT_STATUS_FLAG_HAS_INVALID_FIXER_CONFIG, $exception->getCode());
50+
$this->assertNull($exception->getPrevious());
51+
}
52+
53+
public function testConstructorSetsValues()
54+
{
55+
$fixerName = 'hal';
56+
$message = 'I cannot do that, Dave.';
57+
$previous = new \RuntimeException();
58+
59+
$exception = new InvalidFixerConfigurationException(
60+
$fixerName,
61+
$message,
62+
$previous
63+
);
64+
65+
$this->assertSame(sprintf('[%s] %s', $fixerName, $message), $exception->getMessage());
66+
$this->assertSame(FixCommand::EXIT_STATUS_FLAG_HAS_INVALID_FIXER_CONFIG, $exception->getCode());
67+
$this->assertSame($previous, $exception->getPrevious());
68+
}
69+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
/*
4+
* This file is part of PHP CS Fixer.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
* Dariusz Rumiński <[email protected]>
8+
*
9+
* This source file is subject to the MIT license that is bundled
10+
* with this source code in the file LICENSE.
11+
*/
12+
13+
namespace PhpCsFixer\Tests\ConfigurationException;
14+
15+
use PhpCsFixer\ConfigurationException\InvalidConfigurationException;
16+
use PhpCsFixer\Console\Command\FixCommand;
17+
use PHPUnit\Framework\TestCase;
18+
19+
/**
20+
* @author Andreas Möller <[email protected]>
21+
*
22+
* @internal
23+
*
24+
* @covers \PhpCsFixer\ConfigurationException\InvalidConfigurationException
25+
*/
26+
final class InvalidFixerConfigurationExceptionTest extends TestCase
27+
{
28+
public function testIsInvalidArgumentException()
29+
{
30+
$exception = new InvalidConfigurationException('I cannot do that, Dave.');
31+
32+
$this->assertInstanceOf('InvalidArgumentException', $exception);
33+
}
34+
35+
public function testDefaults()
36+
{
37+
$message = 'I cannot do that, Dave.';
38+
39+
$exception = new InvalidConfigurationException($message);
40+
41+
$this->assertSame($message, $exception->getMessage());
42+
$this->assertSame(FixCommand::EXIT_STATUS_FLAG_HAS_INVALID_CONFIG, $exception->getCode());
43+
$this->assertNull($exception->getPrevious());
44+
}
45+
46+
public function testConstructorSetsValues()
47+
{
48+
$message = 'I cannot do that, Dave.';
49+
$code = 9000;
50+
$previous = new \RuntimeException();
51+
52+
$exception = new InvalidConfigurationException(
53+
$message,
54+
$code,
55+
$previous
56+
);
57+
58+
$this->assertSame($message, $exception->getMessage());
59+
$this->assertSame($code, $exception->getCode());
60+
$this->assertSame($previous, $exception->getPrevious());
61+
}
62+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
/*
4+
* This file is part of PHP CS Fixer.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
* Dariusz Rumiński <[email protected]>
8+
*
9+
* This source file is subject to the MIT license that is bundled
10+
* with this source code in the file LICENSE.
11+
*/
12+
13+
namespace PhpCsFixer\Tests\ConfigurationException;
14+
15+
use PhpCsFixer\ConfigurationException\RequiredFixerConfigurationException;
16+
use PhpCsFixer\Console\Command\FixCommand;
17+
use PHPUnit\Framework\TestCase;
18+
19+
/**
20+
* @author Andreas Möller <[email protected]>
21+
*
22+
* @internal
23+
*
24+
* @covers \PhpCsFixer\ConfigurationException\RequiredFixerConfigurationException
25+
*/
26+
final class RequiredFixerConfigurationExceptionTest extends TestCase
27+
{
28+
public function testIsInvalidFixerConfigurationException()
29+
{
30+
$exception = new RequiredFixerConfigurationException(
31+
'hal',
32+
'I cannot do that, Dave.'
33+
);
34+
35+
$this->assertInstanceOf('PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException', $exception);
36+
}
37+
38+
public function testDefaults()
39+
{
40+
$fixerName = 'hal';
41+
$message = 'I cannot do that, Dave.';
42+
43+
$exception = new RequiredFixerConfigurationException(
44+
$fixerName,
45+
$message
46+
);
47+
48+
$this->assertSame(sprintf('[%s] %s', $fixerName, $message), $exception->getMessage());
49+
$this->assertSame(FixCommand::EXIT_STATUS_FLAG_HAS_INVALID_FIXER_CONFIG, $exception->getCode());
50+
$this->assertNull($exception->getPrevious());
51+
}
52+
53+
public function testConstructorSetsValues()
54+
{
55+
$fixerName = 'hal';
56+
$message = 'I cannot do that, Dave.';
57+
$previous = new \RuntimeException();
58+
59+
$exception = new RequiredFixerConfigurationException(
60+
$fixerName,
61+
$message,
62+
$previous
63+
);
64+
65+
$this->assertSame(sprintf('[%s] %s', $fixerName, $message), $exception->getMessage());
66+
$this->assertSame(FixCommand::EXIT_STATUS_FLAG_HAS_INVALID_FIXER_CONFIG, $exception->getCode());
67+
$this->assertSame($previous, $exception->getPrevious());
68+
}
69+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
/*
4+
* This file is part of PHP CS Fixer.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
* Dariusz Rumiński <[email protected]>
8+
*
9+
* This source file is subject to the MIT license that is bundled
10+
* with this source code in the file LICENSE.
11+
*/
12+
13+
namespace PhpCsFixer\Tests\Console\Command;
14+
15+
use PhpCsFixer\Console\Command\DescribeNameNotFoundException;
16+
use PHPUnit\Framework\TestCase;
17+
18+
/**
19+
* @author Andreas Möller <[email protected]>
20+
*
21+
* @internal
22+
*
23+
* @covers \PhpCsFixer\Console\Command\DescribeNameNotFoundException
24+
*/
25+
final class DescribeNameNotFoundExceptionTest extends TestCase
26+
{
27+
public function testIsInvalidArgumentException()
28+
{
29+
$exception = new DescribeNameNotFoundException(
30+
'Peter',
31+
'weird'
32+
);
33+
34+
$this->assertInstanceOf('InvalidArgumentException', $exception);
35+
}
36+
37+
public function testConstructorSetsValues()
38+
{
39+
$name = 'Peter';
40+
$type = 'weird';
41+
42+
$exception = new DescribeNameNotFoundException(
43+
$name,
44+
$type
45+
);
46+
47+
$this->assertSame($name, $exception->getName());
48+
$this->assertSame($type, $exception->getType());
49+
}
50+
}

0 commit comments

Comments
 (0)