Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3.  
  4. class ExceptionTestCase extends TestCase
  5. {
  6. public function testException()
  7. {
  8. $this->expectException(TypeError::class);
  9. $this->expectExceptionMessage('call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object');
  10. $this->getMockBuilder(Foo::class)
  11. ->enableProxyingToOriginalMethods()
  12. ->getMock();
  13. }
  14. }
  15.  
  16. class Foo
  17. {
  18. public function __construct()
  19. {
  20. $this->setBar();
  21. }
  22.  
  23. public function setBar()
  24. {
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement