Skip to content

Commit 30bb652

Browse files
Merge branch '8.5' into 9.5
2 parents 1883687 + 2f9ab38 commit 30bb652

File tree

6 files changed

+49
-93
lines changed

6 files changed

+49
-93
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,8 @@ jobs:
258258
with:
259259
java-version: 1.8
260260

261-
- name: Run regular test suite with unscoped PHAR
262-
run: ant run-regular-tests-with-unscoped-phar
263-
264-
- name: Run PHAR-specific end-to-end tests with scoped PHAR
265-
run: ant run-phar-specific-tests-with-scoped-phar
261+
- name: Run PHAR-specific end-to-end tests
262+
run: ant run-phar-specific-tests
266263

267264
- uses: actions/upload-artifact@v2
268265
if: ${{ matrix.php-version == 8.1 }}

build.xml

Lines changed: 23 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,12 @@
9696
<target name="phar" depends="-phar-prepare,-phar-determine-version" description="Create PHAR archive of PHPUnit and all its dependencies">
9797
<antcall target="-phar-build">
9898
<param name="type" value="release"/>
99-
<param name="scope" value="true"/>
100-
</antcall>
101-
</target>
102-
103-
<target name="unscoped-phar" depends="-phar-prepare,-phar-determine-version" description="Create unscoped PHAR archive of PHPUnit and all its dependencies">
104-
<antcall target="-phar-build">
105-
<param name="type" value="release"/>
106-
<param name="scope" value="false"/>
10799
</antcall>
108100
</target>
109101

110102
<target name="phar-snapshot" depends="-phar-prepare" description="Create PHAR archive of PHPUnit and all its dependencies (snapshot)">
111103
<antcall target="-phar-build">
112104
<param name="type" value="snapshot"/>
113-
<param name="scope" value="true"/>
114-
</antcall>
115-
</target>
116-
117-
<target name="unscoped-phar-snapshot" depends="-phar-prepare" description="Create unscoped PHAR archive of PHPUnit and all its dependencies (snapshot)">
118-
<antcall target="-phar-build">
119-
<param name="type" value="snapshot"/>
120-
<param name="scope" value="false"/>
121105
</antcall>
122106
</target>
123107

@@ -379,12 +363,28 @@
379363
<arg value="${type}"/>
380364
</exec>
381365

382-
<antcall target="-phar-scope" if:true="${scope}"/>
383-
<copy todir="${basedir}/build/tmp/phar-scoped" unless:true="${scope}">
384-
<fileset dir="${basedir}/build/tmp/phar">
385-
<include name="**/*" />
386-
</fileset>
387-
</copy>
366+
<exec executable="${basedir}/tools/php-scoper" taskname="php-scoper">
367+
<arg value="add-prefix" />
368+
<arg value="--no-ansi" />
369+
<arg value="--force" />
370+
<arg value="--config" />
371+
<arg path="${basedir}/build/config/php-scoper.php" />
372+
<arg value="--no-interaction" />
373+
<arg value="--stop-on-failure" />
374+
<arg value="--output-dir" />
375+
<arg path="${basedir}/build/tmp/phar-scoped" />
376+
<arg value="--prefix" />
377+
<arg value="PHPUnit" />
378+
<arg path="${basedir}/build/tmp/phar" />
379+
</exec>
380+
381+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
382+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnit\SebastianBergmann\CodeCoverage\Driver\Selector"/>
383+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\Filter" value="PHPUnit\SebastianBergmann\CodeCoverage\Filter"/>
384+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseClass.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
385+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseClass.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnit\SebastianBergmann\CodeCoverage\Driver\Selector"/>
386+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseMethod.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
387+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseMethod.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnit\SebastianBergmann\CodeCoverage\Driver\Selector"/>
388388

389389
<copy file="${basedir}/.phpstorm.meta.php" tofile="${basedir}/build/tmp/phar-scoped/.phpstorm.meta.php"/>
390390

@@ -421,57 +421,11 @@
421421
<delete dir="${basedir}/build/tmp"/>
422422
</target>
423423

424-
<target name="-phar-scope">
425-
<exec executable="${basedir}/tools/php-scoper" taskname="php-scoper">
426-
<arg value="add-prefix" />
427-
<arg value="--no-ansi" />
428-
<arg value="--force" />
429-
<arg value="--config" />
430-
<arg path="${basedir}/build/config/php-scoper.php" />
431-
<arg value="--no-interaction" />
432-
<arg value="--stop-on-failure" />
433-
<arg value="--output-dir" />
434-
<arg path="${basedir}/build/tmp/phar-scoped" />
435-
<arg value="--prefix" />
436-
<arg value="PHPUnit" />
437-
<arg path="${basedir}/build/tmp/phar" />
438-
</exec>
439-
440-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
441-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnit\SebastianBergmann\CodeCoverage\Driver\Selector"/>
442-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\Filter" value="PHPUnit\SebastianBergmann\CodeCoverage\Filter"/>
443-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseClass.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
444-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseClass.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnit\SebastianBergmann\CodeCoverage\Driver\Selector"/>
445-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseMethod.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
446-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseMethod.tpl" token="SebastianBergmann\CodeCoverage\Driver\Selector" value="PHPUnit\SebastianBergmann\CodeCoverage\Driver\Selector"/>
447-
</target>
448-
449424
<target name="-phar-determine-version">
450425
<exec executable="${basedir}/build/scripts/version.php" outputproperty="version" failonerror="true" />
451426
</target>
452427

453-
<target name="run-regular-tests-with-unscoped-phar" depends="clean,unscoped-phar-snapshot" description="Build unscoped PHAR snapshot and run the regular test suite with it">
454-
<exec executable="${basedir}/tools/phpab" taskname="phpab" failonerror="true">
455-
<arg value="--output" />
456-
<arg path="${basedir}/tests/autoload.php" />
457-
<arg path="${basedir}/tests/_files" />
458-
<arg path="${basedir}/tests/end-to-end/_files" />
459-
<arg path="${basedir}/tests/end-to-end/execution-order/_files" />
460-
<arg path="${basedir}/tests/unit" />
461-
</exec>
462-
463-
<delete dir="${basedir}/vendor"/>
464-
<delete file="${basedir}/composer.lock"/>
465-
466-
<exec executable="${basedir}/build/artifacts/phpunit-snapshot.phar" taskname="phpunit" failonerror="true">
467-
<arg value="--testsuite" />
468-
<arg value="unit" />
469-
</exec>
470-
471-
<delete file="${basedir}/tests/autoload.php"/>
472-
</target>
473-
474-
<target name="run-phar-specific-tests-with-scoped-phar" depends="clean,phar-snapshot" description="Build scoped PHAR snapshot and run the PHAR-specific tests with it">
428+
<target name="run-phar-specific-tests" depends="clean,phar-snapshot" description="Build snapshot PHAR and run the PHAR-specific tests with it">
475429
<delete dir="${basedir}/vendor"/>
476430
<delete file="${basedir}/composer.lock"/>
477431

tests/unit/Framework/MockObject/Builder/InvocationMockerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*/
11+
namespace PHPUnit\Framework\MockObject;
12+
13+
use Foo;
1114
use PHPUnit\Framework\Constraint\IsEqual;
1215
use PHPUnit\Framework\MockObject\Builder\InvocationMocker;
13-
use PHPUnit\Framework\MockObject\IncompatibleReturnValueException;
14-
use PHPUnit\Framework\MockObject\InvocationHandler;
15-
use PHPUnit\Framework\MockObject\Matcher;
16-
use PHPUnit\Framework\MockObject\MethodCannotBeConfiguredException;
1716
use PHPUnit\Framework\MockObject\Stub\ReturnSelf;
1817
use PHPUnit\Framework\MockObject\Stub\ReturnStub;
1918
use PHPUnit\Framework\TestCase;
2019
use PHPUnit\TestFixture\ClassWithAllPossibleReturnTypes;
2120
use PHPUnit\TestFixture\MockObject\ClassWithImplicitProtocol;
21+
use stdClass;
2222

2323
/**
2424
* @covers \PHPUnit\Framework\MockObject\Builder\InvocationMocker

tests/unit/Framework/MockObject/Matcher/ConsecutiveParametersTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10+
namespace PHPUnit\Framework\MockObject;
11+
1012
use PHPUnit\Framework\ExpectationFailedException;
1113
use PHPUnit\Framework\InvalidParameterGroupException;
1214
use PHPUnit\Framework\TestCase;
15+
use stdClass;
1316

1417
/**
1518
* @small

tests/unit/Framework/MockObject/ProxyObjectTest.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10-
use PHPUnit\Framework\MockObject\MockObject;
10+
namespace PHPUnit\Framework\MockObject;
11+
12+
use function assert;
1113
use PHPUnit\Framework\TestCase;
1214
use PHPUnit\TestFixture\TestProxyFixture;
1315

@@ -23,8 +25,8 @@ public function testProxyingWorksForMethodThatReturnsUndeclaredScalarValue(): vo
2325
$proxy->expects($this->once())
2426
->method('returnString');
2527

26-
\assert($proxy instanceof MockObject);
27-
\assert($proxy instanceof TestProxyFixture);
28+
assert($proxy instanceof MockObject);
29+
assert($proxy instanceof TestProxyFixture);
2830

2931
$this->assertSame('result', $proxy->returnString());
3032
}
@@ -36,8 +38,8 @@ public function testProxyingWorksForMethodThatReturnsDeclaredScalarValue(): void
3638
$proxy->expects($this->once())
3739
->method('returnTypedString');
3840

39-
\assert($proxy instanceof MockObject);
40-
\assert($proxy instanceof TestProxyFixture);
41+
assert($proxy instanceof MockObject);
42+
assert($proxy instanceof TestProxyFixture);
4143

4244
$this->assertSame('result', $proxy->returnTypedString());
4345
}
@@ -49,8 +51,8 @@ public function testProxyingWorksForMethodThatReturnsUndeclaredObject(): void
4951
$proxy->expects($this->once())
5052
->method('returnObject');
5153

52-
\assert($proxy instanceof MockObject);
53-
\assert($proxy instanceof TestProxyFixture);
54+
assert($proxy instanceof MockObject);
55+
assert($proxy instanceof TestProxyFixture);
5456

5557
$this->assertSame('bar', $proxy->returnObject()->foo);
5658
}
@@ -62,8 +64,8 @@ public function testProxyingWorksForMethodThatReturnsDeclaredObject(): void
6264
$proxy->expects($this->once())
6365
->method('returnTypedObject');
6466

65-
\assert($proxy instanceof MockObject);
66-
\assert($proxy instanceof TestProxyFixture);
67+
assert($proxy instanceof MockObject);
68+
assert($proxy instanceof TestProxyFixture);
6769

6870
$this->assertSame('bar', $proxy->returnTypedObject()->foo);
6971
}
@@ -75,8 +77,8 @@ public function testProxyingWorksForMethodThatReturnsUndeclaredObjectOfFinalClas
7577
$proxy->expects($this->once())
7678
->method('returnObjectOfFinalClass');
7779

78-
\assert($proxy instanceof MockObject);
79-
\assert($proxy instanceof TestProxyFixture);
80+
assert($proxy instanceof MockObject);
81+
assert($proxy instanceof TestProxyFixture);
8082

8183
$this->assertSame('value', $proxy->returnObjectOfFinalClass()->value());
8284
}
@@ -88,8 +90,8 @@ public function testProxyingWorksForMethodThatReturnsDeclaredObjectOfFinalClass(
8890
$proxy->expects($this->once())
8991
->method('returnTypedObjectOfFinalClass');
9092

91-
\assert($proxy instanceof MockObject);
92-
\assert($proxy instanceof TestProxyFixture);
93+
assert($proxy instanceof MockObject);
94+
assert($proxy instanceof TestProxyFixture);
9395

9496
$this->assertSame('value', $proxy->returnTypedObjectOfFinalClass()->value());
9597
}

tests/unit/Runner/NullTestResultCacheTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
10+
namespace PHPUnit\Runner;
11+
1012
use PHPUnit\Framework\TestCase;
11-
use PHPUnit\Runner\BaseTestRunner;
12-
use PHPUnit\Runner\NullTestResultCache;
1313

1414
/**
1515
* @group test-reorder

0 commit comments

Comments
 (0)