Skip to content

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

@newscloud

Description

@newscloud

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions