Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use PHPUnit\Framework\TestCase;
- class ExceptionTestCase extends TestCase
- {
- public function testException()
- {
- $this->expectException(TypeError::class);
- $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');
- $this->getMockBuilder(Foo::class)
- ->enableProxyingToOriginalMethods()
- ->getMock();
- }
- }
- class Foo
- {
- public function __construct()
- {
- $this->setBar();
- }
- public function setBar()
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement