composer update

This commit is contained in:
2019-06-23 10:14:30 +00:00
parent a56db5ea2b
commit ec4506ebf4
790 changed files with 35767 additions and 7663 deletions
@@ -0,0 +1,22 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use PHPUnit\Framework\TestCase;
/**
* @coversNothing
*/
class CoverageClassNothingTest extends TestCase
{
public function testSomething(): void
{
$o = new CoveredClass;
$o->publicMethod();
}
}
@@ -0,0 +1,19 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use PHPUnit\Framework\TestCase;
class CoverageClassWithoutAnnotationsTest extends TestCase
{
public function testSomething(): void
{
$o = new CoveredClass;
$o->publicMethod();
}
}
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
@@ -9,7 +9,7 @@
*/
use PHPUnit\Framework\TestCase;
class CoverageNothingTest extends TestCase
class CoverageMethodNothingCoversMethod extends TestCase
{
/**
* @covers CoveredClass::publicMethod
@@ -0,0 +1,22 @@
<?php
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use PHPUnit\Framework\TestCase;
class CoverageMethodNothingTest extends TestCase
{
/**
* @coversNothing
*/
public function testSomething(): void
{
$o = new CoveredClass;
$o->publicMethod();
}
}
@@ -220,6 +220,12 @@ class GeneratorTest extends TestCase
$this->assertInstanceOf(MockObject::class, $stub);
}
public function testMockingOfThrowableConstructorArguments(): void
{
$mock = $this->generator->getMock(Throwable::class, null, ['It works']);
$this->assertSame('It works', $mock->getMessage());
}
public function testVariadicArgumentsArePassedToOriginalMethod()
{
/** @var ClassWithVariadicArgumentMethod|MockObject $mock */
@@ -66,9 +66,11 @@ class TestResultTest extends TestCase
public function canSkipCoverageProvider(): array
{
return [
['CoverageClassTest', true],
['CoverageNothingTest', true],
['CoverageClassTest', false],
['CoverageClassWithoutAnnotationsTest', false],
['CoverageCoversOverridesCoversNothingTest', false],
['CoverageClassNothingTest', true],
['CoverageMethodNothingTest', true],
];
}
@@ -79,8 +81,10 @@ class TestResultTest extends TestCase
{
require_once TEST_FILES_PATH . $testCase . '.php';
$test = new $testCase;
$canSkipCoverage = TestResult::isAnyCoverageRequired($test);
$test = new $testCase('testSomething');
$coverageRequired = TestResult::isAnyCoverageRequired($test);
$canSkipCoverage = !$coverageRequired;
$this->assertEquals($expectedCanSkip, $canSkipCoverage);
}
}
+14 -2
View File
@@ -782,11 +782,15 @@ class TestTest extends TestCase
$expected = [
TEST_FILES_PATH . 'NamespaceCoveredClass.php' => $lines,
];
} elseif ($test === 'CoverageMethodNothingCoversMethod') {
$expected = false;
} elseif ($test === 'CoverageCoversOverridesCoversNothingTest') {
$expected = [TEST_FILES_PATH . 'CoveredClass.php' => $lines];
} elseif ($test === 'CoverageNoneTest') {
$expected = [];
} elseif ($test === 'CoverageNothingTest') {
} elseif ($test === 'CoverageClassNothingTest') {
$expected = false;
} elseif ($test === 'CoverageMethodNothingTest') {
$expected = false;
} elseif ($test === 'CoverageFunctionTest') {
$expected = [
@@ -1009,13 +1013,21 @@ class TestTest extends TestCase
\range(31, 35),
],
[
'CoverageNothingTest',
'CoverageClassNothingTest',
false,
],
[
'CoverageMethodNothingTest',
false,
],
[
'CoverageCoversOverridesCoversNothingTest',
\range(29, 33),
],
[
'CoverageMethodNothingCoversMethod',
false,
],
];
}