8000 hyperlink cli descr tests · symfony/symfony@796ca6b · GitHub
[go: up one dir, main page]

Skip to content

Commit 796ca6b

Browse files
committed
hyperlink cli descr tests
1 parent 8216fdc commit 796ca6b

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

src/Symfony/Component/VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\VarDumper\Tests\Command\Descriptor;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
1516
use Symfony\Component\Console\Output\BufferedOutput;
1617
use Symfony\Component\VarDumper\Cloner\Data;
1718
use Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor;
@@ -35,9 +36,10 @@ public static function tearDownAfterClass()
3536
/**
3637
* @dataProvider provideContext
3738
*/
38-
public function testDescribe(array $context, string $expectedOutput)
39+
public function testDescribe(array $context, string $expectedOutput, bool $decorated = false)
3940
{
4041
$output = new BufferedOutput();
42+
$output->setDecorated($decorated);
4143
$descriptor = new CliDescriptor(new CliDumper(function ($s) {
4244
return $s;
4345
}));
@@ -79,7 +81,20 @@ public function provideContext()
7981
'file_link' => 'phpstorm://open?file=/Users/ogi/symfony/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php&line=30',
8082
)
8183
),
82-
<<<TXT
84+
method_exists(OutputFormatterStyle::class, 'setHref') ?
85+
<<<TXT
86+
Received from client #1
87+
-----------------------
88+
89+
-------- --------------------------------------------------------------------------------
90+
date Fri, 14 Dec 2018 16:17:48 +0000
91+
source CliDescriptorTest.php on line 30
92+
file src/Symfony/Component/VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php
93+
-------- --------------------------------------------------------------------------------
94+
95+
TXT
96+
:
97+
<<<TXT
8398
Received from client #1
8499
-----------------------
85100
@@ -94,6 +109,25 @@ public function provideContext()
94109
TXT
95110
);
96111

112+
if (method_exists(OutputFormatterStyle::class, 'setHref')) {
113+
yield 'source with hyperlink' => array(
114+
array(
115+
'source' => array(
116+
'name' => 'CliDescriptorTest.php',
117+
'line' => 30,
118+
'file_relative' => 'src/Symfony/Component/VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php',
119+
'file_link' => 'phpstorm://open?file=/Users/ogi/symfony/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php&line=30',
120+
)
121+
),
122+
<<<TXT
123+
%A
124+
source \033]8;;phpstorm://open?file=/Users/ogi/symfony/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php&line=30\033\CliDescriptorTest.php on line 30\033]8;;\033%A
125+
%A
126+
TXT
127+
, true
128+
);
129+
}
130+
97131
yield 'cli' => array(
98132
array(
99133
'cli' => array(

0 commit comments

Comments
 (0)
0