Skip to content

Commit

Permalink
DEP Use PHPUnit 11
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Sep 10, 2024
1 parent e500061 commit 83745f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions tests/EditableSpamProtectionFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testValidateFieldDoesntAddErrorOnSuccess()
->getFormField() // mock
->expects($this->once())
->method('validate')
->will($this->returnValue(true));
->willReturn(true);

$formMock
->expects($this->never())
Expand All @@ -61,7 +61,7 @@ public function testValidateFieldAddsErrorFromField()
->getFormField() // mock
->expects($this->once())
->method('validate')
->will($this->returnValue(false));
->willReturn(false);

$formMock->getValidator()->validationError('MyField', 'some field message', 'required');

Expand All @@ -82,7 +82,7 @@ public function testValidateFieldAddsDefaultError()
->getFormField() // mock
->expects($this->once())
->method('validate')
->will($this->returnValue(false));
->willReturn(false);

// field doesn't set any validation errors here

Expand Down Expand Up @@ -123,14 +123,14 @@ public function testGetIcon()
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;
}
Expand Down

0 comments on commit 83745f6

Please sign in to comment.