Skip to content

Commit

Permalink
Drop support for PHP 8.0, Laravel 9
Browse files Browse the repository at this point in the history
  • Loading branch information
iv-craig committed Apr 2, 2024
1 parent e3753cc commit e6b5786
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.0, 8.1, 8.2, 8.3]
php: [8.1, 8.2, 8.3]

name: Tests on PHP ${{ matrix.php }} - ${{ matrix.stability }}

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
}
],
"require": {
"php": "^8.0",
"illuminate/notifications": "^9.0|^10.0|^11.0",
"illuminate/support": "^9.0|^10.0|^11.0",
"php": "^8.1",
"illuminate/notifications": "^10.0|^11.0",
"illuminate/support": "^10.0|^11.0",
"interfax/interfax": "^2.0",
"psr/log": "^2.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"mpdf/mpdf": "^8.0",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"orchestra/testbench": "^8.0|^9.0",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.5.10|^10.0|^11.0"
"phpunit/phpunit": "^10.0|^11.0"
},
"autoload": {
"psr-4": {
Expand Down
16 changes: 5 additions & 11 deletions tests/CouldNotSendNotificationExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace NotificationChannels\Interfax\Test;

use PHPUnit\Framework\Attributes\Test;
use NotificationChannels\Interfax\Exceptions\CouldNotSendNotification;
use NotificationChannels\Interfax\InterfaxMessage;

Expand All @@ -20,8 +19,7 @@ public function setUp(): void
->file('test-file.pdf');
}

#[Test]
public function it_can_get_the_exception_user()
public function test_get_the_exception_user()
{
$exception = CouldNotSendNotification::serviceRespondedWithAnError($this->message, [
'status' => 500,
Expand All @@ -31,8 +29,7 @@ public function it_can_get_the_exception_user()
$this->assertInstanceOf(TestNotifiable::class, $exception->getUser());
}

#[Test]
public function it_can_get_the_exception_metadata()
public function test_get_the_exception_metadata()
{
$exception = CouldNotSendNotification::serviceRespondedWithAnError($this->message, [
'status' => 500,
Expand All @@ -42,8 +39,7 @@ public function it_can_get_the_exception_metadata()
$this->assertSame('Some sample metadata.', $exception->getMetadata()['key']);
}

#[Test]
public function it_can_get_the_default_exception_message()
public function test_get_the_default_exception_message()
{
$exception = CouldNotSendNotification::serviceRespondedWithAnError($this->message, [
'status' => 500,
Expand All @@ -53,8 +49,7 @@ public function it_can_get_the_default_exception_message()
$this->assertSame('The fax failed to send via InterFAX.', $exception->getMessage());
}

#[Test]
public function it_can_get_a_custom_exception_message()
public function test_get_a_custom_exception_message()
{
$exceptionMessage = 'This is a test.';

Expand All @@ -66,8 +61,7 @@ public function it_can_get_a_custom_exception_message()
$this->assertSame($exceptionMessage, $exception->getMessage());
}

#[Test]
public function it_can_get_the_exception_attributes()
public function test_get_the_exception_attributes()
{
$exception = CouldNotSendNotification::serviceRespondedWithAnError($this->message, [
'status' => 500,
Expand Down
22 changes: 7 additions & 15 deletions tests/InterfaxChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace NotificationChannels\Interfax\Test;

use Illuminate\Notifications\Notification;
use PHPUnit\Framework\Attributes\Test;
use Interfax\Client as InterfaxClient;
use Interfax\Resource as InterfaxResource;
use Mockery;
Expand Down Expand Up @@ -36,8 +35,7 @@ public function setUp(): void
$this->channel = new InterfaxChannel($this->interfax);
}

#[Test]
public function it_can_send_notification_with_a_single_file()
public function test_send_notification_with_a_single_file()
{
$this->interfax->expects('deliver')
->once()
Expand All @@ -56,8 +54,7 @@ public function it_can_send_notification_with_a_single_file()
$this->channel->send(new TestNotifiable, new TestNotificationWithSingleFile);
}

#[Test]
public function it_can_send_notification_with_files()
public function test_send_notification_with_files()
{
$this->interfax->expects('deliver')
->once()
Expand All @@ -82,8 +79,7 @@ public function it_can_send_notification_with_files()
$this->channel->send(new TestNotifiable, new TestNotificationWithFiles);
}

#[Test]
public function it_can_send_notification_pdf_as_stream()
public function test_send_notification_pdf_as_stream()
{
$this->interfax->expects('deliver')
->with(Mockery::on(function ($output) {
Expand Down Expand Up @@ -111,8 +107,7 @@ public function it_can_send_notification_pdf_as_stream()
$this->channel->send(new TestNotifiable, new TestNotificationAsStreamPdf);
}

#[Test]
public function it_can_send_notification_html_as_stream()
public function test_send_notification_html_as_stream()
{
$filename = 'test-file.html';
$this->addFile($filename);
Expand Down Expand Up @@ -145,14 +140,12 @@ public function it_can_send_notification_html_as_stream()
$this->channel->send(new TestNotifiable, new TestNotificationAsStreamHtml);
}

#[Test]
public function it_can_return_early_when_no_fax_number_provided()
public function test_return_early_when_no_fax_number_provided()
{
$this->assertNull($this->channel->send(new TestNotifiableNotSendable, new TestNotificationWithFiles));
}

#[Test]
public function it_can_refresh_the_file_response()
public function test_refresh_the_file_response()
{
$this->resource
->expects('refresh')
Expand All @@ -170,8 +163,7 @@ public function it_can_refresh_the_file_response()
$this->channel->send(new TestNotifiable, new TestNotificationWithRefresh);
}

#[Test]
public function it_can_throw_the_exception()
public function test_throw_the_exception()
{
$this->expectException(CouldNotSendNotification::class);

Expand Down
19 changes: 6 additions & 13 deletions tests/InterfaxMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

namespace NotificationChannels\Interfax\Test;

use PHPUnit\Framework\Attributes\Test;
use NotificationChannels\Interfax\InterfaxMessage;

class InterfaxMessageTest extends TestCase
{
#[Test]
public function it_should_check_the_status_via_refresh()
public function test_check_the_status_via_refresh()
{
$message = (new InterfaxMessage)
->checkStatus()
Expand All @@ -18,8 +16,7 @@ public function it_should_check_the_status_via_refresh()
$this->assertTrue($message->shouldCheckStatus());
}

#[Test]
public function it_should_not_check_the_status_via_refresh_manual()
public function test_not_check_the_status_via_refresh_manual()
{
$message = (new InterfaxMessage)
->checkStatus(false)
Expand All @@ -29,8 +26,7 @@ public function it_should_not_check_the_status_via_refresh_manual()
$this->assertFalse($message->shouldCheckStatus());
}

#[Test]
public function it_should_not_check_the_status_via_refresh_default()
public function test_not_check_the_status_via_refresh_default()
{
$message = (new InterfaxMessage)
->user(new TestNotifiable)
Expand All @@ -39,8 +35,7 @@ public function it_should_not_check_the_status_via_refresh_default()
$this->assertFalse($message->shouldCheckStatus());
}

#[Test]
public function it_should_set_the_file_chunk_size_filename()
public function test_set_the_file_chunk_size_filename()
{
$this->increaseChunkSize();

Expand All @@ -54,8 +49,7 @@ public function it_should_set_the_file_chunk_size_filename()
$this->assertSame($this->chunkSize, $this->getChunkSize($delivery));
}

#[Test]
public function it_should_set_the_file_chunk_size_file_array()
public function test_set_the_file_chunk_size_file_array()
{
$this->increaseChunkSize();

Expand All @@ -69,8 +63,7 @@ public function it_should_set_the_file_chunk_size_file_array()
$this->assertSame($this->chunkSize, $this->getChunkSize($delivery));
}

#[Test]
public function it_should_set_the_file_chunk_size_file_object()
public function test_set_the_file_chunk_size_file_object()
{
$this->increaseChunkSize();
$client = new \Interfax\Client;
Expand Down

0 comments on commit e6b5786

Please sign in to comment.