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

Commit e92b2b6

Browse files
committed
Removing the __call method need to find another way for testing
1 parent cc972ee commit e92b2b6

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
},
2020
"autoload": {
2121
"psr-4": {
22-
"FindBrok\\WatsonTranslate\\": "src/",
23-
"FindBrok\\WatsonTranslate\\Tests\\": "packages/findbrok/laravel-watson-translate/tests/"
22+
"FindBrok\\WatsonTranslate\\": "src/"
2423
}
2524
}
2625
}

src/AbstractTranslator.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,28 +82,6 @@ public function __construct()
8282
$this->setClient();
8383
}
8484

85-
/**
86-
* Calling method that does not exist for testing
87-
*
88-
* @param $method
89-
* @param $parameters
90-
* @return self|null
91-
*/
92-
public function __call($method, $parameters)
93-
{
94-
//Check if this is a pretend method for mocking responses
95-
if(method_exists(new \FindBrok\WatsonTranslate\Tests\Mocks\MockResponses, $method)) {
96-
//Call pretend method
97-
$this->response = call_user_func_array([new \FindBrok\WatsonTranslate\Tests\Mocks\MockResponses, $method], $parameters);
98-
//Add results to class
99-
$this->results = $this->response->getBody()->getContents();
100-
//Return the object
101-
return $this;
102-
}
103-
//Return
104-
return null;
105-
}
106-
10785
/**
10886
* Creates the http client
10987
*

0 commit comments

Comments
 (0)