Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to PHPUnit 10 attributes instead of PHPDoc #369

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion test/integration/Writer/MultiplePdfFilesWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Roave\DocbookToolIntegrationTest\Writer;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Roave\DocbookTool\DocbookPage;
Expand All @@ -13,7 +14,7 @@
use function file_exists;
use function unlink;

/** @covers \Roave\DocbookTool\Writer\MultiplePdfFilesWriter */
#[CoversClass(MultiplePdfFilesWriter::class)]
final class MultiplePdfFilesWriterTest extends TestCase
{
private const OUTPUT_PDF_PATH = __DIR__;
Expand Down
3 changes: 2 additions & 1 deletion test/unit/DocbookPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

namespace Roave\DocbookToolUnitTest;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Roave\DocbookTool\DocbookPage;
use RuntimeException;

/** @covers \Roave\DocbookTool\DocbookPage */
#[CoversClass(DocbookPage::class)]
final class DocbookPageTest extends TestCase
{
public function testEmptyPageThrowsExceptionWhenFetchingTitle(): void
Expand Down
7 changes: 4 additions & 3 deletions test/unit/Formatter/ExtractFrontMatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@

namespace Roave\DocbookToolUnitTest\Formatter;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Roave\DocbookTool\DocbookPage;
use Roave\DocbookTool\Formatter\AggregatePageFormatter;
use Roave\DocbookTool\Formatter\ExtractFrontMatter;
use Roave\DocbookTool\Formatter\MarkdownToHtml;

/** @covers \Roave\DocbookTool\Formatter\ExtractFrontMatter */
#[CoversClass(ExtractFrontMatter::class)]
final class ExtractFrontMatterTest extends TestCase
{
/** @return array<string,array{content:non-empty-string,expectedTitle:non-empty-string}> */
Expand Down Expand Up @@ -75,9 +77,8 @@ public static function titleProvider(): array
/**
* @param non-empty-string $content
* @param non-empty-string $expectedTitle
*
* @dataProvider titleProvider
*/
#[DataProvider('titleProvider')]
public function testTitleCanBeSetInFrontMatter(string $content, string $expectedTitle): void
{
$logger = new NullLogger();
Expand Down
3 changes: 2 additions & 1 deletion test/unit/Formatter/InlineCodeFromFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

namespace Roave\DocbookToolUnitTest\Formatter;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Roave\DocbookTool\DocbookPage;
use Roave\DocbookTool\Formatter\InlineCodeFromFile;

/** @covers \Roave\DocbookTool\Formatter\InlineCodeFromFile */
#[CoversClass(InlineCodeFromFile::class)]
final class InlineCodeFromFileTest extends TestCase
{
public function testExternalSourceCodeIsInlined(): void
Expand Down
7 changes: 4 additions & 3 deletions test/unit/Formatter/InlineExternalImagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Roave\DocbookToolUnitTest\Formatter;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Roave\DocbookTool\DocbookPage;
Expand All @@ -13,7 +15,7 @@

use function sprintf;

/** @covers \Roave\DocbookTool\Formatter\InlineExternalImages */
#[CoversClass(InlineExternalImages::class)]
final class InlineExternalImagesTest extends TestCase
{
private const MIME_JPG = 'image/jpeg';
Expand Down Expand Up @@ -61,9 +63,8 @@ public static function contentAndImagePathProvider(): array
* @param non-empty-string $contentPath
* @param non-empty-string $imagePath
* @param non-empty-string $expectedMimeType
*
* @dataProvider contentAndImagePathProvider
*/
#[DataProvider('contentAndImagePathProvider')]
public function testExternalImagesAreInlined(string $contentPath, string $imagePath, string $expectedMimeType): void
{
$markdown = <<<MD
Expand Down
3 changes: 2 additions & 1 deletion test/unit/Writer/ConfluenceWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use GuzzleHttp\Middleware;
use GuzzleHttp\Psr7\MultipartStream;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\RequestInterface;
use Psr\Log\LoggerInterface;
Expand All @@ -26,7 +27,7 @@

use const JSON_THROW_ON_ERROR;

/** @covers \Roave\DocbookTool\Writer\ConfluenceWriter */
#[CoversClass(ConfluenceWriter::class)]
final class ConfluenceWriterTest extends TestCase
{
// Indices for Guzzle transactions, as MockHandler only likes integer keys
Expand Down
Loading