Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPUnit_Framework_TestCase::getMock() is deprecated, use PHPUnit_Framework_TestCase::createMock() or PHPUnit_Framework_TestCase::getMockBuilder() #64

Closed
newscloud opened this issue Jul 5, 2016 · 1 comment
Assignees
Milestone

Comments

@newscloud
Copy link

@newscloud newscloud commented Jul 5, 2016

What steps will reproduce the problem?

codecept run

What's expected?

the test will work

What do you get instead?

PHPUnit_Framework_TestCase::getMock() is deprecated, use PHPUnit_Framework_TestCase::createMock() or PHPUnit_Framework_TestCase::getMockBuilder()

Additional info

In tests/unit/contactformtest...
public function testContact()
{
$model = $this->getMock('app\models\ContactForm', ['validate']);
$model->expects($this->once())->method('validate')->will($this->returnValue(true));

replacing with createMock seems to fix it

Q A
Yii vesion
PHP version
Operating system
@cebe cebe self-assigned this Jul 6, 2016
@samdark

This comment has been minimized.

Copy link
Member

@samdark samdark commented Jul 6, 2016

Already fixed.

@samdark samdark closed this Jul 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.