self::
assertTrue(GithubActionReporter::
isGithubActionEnvironment());
} finally { putenv('GITHUB_ACTIONS'.
($prev ? "=
$prev" : ''
));
} } /**
* @dataProvider annotationsFormatProvider
*/
public function testAnnotationsFormat(string
$type, string
$message, string
$file = null, int
$line = null, int
$col = null, string
$expected) { $reporter =
new GithubActionReporter($buffer =
new BufferedOutput());
$reporter->
{$type}($message,
$file,
$line,
$col);
self::
assertSame($expected.\PHP_EOL,
$buffer->
fetch());
} public static function annotationsFormatProvider(): iterable
{ yield 'warning' =>
['warning', 'A warning', null, null, null, '::warning::A warning'
];
yield 'error' =>
['error', 'An error', null, null, null, '::error::An error'
];
yield 'debug' =>
['debug', 'A debug log', null, null, null, '::debug::A debug log'
];