Skip to content

Commit a230042

Browse files
Resurrect test that got lost while reorganizing tests
1 parent cf811a7 commit a230042

3 files changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="../../../../../phpunit.xsd"
4+
>
5+
<testsuites>
6+
<testsuite name="default">
7+
<directory>tests</directory>
8+
</testsuite>
9+
</testsuites>
10+
11+
<source>
12+
<deprecationTrigger>
13+
<function>does_not_exist</function>
14+
<method>invalid-string</method>
15+
<method>DoesNotExist::doesNotExist</method>
16+
</deprecationTrigger>
17+
</source>
18+
</phpunit>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <sebastian@phpunit.de>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\TestFixture\SelfDirectIndirect;
11+
12+
use PHPUnit\Framework\TestCase;
13+
14+
final class ExampleTest extends TestCase
15+
{
16+
public function testOne(): void
17+
{
18+
$this->assertTrue(true);
19+
}
20+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--TEST--
2+
Test Runner warnings are displayed correctly when invalid deprecation triggers are configured in the XML configuration file
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
6+
$_SERVER['argv'][] = '--do-not-cache-result';
7+
$_SERVER['argv'][] = '--configuration';
8+
$_SERVER['argv'][] = __DIR__ . '/_files/invalid-deprecation-trigger';
9+
10+
require __DIR__ . '/../../bootstrap.php';
11+
12+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
13+
--EXPECTF--
14+
PHPUnit %s by Sebastian Bergmann and contributors.
15+
16+
Runtime: %s
17+
Configuration: %s
18+
19+
. 1 / 1 (100%)
20+
21+
Time: %s, Memory: %s
22+
23+
There were 3 PHPUnit test runner warnings:
24+
25+
1) Function does_not_exist cannot be configured as a deprecation trigger because it is not declared
26+
27+
2) invalid-string cannot be configured as a deprecation trigger because it is not in ClassName::methodName format
28+
29+
3) Method DoesNotExist::doesNotExist cannot be configured as a deprecation trigger because it is not declared
30+
31+
OK, but there were issues!
32+
Tests: 1, Assertions: 1, PHPUnit Warnings: 3.

0 commit comments

Comments
 (0)