Exemple #1
0
 public function setUp()
 {
     $this->akismet = new Akismet\Akismet('somebogusapikey', 'http://framework.zend.com/wiki/');
     $adapter = new Http\Client\Adapter\Test();
     $client = new Http\Client(null, array('adapter' => $adapter));
     $this->adapter = $adapter;
     Akismet\Akismet::setDefaultHttpClient($client);
     $this->comment = array('user_ip' => '71.161.221.76', 'user_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1)', 'comment_type' => 'comment', 'comment_content' => 'spam check');
 }
Exemple #2
0
 public function testSubmitHam()
 {
     $response = "HTTP/1.0 200 OK\r\n" . "X-powered-by: PHP/4.4.2\r\n" . "Content-type: text/html\r\n" . "Content-length: 41\r\n" . "Server: LiteSpeed\r\n" . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" . "Connection: close\r\n" . "\r\n" . "Thanks for making the web a better place.";
     $this->adapter->setResponse($response);
     $this->akismet->submitHam($this->comment);
 }