Skip to content

Commit 2f9ab38

Browse files
We do not ship unscoped PHARs (anymore), so there is not really a point in building and testing them
1 parent a76ac25 commit 2f9ab38

File tree

2 files changed

+21
-70
lines changed

2 files changed

+21
-70
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,8 @@ jobs:
246246
with:
247247
java-version: 1.8
248248

249-
- name: Run regular test suite with unscoped PHAR
250-
run: ant run-regular-tests-with-unscoped-phar
251-
252-
- name: Run PHAR-specific end-to-end tests with scoped PHAR
253-
run: ant run-phar-specific-tests-with-scoped-phar
249+
- name: Run PHAR-specific end-to-end tests
250+
run: ant run-phar-specific-tests
254251

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

build.xml

Lines changed: 19 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -115,28 +115,12 @@
115115
<target name="phar" depends="-phar-prepare,-phar-determine-version" description="Create PHAR archive of PHPUnit and all its dependencies">
116116
<antcall target="-phar-build">
117117
<param name="type" value="release"/>
118-
<param name="scope" value="true"/>
119-
</antcall>
120-
</target>
121-
122-
<target name="unscoped-phar" depends="-phar-prepare,-phar-determine-version" description="Create unscoped PHAR archive of PHPUnit and all its dependencies">
123-
<antcall target="-phar-build">
124-
<param name="type" value="release"/>
125-
<param name="scope" value="false"/>
126118
</antcall>
127119
</target>
128120

129121
<target name="phar-snapshot" depends="-phar-prepare" description="Create PHAR archive of PHPUnit and all its dependencies (snapshot)">
130122
<antcall target="-phar-build">
131123
<param name="type" value="snapshot"/>
132-
<param name="scope" value="true"/>
133-
</antcall>
134-
</target>
135-
136-
<target name="unscoped-phar-snapshot" depends="-phar-prepare" description="Create unscoped PHAR archive of PHPUnit and all its dependencies (snapshot)">
137-
<antcall target="-phar-build">
138-
<param name="type" value="snapshot"/>
139-
<param name="scope" value="false"/>
140124
</antcall>
141125
</target>
142126

@@ -365,12 +349,24 @@
365349
<arg value="${type}"/>
366350
</exec>
367351

368-
<antcall target="-phar-scope" if:true="${scope}"/>
369-
<copy todir="${basedir}/build/tmp/phar-scoped" unless:true="${scope}">
370-
<fileset dir="${basedir}/build/tmp/phar">
371-
<include name="**/*" />
372-
</fileset>
373-
</copy>
352+
<exec executable="${basedir}/tools/php-scoper" taskname="php-scoper">
353+
<arg value="add-prefix" />
354+
<arg value="--no-ansi" />
355+
<arg value="--force" />
356+
<arg value="--config" />
357+
<arg path="${basedir}/build/config/php-scoper.php" />
358+
<arg value="--no-interaction" />
359+
<arg value="--stop-on-failure" />
360+
<arg value="--output-dir" />
361+
<arg path="${basedir}/build/tmp/phar-scoped" />
362+
<arg value="--prefix" />
363+
<arg value="PHPUnit" />
364+
<arg path="${basedir}/build/tmp/phar" />
365+
</exec>
366+
367+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
368+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseClass.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
369+
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseMethod.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
374370

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

@@ -407,53 +403,11 @@
407403
<delete dir="${basedir}/build/tmp"/>
408404
</target>
409405

410-
<target name="-phar-scope">
411-
<exec executable="${basedir}/tools/php-scoper" taskname="php-scoper">
412-
<arg value="add-prefix" />
413-
<arg value="--no-ansi" />
414-
<arg value="--force" />
415-
<arg value="--config" />
416-
<arg path="${basedir}/build/config/php-scoper.php" />
417-
<arg value="--no-interaction" />
418-
<arg value="--stop-on-failure" />
419-
<arg value="--output-dir" />
420-
<arg path="${basedir}/build/tmp/phar-scoped" />
421-
<arg value="--prefix" />
422-
<arg value="PHPUnit" />
423-
<arg path="${basedir}/build/tmp/phar" />
424-
</exec>
425-
426-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/PhptTestCase.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
427-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseClass.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
428-
<replace file="${basedir}/build/tmp/phar-scoped/phpunit/Util/PHP/Template/TestCaseMethod.tpl" token="SebastianBergmann\CodeCoverage\CodeCoverage" value="PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage"/>
429-
</target>
430-
431406
<target name="-phar-determine-version">
432407
<exec executable="${basedir}/build/scripts/version.php" outputproperty="version" failonerror="true" />
433408
</target>
434409

435-
<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">
436-
<exec executable="${basedir}/tools/phpab" taskname="phpab" failonerror="true">
437-
<arg value="--output" />
438-
<arg path="${basedir}/tests/autoload.php" />
439-
<arg path="${basedir}/tests/_files" />
440-
<arg path="${basedir}/tests/end-to-end/_files" />
441-
<arg path="${basedir}/tests/end-to-end/execution-order/_files" />
442-
<arg path="${basedir}/tests/unit" />
443-
</exec>
444-
445-
<delete dir="${basedir}/vendor"/>
446-
<delete file="${basedir}/composer.lock"/>
447-
448-
<exec executable="${basedir}/build/artifacts/phpunit-snapshot.phar" taskname="phpunit" failonerror="true">
449-
<arg value="--testsuite" />
450-
<arg value="unit" />
451-
</exec>
452-
453-
<delete file="${basedir}/tests/autoload.php"/>
454-
</target>
455-
456-
<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">
410+
<target name="run-phar-specific-tests" depends="clean,phar-snapshot" description="Build snapshot PHAR and run the PHAR-specific tests with it">
457411
<delete dir="${basedir}/vendor"/>
458412
<delete file="${basedir}/composer.lock"/>
459413

0 commit comments

Comments
 (0)