Skip to content

Commit

Permalink
Merge pull request #32872 from jderusse/player-deprec
Browse files Browse the repository at this point in the history
Fix deprecations in player
  • Loading branch information
jderusse authored Feb 5, 2024
2 parents ad5c145 + b1478e3 commit 5c22960
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
16 changes: 8 additions & 8 deletions Player/Tests/Console/PlayerCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function testNoEndpoint()
public function testErrorInRealWorld()
{
$finder = new PhpExecutableFinder();
$process = new Process([$finder->find(), 'blackfire-player.php', 'run', '../Player/Tests/fixtures-validate/scenario.json', '--json'], __DIR__.'/../../../bin');
$process = new Process([$finder->find(), 'blackfire-player.php', 'run', '../Player/Tests/fixtures-validate/scenario.json', '--no-ansi', '--json'], __DIR__.'/../../../bin');
$process->run();

$expectedOutput = '{
Expand All @@ -229,13 +229,13 @@ public function testErrorInRealWorld()
';

$expectedErrorOutput = <<<EOD
[37;41m [39;49m
[37;41m [ERROR] [39;49m
[37;41m Cannot load file "../Player/Tests/fixtures-validate/scenario.json" because [39;49m
[37;41m it does not have the right extension. Expected "bkf", got "json". [39;49m
[37;41m [39;49m
[37;41m Player documentation at https://blackfire.io/player [39;49m
[37;41m [39;49m
[ERROR]
Cannot load file "../Player/Tests/fixtures-validate/scenario.json" because
it does not have the right extension. Expected "bkf", got "json".
Player documentation at https://blackfire.io/player
EOD;

$oneLineExpected = implode(' ', array_filter(array_map('trim', explode("\n", $expectedErrorOutput))));
Expand Down
12 changes: 6 additions & 6 deletions Player/Tests/Console/ValidateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ public function providePlayerTests()
public function testValidate($file, $outputPath, $errorOutputPath, $jsonOutputPath, $jsonErrorOutputPath)
{
$finder = new PhpExecutableFinder();
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', $file], __DIR__.'/../../../bin');
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', '--no-ansi', $file], __DIR__.'/../../../bin');
$process->run();

$this->assertStringMatchesFormat(file_get_contents($outputPath), $process->getOutput());
$this->assertStringMatchesFormat(file_get_contents($errorOutputPath), $process->getErrorOutput());

$finder = new PhpExecutableFinder();
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', $file, '--json'], __DIR__.'/../../../bin');
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', '--no-ansi', $file, '--json'], __DIR__.'/../../../bin');
$process->run();

$this->assertStringMatchesFormat(file_get_contents($jsonOutputPath), $process->getOutput());
Expand All @@ -63,7 +63,7 @@ public function testValidate($file, $outputPath, $errorOutputPath, $jsonOutputPa
public function testErrorInRealWorld()
{
$finder = new PhpExecutableFinder();
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', '../Player/Tests/fixtures-validate/scenario.json', '--json'], __DIR__.'/../../../bin');
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', '--no-ansi', '../Player/Tests/fixtures-validate/scenario.json', '--json'], __DIR__.'/../../../bin');
$process->run();

$expectedOutput = '{
Expand All @@ -84,15 +84,15 @@ public function testErrorInRealWorld()
public function testValidateStdIn($file, $outputPath, $errorOutputPath, $jsonOutputPath, $jsonErrorOutputPath)
{
$finder = new PhpExecutableFinder();
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', '--json'], __DIR__.'/../../../bin');
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', '--no-ansi', '--json'], __DIR__.'/../../../bin');
$process->setInput(file_get_contents($file));
$process->run();

$this->assertTrue($process->isSuccessful());
$this->assertStringMatchesFormat(file_get_contents($jsonOutputPath), $process->getOutput());
$this->assertStringMatchesFormat(file_get_contents($jsonErrorOutputPath), $process->getErrorOutput());

$process = new Process([$finder->find(), 'blackfire-player.php', 'validate'], __DIR__.'/../../../bin');
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', '--no-ansi'], __DIR__.'/../../../bin');
$process->setInput(file_get_contents($file));
$process->run();

Expand All @@ -103,7 +103,7 @@ public function testValidateStdIn($file, $outputPath, $errorOutputPath, $jsonOut
public function testErrorStdIn()
{
$finder = new PhpExecutableFinder();
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', '--json'], __DIR__.'/../../../bin');
$process = new Process([$finder->find(), 'blackfire-player.php', 'validate', '--no-ansi', '--json'], __DIR__.'/../../../bin');
$process->setInput('papilou!');
$process->run();

Expand Down
4 changes: 2 additions & 2 deletions Player/Tests/fixtures-validate/simple-invalid/output-err.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.

2 changes: 1 addition & 1 deletion Player/Tests/fixtures-validate/simple-invalid/output.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
The scenarios are not valid:
The scenarios are not valid:
- Unknown keyword "vit" %s line 4.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The scenarios are valid.
The scenarios are valid.

 ! [NOTE] You need to define the following variables using the `--variable` 
 ! option: 
 ! 
 ! expected_status 
! [NOTE] You need to define the following variables using the `--variable`
! option:
!
! expected_status

4 changes: 2 additions & 2 deletions Player/Tests/fixtures-validate/simple/output-err.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.

4 changes: 2 additions & 2 deletions Player/Tests/fixtures-validate/simple/output-json-err.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.
You should use the Blackfire Player using the Docker release.
Blackfire Player v3 will not provide support other than the Docker release, see https://docs.blackfire.io/builds-cookbooks/player#usage.

2 changes: 1 addition & 1 deletion Player/Tests/fixtures-validate/simple/output.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The scenarios are valid.
The scenarios are valid.

0 comments on commit 5c22960

Please sign in to comment.