-
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.
- Loading branch information
1 parent
f8f36e0
commit c58902a
Showing
6 changed files
with
56 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,40 @@ | ||
<?php | ||
|
||
namespace SilverStripe\ContentReview\Tests; | ||
|
||
use Page; | ||
use SilverStripe\Dev\TestOnly; | ||
|
||
/** | ||
* 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]); | ||
} | ||
} |