mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Adds test cases for loggers and removes use of str_starts_with.
This commit is contained in:
29
tests/Visual/JUnit.php
Normal file
29
tests/Visual/JUnit.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Pest\Logging\JUnit;
|
||||
use PHPUnit\Framework\AssertionFailedError;
|
||||
use PHPUnit\Framework\TestSuite;
|
||||
use PHPUnit\Framework\Warning;
|
||||
|
||||
beforeEach(function () {
|
||||
file_put_contents(__DIR__ . '/junit.html', '');
|
||||
});
|
||||
|
||||
it('is can successfully call all public methods', function () {
|
||||
$junit = new JUnit(__DIR__ . '/junit.html');
|
||||
$junit->startTestSuite(new TestSuite());
|
||||
$junit->startTest($this);
|
||||
$junit->addError($this, new Exception(), 0);
|
||||
$junit->addFailure($this, new AssertionFailedError(), 0);
|
||||
$junit->addWarning($this, new Warning(), 0);
|
||||
$junit->addIncompleteTest($this, new Exception(), 0);
|
||||
$junit->addRiskyTest($this, new Exception(), 0);
|
||||
$junit->addSkippedTest($this, new Exception(), 0);
|
||||
$junit->endTest($this, 0);
|
||||
$junit->endTestSuite(new TestSuite());
|
||||
$this->expectNotToPerformAssertions();
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
unlink(__DIR__ . '/junit.html');
|
||||
});
|
||||
Reference in New Issue
Block a user