mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 15:05:47 +00:00
Compare commits
2 Commits
3bdf224edb
...
b5e39a5fcb
Author | SHA1 | Date | |
---|---|---|---|
|
b5e39a5fcb | ||
|
c856dc2981 |
@ -133,6 +133,26 @@ class ContentReviewNotificationTest extends SapphireTest
|
||||
DBDatetime::clear_mock_now();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that provided email is valid
|
||||
*/
|
||||
public function testIsValidEmail()
|
||||
{
|
||||
$class = new ReflectionClass(ContentReviewEmails::class);
|
||||
$method = $class->getMethod('isValidEmail');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$member = $this->objFromFixture(Member::class, 'author');
|
||||
$task = new ContentReviewEmails();
|
||||
|
||||
$this->assertTrue($method->invokeArgs($task, [$member->Email]));
|
||||
$this->assertTrue($method->invokeArgs($task, ['correct.email@example.com']));
|
||||
|
||||
$this->assertFalse($method->invokeArgs($task, [null]));
|
||||
$this->assertFalse($method->invokeArgs($task, ['broken.email']));
|
||||
$this->assertFalse($method->invokeArgs($task, ['broken@email']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all pages except those passes in to the $ids parameter
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user