Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ee71b5
commit 37d1e0a
Showing
5 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Spatie\MailableTest\Exceptions; | ||
|
||
use Exception; | ||
use Spatie\MailableTest\ArgumentValueProvider; | ||
|
||
class InvalidConfiguration extends Exception | ||
{ | ||
public static function invalidValueProviderClass(string $className) | ||
{ | ||
return new static("The `argument_value_provider_class` config value is invalid. Given class `{$className}` does not extend `" . ArgumentValueProvider::class . "`."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Spatie\MailableTest\Test; | ||
|
||
use Mail; | ||
use Artisan; | ||
use Spatie\MailableTest\Exceptions\InvalidConfiguration; | ||
|
||
class ConfigTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_will_throw_an_exception_if_argument_value_provider_class_contains_an_invalid_class() | ||
{ | ||
$this->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' | ||
]); | ||
} | ||
} |