|
| 1 | +--TEST-- |
| 2 | +phpunit --log-junit php://stdout ../../_files/DataProviderTest.php |
| 3 | +--FILE-- |
| 4 | +<?php declare(strict_types=1); |
| 5 | +$logfile = tempnam(sys_get_temp_dir(), __FILE__); |
| 6 | + |
| 7 | +$_SERVER['argv'][] = '--do-not-cache-result'; |
| 8 | +$_SERVER['argv'][] = '--no-configuration'; |
| 9 | +$_SERVER['argv'][] = '--no-output'; |
| 10 | +$_SERVER['argv'][] = '--log-junit'; |
| 11 | +$_SERVER['argv'][] = $logfile; |
| 12 | +$_SERVER['argv'][] = __DIR__ . '/../../_files/DataProviderTest.php'; |
| 13 | +$_SERVER['argv'][] = __DIR__ . '/../../_files/DataProviderWithStringKeysTest.php'; |
| 14 | +$_SERVER['argv'][] = __DIR__ . '/../../_files/success.phpt'; |
| 15 | +$_SERVER['argv'][] = __DIR__ . '/../../_files/failure.phpt'; |
| 16 | + |
| 17 | +require_once __DIR__ . '/../../bootstrap.php'; |
| 18 | + |
| 19 | +(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); |
| 20 | + |
| 21 | +print file_get_contents($logfile); |
| 22 | + |
| 23 | +unlink($logfile); |
| 24 | +--EXPECTF-- |
| 25 | +<?xml version="1.0" encoding="UTF-8"?> |
| 26 | +<testsuites> |
| 27 | + <testsuite name="CLI Arguments" tests="10" assertions="10" errors="0" failures="3" skipped="0" time="%s"> |
| 28 | + <testsuite name="PHPUnit\TestFixture\DataProviderTest" file="%sDataProviderTest.php" tests="4" assertions="4" errors="0" failures="1" skipped="0" time="%s"> |
| 29 | + <testsuite name="PHPUnit\TestFixture\DataProviderTest::testAdd" tests="4" assertions="4" errors="0" failures="1" skipped="0" time="%s"> |
| 30 | + <testcase name="testAdd with data set #0" file="%sDataProviderTest.php" line="%d" class="PHPUnit\TestFixture\DataProviderTest" classname="PHPUnit.TestFixture.DataProviderTest" assertions="1" time="%s"/> |
| 31 | + <testcase name="testAdd with data set #1" file="%sDataProviderTest.php" line="%d" class="PHPUnit\TestFixture\DataProviderTest" classname="PHPUnit.TestFixture.DataProviderTest" assertions="1" time="%s"/> |
| 32 | + <testcase name="testAdd with data set #2" file="%sDataProviderTest.php" line="%d" class="PHPUnit\TestFixture\DataProviderTest" classname="PHPUnit.TestFixture.DataProviderTest" assertions="1" time="%s"> |
| 33 | + <failure type="PHPUnit\Framework\ExpectationFailedException">PHPUnit\TestFixture\DataProviderTest::testAdd with data set #2%A |
| 34 | +Failed asserting that 2 matches expected 3. |
| 35 | +%A |
| 36 | +%sDataProviderTest.php:%d</failure> |
| 37 | + </testcase> |
| 38 | + <testcase name="testAdd with data set #3" file="%sDataProviderTest.php" line="%d" class="PHPUnit\TestFixture\DataProviderTest" classname="PHPUnit.TestFixture.DataProviderTest" assertions="1" time="%s"/> |
| 39 | + </testsuite> |
| 40 | + </testsuite> |
| 41 | + <testsuite name="PHPUnit\TestFixture\DataProviderWithStringKeysTest" file="%sDataProviderWithStringKeysTest.php" tests="4" assertions="4" errors="0" failures="1" skipped="0" time="%s"> |
| 42 | + <testsuite name="PHPUnit\TestFixture\DataProviderWithStringKeysTest::testAdd" tests="4" assertions="4" errors="0" failures="1" skipped="0" time="%s"> |
| 43 | + <testcase name="testAdd with data set "0 + 0 = 0"" file="%sDataProviderWithStringKeysTest.php" line="%d" class="PHPUnit\TestFixture\DataProviderWithStringKeysTest" classname="PHPUnit.TestFixture.DataProviderWithStringKeysTest" assertions="1" time="%s"/> |
| 44 | + <testcase name="testAdd with data set "0 + 1 = 1"" file="%sDataProviderWithStringKeysTest.php" line="%d" class="PHPUnit\TestFixture\DataProviderWithStringKeysTest" classname="PHPUnit.TestFixture.DataProviderWithStringKeysTest" assertions="1" time="%s"/> |
| 45 | + <testcase name="testAdd with data set "1 + 1 = 3"" file="%sDataProviderWithStringKeysTest.php" line="%d" class="PHPUnit\TestFixture\DataProviderWithStringKeysTest" classname="PHPUnit.TestFixture.DataProviderWithStringKeysTest" assertions="1" time="%s"> |
| 46 | + <failure type="PHPUnit\Framework\ExpectationFailedException">PHPUnit\TestFixture\DataProviderWithStringKeysTest::testAdd with data set "1 + 1 = 3"%A |
| 47 | +Failed asserting that 2 matches expected 3. |
| 48 | +%A |
| 49 | +%sDataProviderWithStringKeysTest.php:%d</failure> |
| 50 | + </testcase> |
| 51 | + <testcase name="testAdd with data set "1 + 0 = 1"" file="%sDataProviderWithStringKeysTest.php" line="%d" class="PHPUnit\TestFixture\DataProviderWithStringKeysTest" classname="PHPUnit.TestFixture.DataProviderWithStringKeysTest" assertions="1" time="%s"/> |
| 52 | + </testsuite> |
| 53 | + </testsuite> |
| 54 | + <testcase name="success.phpt" file="%ssuccess.phpt" assertions="1" time="%s"/> |
| 55 | + <testcase name="failure.phpt" file="%sfailure.phpt" assertions="1" time="%s"> |
| 56 | + <failure type="PHPUnit\Framework\PhptAssertionFailedError">failure.phptFailed asserting that two strings are equal.%A |
| 57 | +--- Expected |
| 58 | ++++ Actual |
| 59 | +@@ @@ |
| 60 | +-'success' |
| 61 | ++'failure' |
| 62 | +%A |
| 63 | +%s:%d</failure> |
| 64 | + </testcase> |
| 65 | + </testsuite> |
| 66 | +</testsuites> |
0 commit comments