Skip to content

Commit

Permalink
Merge pull request #55 from deguif/phpunit-static-data-providers
Browse files Browse the repository at this point in the history
Use phpunit static data provider
  • Loading branch information
mcfedr authored Feb 5, 2025
2 parents 53ae321 + 1ac01b8 commit cfa7033
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/Mcfedr/AwsPushBundle/Tests/Message/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testTrimMessage(Message $message): void
$this->assertNotEmpty(json_encode($message));
}

public function tooLongMessage(): array
public static function tooLongMessage(): array
{
$adm = new Message(Lorem::text(7000));
$adm->setPlatforms([Message::PLATFORM_ADM]);
Expand Down Expand Up @@ -66,7 +66,7 @@ public function testShortMessage(Message $message): void
$this->assertNotEmpty(json_encode($message));
}

public function shortMessage(): array
public static function shortMessage(): array
{
$adm = new Message(Lorem::text(5050));
$adm->setPlatforms([Message::PLATFORM_ADM]);
Expand Down Expand Up @@ -187,7 +187,7 @@ public function testTextMessageStructure(string $text): void
$this->assertEquals($text, $fcmData['notification']['body'], 'FCM.notification.body should be the text of the message');
}

public function text(): array
public static function text(): array
{
return [
[Lorem::text(1000)],
Expand Down Expand Up @@ -272,7 +272,7 @@ public function testLocalizedMessageStructure(string $text, string $key, array $
$this->assertEquals($args, $fcmData['notification']['body_loc_args'], 'FCM.notification.body_loc_args should be the text of the message');
}

public function localized(): array
public static function localized(): array
{
return [
[
Expand Down Expand Up @@ -354,7 +354,7 @@ public function testLocalizedNoArgsMessageStructure(string $text, string $key):
$this->assertEquals($key, $fcmData['notification']['body_loc_key'], 'FCM.notification.body_loc_key should be the text of the message');
}

public function localizedNoArgs(): array
public static function localizedNoArgs(): array
{
return [
[
Expand Down Expand Up @@ -453,7 +453,7 @@ public function testTitleMessageStructure(string $title, string $subtitle): void
$this->assertEquals($title, $fcmData['notification']['title'], 'FCM.notification.title should be the text of the message');
}

public function title(): array
public static function title(): array
{
return [
[
Expand Down Expand Up @@ -563,7 +563,7 @@ public function testLocalizedTitleMessageStructure(string $titleKey, array $titl
$this->assertEquals($titleArgs, $fcmData['notification']['title_loc_args'], 'FCM.data.title_loc_args should be the text of the message');
}

public function localizedTitle(): array
public static function localizedTitle(): array
{
return [
[
Expand Down Expand Up @@ -653,7 +653,7 @@ public function testCategoryMessageStructure(string $category): void
$this->assertEquals($category, $fcmData['notification']['android_channel_id'], 'FCM.notification.android_channel_id should be the text of the message');
}

public function category(): array
public static function category(): array
{
return [
[
Expand Down Expand Up @@ -739,7 +739,7 @@ public function testBadgeMessageStructure(int $badge): void
$this->assertCount(0, $fcmData['data']);
}

public function badge(): array
public static function badge(): array
{
return [
[
Expand Down Expand Up @@ -828,7 +828,7 @@ public function testSoundMessageStructure(string $sound): void
$this->assertEquals($sound, $fcmData['notification']['sound'], 'FCM.notification.sound should be the text of the message');
}

public function sound(): array
public static function sound(): array
{
return [
[
Expand Down Expand Up @@ -988,7 +988,7 @@ public function testThreadIdMessageStructure(string $threadId): void
$this->assertCount(0, $fcmData['data']);
}

public function threadId(): array
public static function threadId(): array
{
return [
[
Expand Down Expand Up @@ -1592,7 +1592,7 @@ public function testCollapseKeyMessageStructure(string $collapseKey): void
$this->assertEquals($collapseKey, $fcmData['collapse_key']);
}

public function collapseKey(): array
public static function collapseKey(): array
{
return [
[Lorem::text(1000)],
Expand Down Expand Up @@ -1641,7 +1641,7 @@ public function testTtl(int $ttl): void
$this->assertEquals($ttl, $admData['expiresAfter']);
}

public function ttl(): array
public static function ttl(): array
{
return [
[Base::numberBetween(60, 2678400)],
Expand Down

0 comments on commit cfa7033

Please sign in to comment.