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 9, 2024
1 parent 156b39f commit fc02b88
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/php/Extensions/ContentReviewCMSExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ContentReviewCMSExtensionTest extends SapphireTest
public function testReviewContentForm()
{
$mock = $this->getMockBuilder(ContentReviewCMSExtension::class)
->setMethods(['getReviewContentForm'])
->onlyMethods(['getReviewContentForm'])
->getMock();

$mock->expects($this->once())->method('getReviewContentForm')->with(123)->willReturn(true);
Expand All @@ -45,7 +45,7 @@ public function testGetReviewContentFormThrowsExceptionWhenObjectCannotBeReviewe
$this->logOut();

$mock = $this->getMockBuilder(ContentReviewCMSExtension::class)
->setMethods(['findRecord'])
->onlyMethods(['findRecord'])
->getMock();

$mock->setOwner(new Controller);
Expand All @@ -62,7 +62,7 @@ public function testGetReviewContentFormThrowsExceptionWhenObjectCannotBeReviewe
public function testSaveReviewCallsHandler()
{
$mock = $this->getMockBuilder(ContentReviewCMSExtension::class)
->setMethods(['findRecord', 'getReviewContentHandler'])
->onlyMethods(['findRecord', 'getReviewContentHandler'])
->getMock();

$mock->setOwner(new Controller);
Expand All @@ -71,7 +71,7 @@ public function testSaveReviewCallsHandler()
$mock->expects($this->once())->method('findRecord')->willReturn($mockPage);

$mockHandler = $this->getMockBuilder(ReviewContentHandler::class)
->setMethods(['submitReview'])
->onlyMethods(['submitReview'])
->getMock();

$mockHandler->expects($this->once())
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Forms/ReviewContentHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testAddReviewNoteCalledWhenSubmittingReview()

$mock = $this->getMockBuilder(ReviewContentHandler::class)
->setConstructorArgs([$controller])
->setMethods(['canSubmitReview'])
->onlyMethods(['canSubmitReview'])
->getMock();

$mock->expects($this->exactly(3))->method('canSubmitReview')->willReturn(true);
Expand Down
2 changes: 1 addition & 1 deletion tests/php/SiteTreeContentReviewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public function testPermissionCheckByOnDataObject()

// Mock Page class with canReviewContent method to return true on first call and false on second call
$mock = $this->getMockBuilder(Page::class)
->setMethods(['canReviewContent', 'NextReviewDate', 'OwnerUsers'])
->onlyMethods(['canReviewContent', 'NextReviewDate', 'OwnerUsers'])
->getMock();
$mock->expects($this->exactly(2))->method('canReviewContent')->willReturnOnConsecutiveCalls(false, true);
$mock->method('NextReviewDate')->willReturn('2020-02-20 12:00:00');
Expand Down

0 comments on commit fc02b88

Please sign in to comment.