Skip to content

Commit

Permalink
refactor to phpunit 10 event system
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Mar 25, 2024
1 parent ce639ba commit 5e86399
Show file tree
Hide file tree
Showing 17 changed files with 103 additions and 567 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"php-http/mock-client": "^1.6.0",
"symfony/process": "^6.4|| ^7.0",
"symfony/http-kernel": "^6.4|| ^7.0",
"phpunit/phpunit": "^9"
"phpunit/phpunit": "^10.5"
},
"conflict": {
"toflar/psr6-symfony-http-cache-store": "<2.2.1",
"phpunit/phpunit": "<8"
"phpunit/phpunit": "<10"
},
"suggest": {
"friendsofsymfony/http-cache-bundle": "For integration with the Symfony framework",
Expand Down
12 changes: 6 additions & 6 deletions doc/testing-your-application.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ Web Server

You will need to run a web server to provide the PHP application you want to
test. The test cases only handle running the proxy server. It’s easiest to
use PHP’s built in web server. Include the WebServerListener in your
``phpunit.xml``:
use PHP’s built in web server. Include the WebServerSubscriber in your
``phpunit.xml``, either using the extension provided by this package or your own:

.. literalinclude:: ../phpunit.xml.dist
:prepend:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit>
<listeners>
<extensions>
:language: xml
:start-after: <listeners>
:end-before: </listeners>
:start-after: <extensions>
:end-before: </extensions>
:append:
</listeners>
</extensions>
</phpunit>

Then set the ``webserver`` group on your test to start PHP’s web server before
Expand Down
48 changes: 24 additions & 24 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="./tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="./tests/bootstrap.php"
colors="true"
>
<testsuites>
<testsuite name="FOSHttpCache tests">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./src</directory>
</whitelist>
</filter>
<testsuites>
<testsuite name="FOSHttpCache tests">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>

<listeners>
<listener class="\FOS\HttpCache\Test\WebServerListener" />
</listeners>
<extensions>
<bootstrap class="FOS\HttpCache\Test\WebServerSubscriberExtension"/>
</extensions>

<php>
<const name="NGINX_FILE" value="./tests/Functional/Fixtures/nginx/fos.conf" />
<const name="WEB_SERVER_HOSTNAME" value="localhost" />
<const name="WEB_SERVER_PORT" value="8080" />
<const name="WEB_SERVER_DOCROOT" value="./tests/Functional/Fixtures/web" />
</php>
<const name="NGINX_FILE" value="./tests/Functional/Fixtures/nginx/fos.conf"/>
<const name="WEB_SERVER_HOSTNAME" value="localhost"/>
<const name="WEB_SERVER_PORT" value="8080"/>
<const name="WEB_SERVER_DOCROOT" value="./tests/Functional/Fixtures/web"/>
</php>

<source>
<include>
<directory>./src</directory>
</include>
</source>
</phpunit>
145 changes: 0 additions & 145 deletions src/Test/Legacy/WebServerListener.php

This file was deleted.

153 changes: 0 additions & 153 deletions src/Test/Legacy/WebServerListener6.php

This file was deleted.

0 comments on commit 5e86399

Please sign in to comment.