Source of file AkismetTestService.php
Size: 0,583 Bytes - Last Modified: 2021-12-23T10:27:31+00:00
/var/www/docs.ssmods.com/process/src/tests/AkismetTestService.php
123456789101112131415161718192021222324 | <?php namespace SilverStripe\Akismet\Tests; use Exception; use SilverStripe\Dev\TestOnly; use SilverStripe\Akismet\Service\AkismetService; class AkismetTestService implements TestOnly, AkismetService { public function __construct($apiKey, $url) { if ($apiKey !== 'dummykey') { throw new Exception("Invalid key"); } } public function isSpam($content, $author = null, $email = null, $url = null, $permalink = null, $type = null) { // This dummy service only checks the content return $content === 'spam'; } } |