Skip to content

Commit 9d8900f

Browse files
authored
Merge pull request #131 from matiashidalgo/bugfix/phpunit10-unit-test
Attempt to use phpunit 10 compatible event system for PHP Unit testing
2 parents 55af357 + cac76f6 commit 9d8900f

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.2/phpunit.xsd"
4+
colors="true"
5+
beStrictAboutTestsThatDoNotTestAnything="false"
6+
bootstrap="./framework/bootstrap.php"
7+
stderr="true"
8+
>
9+
<testsuites>
10+
<testsuite name="UnitTests">
11+
<directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/Test/Unit</directory>
12+
<directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/tests/Unit</directory>
13+
<directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/tests/unit</directory>
14+
</testsuite>
15+
</testsuites>
16+
<php>
17+
<ini name="date.timezone" value="America/Los_Angeles"/>
18+
<ini name="xdebug.max_nesting_level" value="200"/>
19+
</php>
20+
</phpunit>

magento-unit-tests/entrypoint.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,17 @@ COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist --no-interaction --no-pr
5454
echo "Determine which phpunit.xml file to use"
5555

5656
echo "Trying phpunit.xml file $PHPUNIT_FILE"
57-
if [[ ! -z "$PHPUNIT_FILE" && ! -f "$PHPUNIT_FILE" ]] ; then
57+
if [[ ! -z "$PHPUNIT_FILE" ]] ; then
5858
PHPUNIT_FILE=${GITHUB_WORKSPACE}/${PHPUNIT_FILE}
5959
fi
6060

6161
if [[ ! -f "$PHPUNIT_FILE" ]] ; then
62-
PHPUNIT_FILE=/docker-files/phpunit.xml
62+
if [[ "$MAGENTO_VERSION" == 2.4.8* ]]; then
63+
PHPUNIT_FILE=/docker-files/phpunitv10.xml
64+
else
65+
PHPUNIT_FILE=/docker-files/phpunit.xml
66+
fi
6367
fi
64-
6568
echo "Using PHPUnit file: $PHPUNIT_FILE"
6669
echo "Prepare for unit tests"
6770
cd $MAGENTO_ROOT

0 commit comments

Comments
 (0)