Commit 393f5678 authored by Bas de Nooijer's avatar Bas de Nooijer

Small merge fixes

parent 87f5f5de
...@@ -70,7 +70,7 @@ class Helper ...@@ -70,7 +70,7 @@ class Helper
protected $derefencedParamsLastKey = 0; protected $derefencedParamsLastKey = 0;
/** /**
* Solarium_Query instance, optional. * Solarium Query instance, optional.
* Used for dereferenced params. * Used for dereferenced params.
* *
* @var Query * @var Query
...@@ -300,7 +300,7 @@ class Helper ...@@ -300,7 +300,7 @@ class Helper
if (!$this->query) { if (!$this->query) {
throw new Exception( throw new Exception(
'Dereferenced params can only be used in a Solarium_Query_Helper instance retrieved from the query ' 'Dereferenced params can only be used in a Solarium query helper instance retrieved from the query '
. 'by using the getHelper() method, this instance was manually created' . 'by using the getHelper() method, this instance was manually created'
); );
} }
......
...@@ -80,7 +80,7 @@ class Spellcheck ...@@ -80,7 +80,7 @@ class Spellcheck
$correctlySpelled = $value; $correctlySpelled = $value;
break; break;
case 'collation': case 'collation':
$collations[] = $this->_parseCollation($value); $collations[] = $this->parseCollation($value);
break; break;
default: default:
$suggestions[] = $this->parseSuggestion($key, $value); $suggestions[] = $this->parseSuggestion($key, $value);
......
<?php
/**
* Copyright 2012 Marc Morera. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*/
class Solarium_Client_RequestBuilder_Select_Component_EDisMaxTest extends PHPUnit_Framework_TestCase
{
public function testBuildComponent()
{
$builder = new Solarium_Client_RequestBuilder_Select_Component_EDisMax;
$request = new Solarium_Client_Request();
$component = new Solarium_Query_Select_Component_EDisMax();
$component->setQueryParser('dummyparser');
$component->setQueryAlternative('test');
$component->setQueryFields('content,name');
$component->setMinimumMatch('75%');
$component->setPhraseFields('content,description');
$component->setPhraseSlop(1);
$component->setPhraseBigramFields('content,description,category');
$component->setPhraseBigramSlop(4);
$component->setPhraseTrigramFields('content2,date,subcategory');
$component->setPhraseTrigramSlop(3);
$component->setQueryPhraseSlop(2);
$component->setTie(0.5);
$component->setBoostQuery('cat:1');
$component->setBoostFunctions('functionX(price)');
$component->setBoostFunctionsMult('functionX(date)');
$component->setUserFields('title *_s');
$request = $builder->buildComponent($component, $request);
$this->assertEquals(
array(
'defType' => 'dummyparser',
'q.alt' => 'test',
'qf' => 'content,name',
'mm' => '75%',
'pf' => 'content,description',
'ps' => 1,
'pf2' => 'content,description,category',
'ps2' => 4,
'pf3' => 'content2,date,subcategory',
'ps3' => 3,
'qs' => 2,
'tie' => 0.5,
'bq' => 'cat:1',
'bf' => 'functionX(price)',
'boost' => 'functionX(date)',
'uf' => 'title *_s',
),
$request->getParams()
);
}
}
\ No newline at end of file
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