Skip to content

Commit

Permalink
add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkSide666 authored and sebastianbergmann committed Jun 15, 2024
1 parent 71121db commit f32fd1c
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/end-to-end/regression/5822.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--TEST--
https://github.com/sebastianbergmann/phpunit/pull/5592
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--configuration';
$_SERVER['argv'][] = __DIR__ . '/5822/phpunit.xml';

require_once __DIR__ . '/../../bootstrap.php';
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s
Configuration: %s

D 1 / 1 (100%)

Time: %s, Memory: %s

OK, but there were issues!
Tests: 1, Assertions: 1, Deprecations: 1.
15 changes: 15 additions & 0 deletions tests/end-to-end/regression/5822/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../phpunit.xsd">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<source>
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
4 changes: 4 additions & 0 deletions tests/end-to-end/regression/5822/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
31 changes: 31 additions & 0 deletions tests/end-to-end/regression/5822/tests/Issue5822Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TestFixture\Issue5822;

use PHPUnit\Framework\TestCase;

class Issue5822Test extends TestCase
{
public function testDebugBacktrace()
{
$this->callUserFuncExample();
$this->assertTrue(true);
}

private function callUserFuncExample(): void
{
call_user_func([$this, 'exampleCallback']);
}

private function exampleCallback(): void
{
trigger_error('My Deprecation Error', \E_USER_DEPRECATED);
}
}

0 comments on commit f32fd1c

Please sign in to comment.