Skip to content

Commit 96dfcec

Browse files
committed
minor #54785 Remove calls to TestCase::iniSet() and calls to deprecated methods of MockBuilder (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- Remove calls to `TestCase::iniSet()` and calls to deprecated methods of `MockBuilder` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Last round (before new deprecations 🙂). All deprecations [listed here](https://github.com/sebastianbergmann/phpunit/blob/main/DEPRECATIONS.md) should be gone. Commits ------- 4d5065ddd9 Remove calls to `TestCase::iniSet()` and calls to deprecated methods of `MockBuilder`
2 parents 58b1658 + b695405 commit 96dfcec

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

Tests/ApplicationTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
use Symfony\Component\Console\SignalRegistry\SignalRegistry;
4242
use Symfony\Component\Console\Terminal;
4343
use Symfony\Component\Console\Tester\ApplicationTester;
44+
use Symfony\Component\Console\Tests\Fixtures\MockableAppliationWithTerminalWidth;
4445
use Symfony\Component\DependencyInjection\ContainerBuilder;
4546
use Symfony\Component\EventDispatcher\EventDispatcher;
4647
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -876,7 +877,9 @@ public function testRenderExceptionEscapesLines()
876877

877878
public function testRenderExceptionLineBreaks()
878879
{
879-
$application = $this->getMockBuilder(Application::class)->addMethods(['getTerminalWidth'])->getMock();
880+
$application = $this->getMockBuilder(MockableAppliationWithTerminalWidth::class)
881+
->onlyMethods(['getTerminalWidth'])
882+
->getMock();
880883
$application->setAutoExit(false);
881884
$application->expects($this->any())
882885
->method('getTerminalWidth')
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Console\Tests\Fixtures;
13+
14+
use Symfony\Component\Console\Application;
15+
16+
class MockableAppliationWithTerminalWidth extends Application
17+
{
18+
public function getTerminalWidth(): int
19+
{
20+
return 0;
21+
}
22+
}

0 commit comments

Comments
 (0)