Files
kimai/tests/Audit/SensitivePropertyTest.php
Kevin Papst f295d6e30e [3.0] Attributes for change logging (#5763)
* remove Entity directory from excludes, so autoregistration works
* do not register services for interfaces
* move tax class to invoice namespace
* exclude a few classes from service container
* flag SensitiveParameter to prevent logging
* flag SensitiveProperty to prevent logging
* flag Loggable entities for auditing
2026-01-11 11:41:34 +01:00

30 lines
1023 B
PHP

<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Tests\Audit;
use App\Audit\SensitiveProperty;
use PHPUnit\Framework\Attributes\CoversClass;
use Symfony\Component\Form\Test\TypeTestCase;
#[CoversClass(SensitiveProperty::class)]
class SensitivePropertyTest extends TypeTestCase
{
public function testHasCorrectAttribute(): void
{
$sut = new SensitiveProperty();
$reflection = new \ReflectionClass($sut);
/** @var array<\ReflectionAttribute<\Attribute>> $attributes */
$attributes = array_filter($reflection->getAttributes(), fn ($attr) => $attr->getName() === \Attribute::class);
self::assertCount(1, $attributes, 'SensitiveProperty class should have the Attribute attribute');
$attribute = $attributes[0];
self::assertEquals(\Attribute::TARGET_PROPERTY, $attribute->getArguments()[0]);
}
}