From 37d1e0a99bf8d93b1968211658a381783b01f5d9 Mon Sep 17 00:00:00 2001 From: freek Date: Sat, 28 Jan 2017 23:52:38 +0100 Subject: [PATCH] wip --- CHANGELOG.md | 2 +- README.md | 4 ++-- src/Exceptions/InvalidConfiguration.php | 14 ++++++++++++++ src/MailableTestServiceProvider.php | 9 ++++++++- tests/ConfigTest.php | 23 +++++++++++++++++++++++ 5 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 tests/ConfigTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index f0e5a4b..ba57704 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,6 @@ All notable changes to `laravel-mailable-test` will be documented in this file -## 1.0.0 - 201X-XX-XX +## 1.0.0 - 2017-XX-XX - initial release diff --git a/README.md b/README.md index ab78f6a..dfe7d7b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Very short description of the package +# An artisan command to easily test a mailable [![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-mailable-test.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-mailable-test) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) @@ -8,7 +8,7 @@ [![StyleCI](https://styleci.io/repos/80032119/shield?branch=master)](https://styleci.io/repos/80032119) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-mailable-test.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-mailable-test) -This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors. + ## Postcardware diff --git a/src/Exceptions/InvalidConfiguration.php b/src/Exceptions/InvalidConfiguration.php index e69de29..ebe1ff5 100644 --- a/src/Exceptions/InvalidConfiguration.php +++ b/src/Exceptions/InvalidConfiguration.php @@ -0,0 +1,14 @@ +app->bind(ArgumentValueProvider::class, function() { - $faker = \Faker\Factory::create(); + $faker = Factory::create(); return new ArgumentValueProvider($faker); }); diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php new file mode 100644 index 0000000..18f63ef --- /dev/null +++ b/tests/ConfigTest.php @@ -0,0 +1,23 @@ +expectException(InvalidConfiguration::class); + + $this->app['config']->set('laravel-mailable-test.argument_value_provider_class', ''); + + Artisan::call('mail:send-test', [ + 'mailableClass' => TestMailable::class, + 'recipient' => 'test@mail.com' + ]); + } +}