Merge pull request #126 from creative-commoners/pulls/5/phpunit11

DEP Use PHPUnit 11
This commit is contained in:
Guy Sartorelli 2024-09-18 15:32:55 +12:00 committed by GitHub
commit eccaad42b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -21,7 +21,7 @@
"silverstripe/framework": "^6"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^11.3",
"silverstripe/versioned": "^3",
"squizlabs/php_codesniffer": "^3",
"silverstripe/userforms": "^7",

View File

@ -43,7 +43,7 @@ class EditableSpamProtectionFieldTest extends SapphireTest
->getFormField() // mock
->expects($this->once())
->method('validate')
->will($this->returnValue(true));
->willReturn(true);
$formMock
->expects($this->never())
@ -61,7 +61,7 @@ class EditableSpamProtectionFieldTest extends SapphireTest
->getFormField() // mock
->expects($this->once())
->method('validate')
->will($this->returnValue(false));
->willReturn(false);
$formMock->getValidator()->validationError('MyField', 'some field message', 'required');
@ -82,7 +82,7 @@ class EditableSpamProtectionFieldTest extends SapphireTest
->getFormField() // mock
->expects($this->once())
->method('validate')
->will($this->returnValue(false));
->willReturn(false);
// field doesn't set any validation errors here
@ -123,14 +123,14 @@ class EditableSpamProtectionFieldTest extends SapphireTest
protected function getFormMock()
{
$formMock = $this->getMockBuilder(Form::class)
->setMethods(['sessionMessage', 'sessionError', 'getValidator'])
->onlyMethods(['sessionMessage', 'sessionError', 'getValidator'])
->disableOriginalConstructor()
->getMock();
$formMock
->expects($this->any())
->method('getValidator')
->will($this->returnValue(new RequiredFields()));
->willReturn(new RequiredFields());
return $formMock;
}