Compare commits

..

2 Commits

Author SHA1 Message Date
Guy Sartorelli
b5e39a5fcb
Merge c856dc298151e4098cc8aad5a7434891f72189a8 into 4b8f7586d24eae909430baba8e24c0c7b0e9b09d 2024-09-24 05:46:15 +00:00
Guy Sartorelli
c856dc2981
ENH Use symfony/validation logic 2024-09-24 17:42:47 +12:00

View File

@ -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
*