Skip to content

Commit

Permalink
[TASK] Use php attributes in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
derhansen committed Oct 13, 2024
1 parent d3c6081 commit 26ff842
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Tests/Unit/YubikeyAuthServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

use Derhansen\SfYubikey\Authentication\YubikeyAuthService;
use Derhansen\SfYubikey\Service\YubikeyService;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test;
use Psr\Log\NullLogger;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
Expand Down Expand Up @@ -123,10 +125,8 @@ public static function authUserDataProvider(): array
];
}

/**
* @test
* @dataProvider authUserDataProvider
*/
#[Test]
#[DataProvider('authUserDataProvider')]
public function authUserReturnsExpectedReturnCode(
array $userData,
string $yubikeyOtp,
Expand Down
8 changes: 4 additions & 4 deletions Tests/Unit/YubikeyServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*/

use Derhansen\SfYubikey\Service\YubikeyService;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\CMS\Core\Http\Client\GuzzleClientFactory;
use TYPO3\CMS\Core\Http\RequestFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -48,10 +50,8 @@ public static function verifyHmacDataProvider(): array
];
}

/**
* @test
* @dataProvider verifyHmacDataProvider
*/
#[Test]
#[DataProvider('verifyHmacDataProvider')]
public function verifyHmacWorksAsExpected(string $response, string $apiKey, bool $expected): void
{
// Dummy extension settings
Expand Down

0 comments on commit 26ff842

Please sign in to comment.