-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from creative-commoners/pulls/6/phpunit11
DEP Use PHPUnit 11
- Loading branch information
Showing
6 changed files
with
57 additions
and
33 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace SilverStripe\ContentReview\Tests; | ||
|
||
use Page; | ||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\ArrayList; | ||
|
||
/** | ||
* Mock Page class with canReviewContent method to return false on first call | ||
* and true on second call | ||
*/ | ||
class SiteTreeContentReviewTestPage extends Page implements TestOnly | ||
{ | ||
public $ContentReviewType = 'Custom'; | ||
|
||
private $i = 0; | ||
|
||
private $reviewer; | ||
|
||
public function setReviewer($reviewer) | ||
{ | ||
$this->reviewer = $reviewer; | ||
} | ||
|
||
public function canReviewContent() | ||
{ | ||
$this->i++; | ||
return $this->i === 1 ? false : true; | ||
} | ||
|
||
public function NextReviewDate() | ||
{ | ||
return '2020-02-20 12:00:00'; | ||
} | ||
|
||
public function OwnerUsers() | ||
{ | ||
return ArrayList::create([$this->reviewer]); | ||
} | ||
} |