/** * @test */ public function canDeleteStopword() { //$this->markTestIncomplete('Process error'); $this->stopwordBackend = $this->getMock('\\Searchperience\\Api\\Client\\System\\Storage\\RestStopwordBackend', array('deleteByWord')); $this->stopwordBackend->injectDateTimeService(new \Searchperience\Api\Client\System\DateTime\DateTimeService()); $restClient = new \Guzzle\Http\Client('http://api.searchperience.com/'); $mock = new \Guzzle\Plugin\Mock\MockPlugin(); $mock->addResponse(new \Guzzle\Http\Message\Response(201)); $restClient->addSubscriber($mock); $this->stopwordBackend->injectRestClient($restClient); $this->stopwordBackend->expects($this->once())->method('deleteByWord')->with('one', 'foo')->will($this->returnValue($this->getMock('\\Guzzle\\Http\\Message\\Response', array(), array(), '', false))); $stopword = new Stopword(); $stopword->setWord('foo'); $stopword->setTagName('one'); $this->stopwordBackend->delete('one', $stopword); }
/** * @test */ public function canSetMainWord() { $this->stopword->setWord("foo"); $this->assertSame("foo", $this->stopword->getWord()); }