Skip to content

Commit

Permalink
fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abdumu committed Jul 6, 2024
1 parent 269220a commit 620f4db
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 53 deletions.
26 changes: 3 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
on: [push, pull_request]

jobs:
tests:
Expand All @@ -13,25 +9,9 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.4, 8.0, 8.1, '8.2']
laravel: ['7.*', '8.*', '9.*', '10.*', '11.*']
php: [8.1, 8.2, 8.3]
laravel: ['10.*', '11.*']
exclude:
- php: 7.4
laravel: 10.*
- php: 8.0
laravel: 10.*
- php: 7.4
laravel: 9.*
- php: 8.0
laravel: 7.*
- php: 8.1
laravel: 7.*
- php: 8.1
laravel: 8.*
- laravel: 11.*
php: 7.4
- laravel: 11.*
php: 8.0
- laravel: 11.*
php: 8.1

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
composer.lock
/phpunit.xml
.phpunit.result.cache
/.idea
/.idea
.phpunit.cache/test-results
36 changes: 12 additions & 24 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="true"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
verbose="true"
>
<testsuites>
<testsuite name="Discord Channel Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" beStrictAboutTestsThatDoNotTestAnything="true" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Discord Channel Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
10 changes: 5 additions & 5 deletions tests/NotificationDiscordChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public function testCorrectPayloadIsSentToDiscord(Notification $notification, st
$this->discordChannel->send(new NotificationDiscordChannelTestNotifiable, $notification);
}

public function payloadDataProvider()
public static function payloadDataProvider()
{
return [
'payloadWithDiscord' => $this->getPayloadWithDiscord(),
'payloadWithSlackMessage' => $this->getPayloadWithSlackMessage(),
'payloadWithDiscord' => self::getPayloadWithDiscord(),
'payloadWithSlackMessage' => self::getPayloadWithSlackMessage(),
];
}

private function getPayloadWithSlackMessage()
private static function getPayloadWithSlackMessage()
{
return [
new NotificationDiscordChannelTestNotificationWithSlack,
Expand Down Expand Up @@ -102,7 +102,7 @@ private function getPayloadWithSlackMessage()
];
}

private function getPayloadWithDiscord()
private static function getPayloadWithDiscord()
{
return [
new NotificationDiscordChannelTestNotificationWithDiscordMessage,
Expand Down

0 comments on commit 620f4db

Please sign in to comment.