Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on: [push, pull_request]

jobs:
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: [8.1, 8.2, 8.3, 8.4]
composer_flags: ['', '--prefer-lowest']

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: xdebug

- name: Install dependencies
uses: php-actions/composer@v5
with:
php_version: ${{ matrix.php_version }}
args: ${{ matrix.composer_flags }}
command: update

- name: Run tests
run: ./vendor/bin/phpunit --coverage-clover ./tests/logs/clover.xml
env:
XDEBUG_MODE: coverage

- name: Run Codesniffer
run: vendor/bin/phpcs --standard=PSR2 ./src

# - name: Submit coverage to Coveralls
# # We use php-coveralls library for this, as the official Coveralls GitHub Action lacks support for clover reports:
# # https://github.com/coverallsapp/github-action/issues/15
# env:
# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_PARALLEL: true
# COVERALLS_FLAG_NAME: ${{ github.job }}-PHP-${{ matrix.php_version }} ${{ matrix.composer_flags }}
# run: |
# composer global require php-coveralls/php-coveralls
# ~/.composer/vendor/bin/php-coveralls -v
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "rareloop/lumberjack-email",
"require": {
"rareloop/lumberjack-core": "^5.0.0||^6.0.0||^7.0.0"
"rareloop/lumberjack-core": "^8.0.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"mockery/mockery": "^1.0.0",
"brain/monkey": "^2.0.2",
"satooshi/php-coveralls": "^1.0",
"squizlabs/php_codesniffer": "^3.2"
"phpunit/phpunit": "^9.6.29",
"mockery/mockery": "^1.6.12",
"brain/monkey": "^2.6.2",
"antecedent/patchwork": "^2.2.3",
"php-coveralls/php-coveralls": "^2.8",
"squizlabs/php_codesniffer": "^3.13.4"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/EmailServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private function setupSMTP(Config $config)

private function addWpMailErrorHandler()
{
// add the action
// add the action
add_action('wp_mail_failed', function ($error) {
Log::error('Error sending email via `wp_mail()`');
Log::error(print_r($error, true));
Expand Down
2 changes: 1 addition & 1 deletion src/Facades/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rareloop\Lumberjack\Email\Facades;

use Blast\Facades\AbstractFacade;
use Rareloop\Lumberjack\Facades\AbstractFacade;

class Email extends AbstractFacade
{
Expand Down
12 changes: 5 additions & 7 deletions tests/Unit/EmailServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@

namespace Rareloop\Lumberjack\Email\Test;

use Blast\Facades\FacadeFactory;
use Mockery;
use Brain\Monkey;
use Brain\Monkey\Functions;
use Mockery;
use PHPUnit\Framework\TestCase;
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Email\Email;
use Rareloop\Lumberjack\FacadeFactory;
use Rareloop\Lumberjack\Email\EmailServiceProvider;
use Rareloop\Lumberjack\Email\Facades\Email as EmailFacade;
use Rareloop\Lumberjack\Http\Lumberjack;

class EmailServiceProviderTest extends TestCase
{
use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;

public function setUp()
public function setUp(): void
{
parent::setUp();
Monkey\setUp();
}

public function tearDown()
public function tearDown(): void
{
parent::tearDown();
Monkey\tearDown();
Expand Down
Loading