Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Commit

Permalink
Removing the __call method need to find another way for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
percymamedy committed Feb 4, 2016
1 parent cc972ee commit e92b2b6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
},
"autoload": {
"psr-4": {
"FindBrok\\WatsonTranslate\\": "src/",
"FindBrok\\WatsonTranslate\\Tests\\": "packages/findbrok/laravel-watson-translate/tests/"
"FindBrok\\WatsonTranslate\\": "src/"
}
}
}
22 changes: 0 additions & 22 deletions src/AbstractTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,6 @@ public function __construct()
$this->setClient();
}

/**
* Calling method that does not exist for testing
*
* @param $method
* @param $parameters
* @return self|null
*/
public function __call($method, $parameters)
{
//Check if this is a pretend method for mocking responses
if(method_exists(new \FindBrok\WatsonTranslate\Tests\Mocks\MockResponses, $method)) {
//Call pretend method
$this->response = call_user_func_array([new \FindBrok\WatsonTranslate\Tests\Mocks\MockResponses, $method], $parameters);
//Add results to class
$this->results = $this->response->getBody()->getContents();
//Return the object
return $this;
}
//Return
return null;
}

/**
* Creates the http client
*
Expand Down

0 comments on commit e92b2b6

Please sign in to comment.