setInterestingTerms('list'); $mock = $this->getMock('Solarium_Result_MoreLikeThis', array('getQuery','_parseResponse'), array(), '', false); $mock->expects($this->once()) ->method('getQuery') ->will($this->returnValue($query)); $mock->expects($this->once()) ->method('_parseResponse'); $mock->getInterestingTerms(); } public function testGetInterestingTermsException() { $query = new Solarium_Query_MoreLikeThis(); $query->setInterestingTerms('none'); $mock = $this->getMock('Solarium_Result_MoreLikeThis', array('getQuery'), array(), '', false); $mock->expects($this->once()) ->method('getQuery') ->will($this->returnValue($query)); $this->setExpectedException('Solarium_Exception'); $mock->getInterestingTerms(); } public function testGetMatch() { $query = new Solarium_Query_MoreLikeThis(); $query->setMatchInclude(true); $mock = $this->getMock('Solarium_Result_MoreLikeThis', array('getQuery','_parseResponse'), array(), '', false); $mock->expects($this->once()) ->method('getQuery') ->will($this->returnValue($query)); $mock->expects($this->once()) ->method('_parseResponse'); $mock->getMatch(); } public function testGetMatchException() { $query = new Solarium_Query_MoreLikeThis(); $query->setMatchInclude(false); $mock = $this->getMock('Solarium_Result_MoreLikeThis', array('getQuery'), array(), '', false); $mock->expects($this->once()) ->method('getQuery') ->will($this->returnValue($query)); $this->setExpectedException('Solarium_Exception'); $mock->getMatch(); } }