Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Migrate phpunit metadata to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Apr 30, 2024
1 parent 82a5736 commit 392546c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/src/Controller/OTPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use DateTimeImmutable;
use DateTimeInterface;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use RuntimeException;
use SimpleSAML\{Auth, Configuration, Error, Logger, Session, Utils};
Expand All @@ -15,9 +16,8 @@

/**
* Set of tests for the controllers in the "cmdotcom" module.
*
* @covers \SimpleSAML\Module\cmdotcom\Controller\OTP
*/
#[CoversClass(Controller\OTP::class)]
class OTPTest extends TestCase
{
/** @var string|null */
Expand Down
11 changes: 5 additions & 6 deletions tests/src/Utils/PhoneNumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
namespace SimpleSAML\Test\Module\cmdotcom\Utils;

use libphonenumber\NumberParseException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use SimpleSAML\Module\cmdotcom\Utils\PhoneNumber as PhoneNumberUtils;

/**
* Set of tests for the PhoneNumber utilities in the "cmdotcom" module.
*
* @covers \SimpleSAML\Module\cmdotcom\Utils\PhoneNumber
*/
#[CoversClass(PhoneNumberUtils::class)]
class PhoneNumberTest extends TestCase
{
/** @var \SimpleSAML\Module\cmdotcom\Utils\PhoneNumber */
Expand All @@ -31,11 +32,10 @@ public static function setUpBeforeClass(): void


/**
* @dataProvider validPhoneNumberProvider
*
* @param string $input
* @param string $output
*/
#[DataProvider('validPhoneNumberProvider')]
public function testValidPhoneNumberIsSanitizedToE164Format(string $input, string $output): void
{
$result = self::$phoneNumberUtils->sanitizePhoneNumber($input);
Expand All @@ -44,10 +44,9 @@ public function testValidPhoneNumberIsSanitizedToE164Format(string $input, strin


/**
* @dataProvider invalidPhoneNumberProvider
*
* @param string $input
*/
#[DataProvider('invalidPhoneNumberProvider')]
public function testInvalidPhoneNumberThrowsAnException(string $input): void
{
$this->expectException(NumberParseException::class);
Expand Down

1 comment on commit 392546c

@tvdijen
Copy link
Owner Author

@tvdijen tvdijen commented on 392546c May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jhcloos Sorry to bother you, but I couldn't help but notice that you are watching this repo. Are you using this?
I'm no longer using this and would like to archive this module if no one else is using it.
Thank you for getting back!

Please sign in to comment.