Skip to content

Commit 82523e5

Browse files
committed
add more presenter tests
1 parent 422f29a commit 82523e5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/PresentersTest.php

+15
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@
4040
->toEqual('en');
4141
})->group('Presenter Implementation');
4242

43+
it('throws an exception if the presenter type does not exists', function () {
44+
$user = new User([
45+
'first_name' => 'John',
46+
'last_name' => 'Doe',
47+
'email' => '[email protected]',
48+
'password' => '123',
49+
]);
50+
51+
$user->present('profile')->lang;
52+
53+
})->throws(
54+
Coderflex\LaravelPresenter\Exceptions\PresenterException::class,
55+
'Presenter not found'
56+
)->group('Presenter Implementation');
57+
4358
it('should implements CanPresent Interface', function () {
4459
$post = new Post([
4560
'title' => 'a title for a post',

0 commit comments

Comments
 (0)