Skip to content

Commit

Permalink
Allow overriding specific mocked dependencies
Browse files Browse the repository at this point in the history
This allows you to pass non mocked dependencies, or add mocks that get triggered in the constructor
  • Loading branch information
MarkVaughn committed Dec 14, 2015
1 parent 4afafc5 commit bd68ca3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/SellerLabs/Injected/InjectedTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ protected function getDependencies()
/**
* Make an instance of $this->className
*
* @param array $parameters
*
* @return mixed
*
* @throws Exception
*/
protected function make()
protected function make(array $parameters = [])
{
$dependencies = $this->mockDependencies();
$dependencies = array_merge($dependencies, $parameters);

// Note: Must be defined in trait-using class
$className = $this->className;
Expand Down

0 comments on commit bd68ca3

Please sign in to comment.