Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPUnit - disable original constructor in Mockery

I want use Mockery and change this:

$mockFoo = $this->getMockBuilder('Foo')
        ->disableOriginalConstructor()
        ->getMock();

to this:

$mockFoo = m::mock('Foo');

But I don't know how disable original constructor in Mockery. Please help me if You can. :-)

like image 678
Marcin Zaremba Avatar asked Nov 12 '15 13:11

Marcin Zaremba


1 Answers

Mockery does not call constructor if no parameters are specified:

\Mockery::mock('Foo');
like image 165
user487772 Avatar answered Sep 26 '22 02:09

user487772