Skip to content

Commit 6f49ed2

Browse files
Merge branch '4.5' into 4.6
2 parents 77e333d + 9336e3e commit 6f49ed2

18 files changed

+167
-73
lines changed

ChangeLog-4.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
* Implemented [#137](https://github.com/sebastianbergmann/phpunit/issues/137): Add support for variable number of tests shown per line in default result printer
77
* Merged [#1478](https://github.com/sebastianbergmann/phpunit/issues/1478): Improve the performance of `PHPUnit_Framework_Constraint_IsEqual` (which is used by `assertEquals()`, for instance) for the most common case
88
* Fixed [#1474](https://github.com/sebastianbergmann/phpunit/issues/1474): Allow the registration of custom comparators for `assertEquals()` et al. (again)
9+
* [Deprecated](https://github.com/sebastianbergmann/phpunit/commit/7abe7796f77b13fdf3cfc506fb987d6c2ab477f5) the `--strict` commandline option and the XML configuration's `strict` attribute
910

src/Extensions/GroupTestSuite.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public function __construct(PHPUnit_Framework_TestSuite $suite, array $groups)
4848
foreach ($tests as $test) {
4949
if ($test instanceof PHPUnit_Framework_TestCase) {
5050
$testGroups = PHPUnit_Util_Test::getGroups(
51-
get_class($test), $test->getName(false)
51+
get_class($test),
52+
$test->getName(false)
5253
);
5354

5455
foreach ($groups as $group) {

src/Extensions/RepeatedTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public function __construct(PHPUnit_Framework_Test $test, $timesRepeat = 1, $pro
6060
$this->timesRepeat = $timesRepeat;
6161
} else {
6262
throw PHPUnit_Util_InvalidArgumentHelper::factory(
63-
2, 'positive integer'
63+
2,
64+
'positive integer'
6465
);
6566
}
6667

src/Framework/Assert.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@ public static function assertArraySubset($subset, $array, $strict = false, $mess
6868
{
6969
if (!is_array($subset)) {
7070
throw PHPUnit_Util_InvalidArgumentHelper::factory(
71-
1, 'array or ArrayAccess'
71+
1,
72+
'array or ArrayAccess'
7273
);
7374
}
7475

7576
if (!is_array($array)) {
7677
throw PHPUnit_Util_InvalidArgumentHelper::factory(
77-
2, 'array or ArrayAccess'
78+
2,
79+
'array or ArrayAccess'
7880
);
7981
}
8082

src/Runner/BaseTestRunner.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function getTest($suiteClassName, $suiteClassFile = '', $suffixes = '')
5555
!is_file($suiteClassName . '.php') && empty($suiteClassFile)) {
5656
$facade = new File_Iterator_Facade;
5757
$files = $facade->getFilesAsArray(
58-
$suiteClassName, $suffixes
58+
$suiteClassName,
59+
$suffixes
5960
);
6061

6162
$suite = new PHPUnit_Framework_TestSuite($suiteClassName);
@@ -66,7 +67,8 @@ public function getTest($suiteClassName, $suiteClassFile = '', $suffixes = '')
6667

6768
try {
6869
$testClass = $this->loadSuiteClass(
69-
$suiteClassName, $suiteClassFile
70+
$suiteClassName,
71+
$suiteClassFile
7072
);
7173
} catch (PHPUnit_Framework_Exception $e) {
7274
$this->runFailed($e->getMessage());

src/Runner/Filter/Group.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public function __construct(RecursiveIterator $iterator, array $groups, PHPUnit_
3636
foreach ($suite->getGroupDetails() as $group => $tests) {
3737
if (in_array($group, $groups)) {
3838
$testHashes = array_map(
39-
function ($test) { return spl_object_hash($test);
39+
function ($test) {
40+
return spl_object_hash($test);
4041
},
4142
$tests
4243
);

src/Runner/Filter/Test.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ protected function setFilter($filter)
8282
// Escape delimiters in regular expression. Do NOT use preg_quote,
8383
// to keep magic characters.
8484
$filter = sprintf('/%s/', str_replace(
85-
'/', '\\/', $filter
85+
'/',
86+
'\\/',
87+
$filter
8688
));
8789
}
8890

src/TextUI/ResultPrinter.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,16 @@ protected function printFooter(PHPUnit_Framework_TestResult $result)
354354
count($result),
355355
$this->numAssertions,
356356
$this->getCountString(
357-
$result->notImplementedCount(), 'Incomplete'
357+
$result->notImplementedCount(),
358+
'Incomplete'
358359
),
359360
$this->getCountString(
360-
$result->skippedCount(), 'Skipped'
361+
$result->skippedCount(),
362+
'Skipped'
361363
),
362364
$this->getCountString(
363-
$result->riskyCount(), 'Risky'
365+
$result->riskyCount(),
366+
'Risky'
364367
)
365368
)
366369
);
@@ -375,7 +378,8 @@ protected function printFooter(PHPUnit_Framework_TestResult $result)
375378
$this->getCountString($result->failureCount(), 'Failures'),
376379
$this->getCountString($result->errorCount(), 'Errors'),
377380
$this->getCountString(
378-
$result->notImplementedCount(), 'Incomplete'
381+
$result->notImplementedCount(),
382+
'Incomplete'
379383
),
380384
$this->getCountString($result->skippedCount(), 'Skipped')
381385
)
@@ -513,7 +517,8 @@ public function startTest(PHPUnit_Framework_Test $test)
513517
if ($this->debug) {
514518
$this->write(
515519
sprintf(
516-
"\nStarting test '%s'.\n", PHPUnit_Util_Test::describe($test)
520+
"\nStarting test '%s'.\n",
521+
PHPUnit_Util_Test::describe($test)
517522
)
518523
);
519524
}

src/TextUI/TestRunner.php

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,13 @@ class_exists($arguments['printer'], false)) {
314314
if ($codeCoverageReports > 0 && (!extension_loaded('tokenizer') || !$this->canCollectCodeCoverage)) {
315315
if (!extension_loaded('tokenizer')) {
316316
$this->showExtensionNotLoadedMessage(
317-
'tokenizer', 'No code coverage will be generated.'
317+
'tokenizer',
318+
'No code coverage will be generated.'
318319
);
319320
} elseif (!extension_loaded('Xdebug')) {
320321
$this->showExtensionNotLoadedMessage(
321-
'Xdebug', 'No code coverage will be generated.'
322+
'Xdebug',
323+
'No code coverage will be generated.'
322324
);
323325
}
324326

@@ -327,7 +329,8 @@ class_exists($arguments['printer'], false)) {
327329

328330
if ($codeCoverageReports > 0) {
329331
$codeCoverage = new PHP_CodeCoverage(
330-
null, $this->codeCoverageFilter
332+
null,
333+
$this->codeCoverageFilter
331334
);
332335

333336
$codeCoverage->setAddUncoveredFilesFromWhitelist(
@@ -378,7 +381,8 @@ class_exists($arguments['printer'], false)) {
378381
if (isset($arguments['junitLogfile'])) {
379382
$result->addListener(
380383
new PHPUnit_Util_Log_JUnit(
381-
$arguments['junitLogfile'], $arguments['logIncompleteSkipped']
384+
$arguments['junitLogfile'],
385+
$arguments['logIncompleteSkipped']
382386
)
383387
);
384388
}
@@ -781,7 +785,8 @@ protected function handleConfiguration(array &$arguments)
781785

782786
if (isset($loggingConfiguration['plain'])) {
783787
$arguments['listeners'][] = new PHPUnit_TextUI_ResultPrinter(
784-
$loggingConfiguration['plain'], true
788+
$loggingConfiguration['plain'],
789+
true
785790
);
786791
}
787792

@@ -835,7 +840,10 @@ protected function handleConfiguration(array &$arguments)
835840

836841
foreach ($filterConfiguration['blacklist']['include']['directory'] as $dir) {
837842
$this->codeCoverageFilter->addDirectoryToBlacklist(
838-
$dir['path'], $dir['suffix'], $dir['prefix'], $dir['group']
843+
$dir['path'],
844+
$dir['suffix'],
845+
$dir['prefix'],
846+
$dir['group']
839847
);
840848
}
841849

@@ -845,7 +853,10 @@ protected function handleConfiguration(array &$arguments)
845853

846854
foreach ($filterConfiguration['blacklist']['exclude']['directory'] as $dir) {
847855
$this->codeCoverageFilter->removeDirectoryFromBlacklist(
848-
$dir['path'], $dir['suffix'], $dir['prefix'], $dir['group']
856+
$dir['path'],
857+
$dir['suffix'],
858+
$dir['prefix'],
859+
$dir['group']
849860
);
850861
}
851862

@@ -856,7 +867,9 @@ protected function handleConfiguration(array &$arguments)
856867

857868
foreach ($filterConfiguration['whitelist']['include']['directory'] as $dir) {
858869
$this->codeCoverageFilter->addDirectoryToWhitelist(
859-
$dir['path'], $dir['suffix'], $dir['prefix']
870+
$dir['path'],
871+
$dir['suffix'],
872+
$dir['prefix']
860873
);
861874
}
862875

@@ -866,7 +879,9 @@ protected function handleConfiguration(array &$arguments)
866879

867880
foreach ($filterConfiguration['whitelist']['exclude']['directory'] as $dir) {
868881
$this->codeCoverageFilter->removeDirectoryFromWhitelist(
869-
$dir['path'], $dir['suffix'], $dir['prefix']
882+
$dir['path'],
883+
$dir['suffix'],
884+
$dir['prefix']
870885
);
871886
}
872887

0 commit comments

Comments
 (0)