Commit 2a9ffab2 authored by Bas de Nooijer's avatar Bas de Nooijer

Small fixes

parent e3820935
......@@ -48,22 +48,25 @@ use Solarium\Query\Select\RequestBuilder\Component\DisMax as RequestBuilder;
class EdisMax extends DisMax
{
/**
* Component type
*
* @var string
*/
protected $type = SelectQuery::COMPONENT_EDISMAX;
/**
* Default options
*
* @var array
*/
protected $_options = array(
protected $options = array(
'queryparser' => 'edismax',
);
/**
* Get component type
*
* @return string
*/
public function getType()
{
return SelectQuery::COMPONENT_EDISMAX;
}
/**
* Set BoostFunctionsMult option
*
......
......@@ -146,7 +146,7 @@ class Query extends BaseQuery
protected $componentTypes = array(
self::COMPONENT_FACETSET => 'Solarium\Query\Select\Query\Component\FacetSet',
self::COMPONENT_DISMAX => 'Solarium\Query\Select\Query\Component\DisMax',
self::COMPONENT_EDISMAX => 'Solarium\Query\Select\Query\Component\EdisMax',
self::COMPONENT_EDISMAX => 'Solarium\Query\Select\Query\Component\EdisMax',
self::COMPONENT_MORELIKETHIS => 'Solarium\Query\Select\Query\Component\MoreLikeThis',
self::COMPONENT_HIGHLIGHTING => 'Solarium\Query\Select\Query\Component\Highlighting\Highlighting',
self::COMPONENT_GROUPING => 'Solarium\Query\Select\Query\Component\Grouping',
......
......@@ -69,7 +69,7 @@ class Result implements \IteratorAggregate, \Countable
* Constructor
*
* @param array $suggestions
* @param Collation $collation
* @param array $collations
* @param boolean $correctlySpelled
* @return void
*/
......
......@@ -33,7 +33,7 @@ namespace Solarium\Tests\Query\Select\Query\Component;
use Solarium\Query\Select\Query\Component\EdisMax;
use Solarium\Query\Select\Query\Query;
class EDisMaxTest extends \PHPUnit_Framework_TestCase
class EdisMaxTest extends \PHPUnit_Framework_TestCase
{
/**
......
......@@ -160,8 +160,8 @@ class RequestBuilderTest extends \PHPUnit_Framework_TestCase
public function testWithEdismaxComponent()
{
$this->_query->getEDisMax();
$request = $this->_builder->build($this->_query);
$this->query->getEdisMax();
$request = $this->builder->build($this->query);
$this->assertEquals(
'edismax',
......
......@@ -48,15 +48,25 @@ class SpellcheckTest extends \PHPUnit_Framework_TestCase
'key1' => 'content1',
'key2' => 'content2',
);
$this->collation = 'dummy1';
$this->collations = array('dummy1', 'dummy2');
$this->correctlySpelled = false;
$this->result = new Result($this->suggestions, $this->collation, $this->correctlySpelled);
$this->result = new Result($this->suggestions, $this->collations, $this->correctlySpelled);
}
public function testGetCollation()
{
$this->assertEquals($this->collation, $this->result->getCollation());
$this->assertEquals($this->collations[1], $this->result->getCollation());
}
public function testGetCollationWithKey()
{
$this->assertEquals($this->collations[0], $this->result->getCollation(0));
}
public function testGetCollations()
{
$this->assertEquals($this->collations, $this->result->getCollations());
}
public function testGetCorrectlySpelled()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment