File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
tests/Unit/Clients/Concerns/HandlesExceptions Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 7
7
use Mockery ;
8
8
use RuntimeException ;
9
9
use Tests \Unit \Clients \Concerns \HandlesExceptions \Stub ;
10
+ use Tests \Unit \Clients \Concerns \HandlesExceptions \StubException ;
10
11
use Tests \Unit \TestCase ;
11
12
use Xedi \SendGrid \Contracts \Exception as ExceptionContract ;
12
13
use Xedi \SendGrid \Exceptions \Clients \UnknownException ;
@@ -43,16 +44,11 @@ public function handlesClientException()
43
44
*/
44
45
public function handlesUnknownException ()
45
46
{
46
- $ mock_exception = Mockery::mock (
47
- GuzzleException::class,
48
- RuntimeException::class,
49
- ['its not important ' ]
50
- )
51
- ->makePartial ();
47
+ $ stub_exception = new StubException ('it doesn \'t matter ' );
52
48
53
49
$ this ->assertInstanceOf (
54
50
UnknownException::class,
55
- (new Stub ())->handleException ($ mock_exception )
51
+ (new Stub ())->handleException ($ stub_exception )
56
52
);
57
53
}
58
54
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Tests \Unit \Clients \Concerns \HandlesExceptions ;
4
+
5
+ use GuzzleHttp \Exception \GuzzleException ;
6
+ use RuntimeException ;
7
+
8
+ class StubException extends RuntimeException implements GuzzleException
9
+ {
10
+ }
You can’t perform that action at this time.
0 commit comments