mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
DEP Use PHPUnit 11
This commit is contained in:
parent
e500061e7b
commit
83745f63d3
@ -21,7 +21,7 @@
|
|||||||
"silverstripe/framework": "^6"
|
"silverstripe/framework": "^6"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^9.6",
|
"phpunit/phpunit": "^11.3",
|
||||||
"silverstripe/versioned": "^3",
|
"silverstripe/versioned": "^3",
|
||||||
"squizlabs/php_codesniffer": "^3",
|
"squizlabs/php_codesniffer": "^3",
|
||||||
"silverstripe/userforms": "^7",
|
"silverstripe/userforms": "^7",
|
||||||
|
@ -43,7 +43,7 @@ class EditableSpamProtectionFieldTest extends SapphireTest
|
|||||||
->getFormField() // mock
|
->getFormField() // mock
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('validate')
|
->method('validate')
|
||||||
->will($this->returnValue(true));
|
->willReturn(true);
|
||||||
|
|
||||||
$formMock
|
$formMock
|
||||||
->expects($this->never())
|
->expects($this->never())
|
||||||
@ -61,7 +61,7 @@ class EditableSpamProtectionFieldTest extends SapphireTest
|
|||||||
->getFormField() // mock
|
->getFormField() // mock
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('validate')
|
->method('validate')
|
||||||
->will($this->returnValue(false));
|
->willReturn(false);
|
||||||
|
|
||||||
$formMock->getValidator()->validationError('MyField', 'some field message', 'required');
|
$formMock->getValidator()->validationError('MyField', 'some field message', 'required');
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ class EditableSpamProtectionFieldTest extends SapphireTest
|
|||||||
->getFormField() // mock
|
->getFormField() // mock
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('validate')
|
->method('validate')
|
||||||
->will($this->returnValue(false));
|
->willReturn(false);
|
||||||
|
|
||||||
// field doesn't set any validation errors here
|
// field doesn't set any validation errors here
|
||||||
|
|
||||||
@ -123,14 +123,14 @@ class EditableSpamProtectionFieldTest extends SapphireTest
|
|||||||
protected function getFormMock()
|
protected function getFormMock()
|
||||||
{
|
{
|
||||||
$formMock = $this->getMockBuilder(Form::class)
|
$formMock = $this->getMockBuilder(Form::class)
|
||||||
->setMethods(['sessionMessage', 'sessionError', 'getValidator'])
|
->onlyMethods(['sessionMessage', 'sessionError', 'getValidator'])
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$formMock
|
$formMock
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
->method('getValidator')
|
->method('getValidator')
|
||||||
->will($this->returnValue(new RequiredFields()));
|
->willReturn(new RequiredFields());
|
||||||
|
|
||||||
return $formMock;
|
return $formMock;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user