Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
feat: wip: add mockery support with try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
ReeceM committed May 6, 2019
1 parent 06530b1 commit 323fed2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/mailEclipse.php
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ static public function handleMailableViewDataArgs($mailable)

$params = $reflection->getConstructor()->getParameters();

$mock = new ReflectionMockery($reflection);
$mocked = new ReflectionMockery($reflection);

DB::beginTransaction();

Expand Down Expand Up @@ -689,10 +689,11 @@ static public function handleMailableViewDataArgs($mailable)


} else {
/**
* For all the things not found, mock it.
*/
$filteredparams[] = $mock->get($arg);
try {
$filteredparams[] = $mocked->get($arg);
} catch (\Exception $e) {
$filteredparams[] = $arg;
}
}

}
Expand Down

0 comments on commit 323fed2

Please sign in to comment.