Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace AppServices;
- use Appaaaaaa;
- class ApiGatewayService
- {
- protected $aa;
- public function __construct()
- {
- }
- public function aa()
- {
- $this->aa = new aa();//<<< THIS LINE
- return $this->aa->aa();
- }
- }
- namespace Appaaaa;
- class aa
- {
- public function aa()
- {
- return 'original';
- }
- }
- public function test_aa()
- {
- $aa = Mockery::mock('overload:'.aa::class);
- $aa->shouldReceive('aa')->andReturn('mocked');
- $apiGatewayService = new ApiGatewayService();
- $apiGatewayService->aa(); //return "mocked"
- }
Add Comment
Please, Sign In to add comment