Skip to content

test: Use PHPUnit attributes for Kirby\Template #7200

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

Draft
wants to merge 1 commit into
base: v5/develop
Choose a base branch
from

Conversation

distantnative
Copy link
Member

@distantnative distantnative commented May 11, 2025

Description

Summary of changes

  • Use CoversClass and DataProvider PHPUnit PHP attributes instead of DocBlock annotations in the Kirby\Template package

Reasoning

Switching over package by package (or smaller units) to see how the code coverage is affected.

Additional context

Put this for the 5.1.0 milestone to not further add to the list of the 5.0.0 milestone as we want to close this very soon.

The changes were created automatically with Rector:

<?php

declare(strict_types = 1);

use Rector\Config\RectorConfig;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\CoversAnnotationWithValueToAttributeRector;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;

return RectorConfig::configure()
	->withPaths([
		__DIR__ . '/tests/Template',
	])
	->withRules([
		CoversAnnotationWithValueToAttributeRector::class,
		DataProviderAnnotationToAttributeRector::class,
		AddVoidReturnTypeWhereNoReturnRector::class
	])
	->withImportNames();

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

@distantnative distantnative self-assigned this May 11, 2025
@distantnative distantnative added this to the 5.1.0 milestone May 11, 2025
@distantnative distantnative force-pushed the v5/build/test-template-pkg-phpunit-attributes branch from 73749c1 to 2a3655f Compare May 11, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant