Guest User

Untitled

a guest
Jan 4th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. namespace AppServices;
  2. use Appaaaaaa;
  3.  
  4. class ApiGatewayService
  5. {
  6. protected $aa;
  7.  
  8. public function __construct()
  9. {
  10.  
  11. }
  12. public function aa()
  13. {
  14. $this->aa = new aa();//<<< THIS LINE
  15. return $this->aa->aa();
  16. }
  17. }
  18.  
  19. namespace Appaaaa;
  20.  
  21. class aa
  22. {
  23. public function aa()
  24. {
  25. return 'original';
  26. }
  27. }
  28.  
  29. public function test_aa()
  30. {
  31. $aa = Mockery::mock('overload:'.aa::class);
  32. $aa->shouldReceive('aa')->andReturn('mocked');
  33. $apiGatewayService = new ApiGatewayService();
  34. $apiGatewayService->aa(); //return "mocked"
  35. }
Add Comment
Please, Sign In to add comment