[FrameworkBundle] fix tests

This commit is contained in:
Nicolas Grekas 2021-06-28 17:26:46 +02:00
parent ac2c3a936d
commit 21621ab783
11 changed files with 26 additions and 21 deletions

View File

@ -198,7 +198,12 @@ jobs:
git checkout -m FETCH_HEAD
COMPONENTS=$(echo "$COMPONENTS" | xargs dirname | xargs -n1 -I{} bash -c "[ -e '{}/phpunit.xml.dist' ] && echo '{}'" | sort || true)
(cd src/Symfony/Component/HttpFoundation; composer require --dev --no-update mongodb/mongodb)
[[ ! $COMPONENTS ]] || echo "$COMPONENTS" | parallel -j +3 "_run_tests {} 'cd {} && rm composer.lock vendor/ -Rf && $COMPOSER_UP && $PHPUNIT$LEGACY'" || X=1
if [[ $COMPONENTS ]]; then
echo "::group::install phpunit"
./phpunit install
echo "::endgroup::"
echo "$COMPONENTS" | parallel -j +3 "_run_tests {} 'cd {} && rm composer.lock vendor/ -Rf && $COMPOSER_UP && $PHPUNIT$LEGACY'" || X=1
fi
fi
[[ ! $X ]] || (exit 1)

View File

@ -200,7 +200,7 @@ class ObjectsProvider
{
$eventDispatcher = new EventDispatcher();
$eventDispatcher->addListener('event1', 'global_function', 255);
$eventDispatcher->addListener('event1', 'var_dump', 255);
$eventDispatcher->addListener('event1', function () { return 'Closure'; }, -1);
$eventDispatcher->addListener('event2', new CallableClass());

View File

@ -1,7 +1,7 @@
[
{
"type": "function",
"name": "global_function",
"name": "var_dump",
"priority": 255
},
{

View File

@ -3,7 +3,7 @@
## Listener 1
- Type: `function`
- Name: `global_function`
- Name: `var_dump`
- Priority: `255`
## Listener 2

View File

@ -2,10 +2,10 @@
Registered Listeners for "event1" Event
=======================================
------- ------------------- ----------
 Order   Callable   Priority 
------- ------------------- ----------
#1 global_function() 255
#2 Closure() -1
------- ------------------- ----------
------- ------------ ----------
 Order   Callable   Priority 
------- ------------ ----------
#1 var_dump() 255
#2 Closure() -1
------- ------------ ----------

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<event-dispatcher>
<callable type="function" name="global_function" priority="255"/>
<callable type="function" name="var_dump" priority="255"/>
<callable type="closure" priority="-1"/>
</event-dispatcher>

View File

@ -2,7 +2,7 @@
"event1": [
{
"type": "function",
"name": "global_function",
"name": "var_dump",
"priority": 255
},
{

View File

@ -5,7 +5,7 @@
### Listener 1
- Type: `function`
- Name: `global_function`
- Name: `var_dump`
- Priority: `255`
### Listener 2

View File

@ -5,12 +5,12 @@
"event1" event
--------------
------- ------------------- ----------
 Order   Callable   Priority 
------- ------------------- ----------
#1 global_function() 255
#2 Closure() -1
------- ------------------- ----------
------- ------------ ----------
 Order   Callable   Priority 
------- ------------ ----------
#1 var_dump() 255
#2 Closure() -1
------- ------------ ----------
"event2" event
--------------

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<event-dispatcher>
<event name="event1">
<callable type="function" name="global_function" priority="255"/>
<callable type="function" name="var_dump" priority="255"/>
<callable type="closure" priority="-1"/>
</event>
<event name="event2">

View File

@ -166,7 +166,7 @@
<argument type="service" id="twig" />
<argument type="service" id="twig.error_renderer.html.inner" />
<argument type="service">
<service>
<service class="bool">
<factory class="Symfony\Bridge\Twig\ErrorRenderer\TwigErrorRenderer" method="isDebug" />
<argument type="service" id="request_stack" />
<argument>%kernel.debug%</argument>