Commit 2463928e authored by Bas de Nooijer's avatar Bas de Nooijer

Improved unittest coverage

parent 029c8027
......@@ -40,6 +40,8 @@ namespace Solarium\Plugin\ParallelExecution\Event;
/**
* Event definitions
*
* @codeCoverageIgnore
*/
class Events
{
......
......@@ -41,6 +41,8 @@ use Symfony\Component\EventDispatcher\Event;
/**
* ExecuteEnd event, see Events for details
*
* @codeCoverageIgnore
*/
class ExecuteEnd extends Event
{
......
......@@ -42,6 +42,8 @@ use Solarium\QueryType\Update\Result;
/**
* ExecuteStart event, see Events for details
*
* @codeCoverageIgnore
*/
class ExecuteStart extends Event
{
......
<?php
/**
* Copyright 2011 Bas de Nooijer. 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.
*/
namespace Solarium\Tests\Plugin\BufferedAdd\Event;
use Solarium\Plugin\BufferedAdd\Event\PostCommit;
use Solarium\QueryType\Select\Query\Query;
use Solarium\Core\Client\Client;
use Solarium\Core\Client\Response;
use Solarium\Core\Query\Result\Result;
class PostCommitTest extends \PHPUnit_Framework_TestCase
{
public function testConstructorAndGetter()
{
$client = new Client;
$query = $client->createSelect();
$query->setQuery('test123');
$response = new Response('',array('HTTP 1.0 200 OK'));
$result = new Result($client, $query, $response);
$event = new PostCommit($result);
$this->assertEquals($result, $event->getResult());
}
}
<?php
/**
* Copyright 2011 Bas de Nooijer. 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.
*/
namespace Solarium\Tests\Plugin\BufferedAdd\Event;
use Solarium\Plugin\BufferedAdd\Event\PostFlush;
use Solarium\QueryType\Select\Query\Query;
use Solarium\Core\Client\Client;
use Solarium\Core\Client\Response;
use Solarium\Core\Query\Result\Result;
class PostFlushTest extends \PHPUnit_Framework_TestCase
{
public function testConstructorAndGetter()
{
$client = new Client;
$query = $client->createSelect();
$query->setQuery('test123');
$response = new Response('',array('HTTP 1.0 200 OK'));
$result = new Result($client, $query, $response);
$event = new PostFlush($result);
$this->assertEquals($result, $event->getResult());
}
}
<?php
/**
* Copyright 2011 Bas de Nooijer. 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.
*/
namespace Solarium\Tests\Plugin\BufferedAdd\Event;
use Solarium\Plugin\BufferedAdd\Event\PreCommit;
class PreCommitTest extends \PHPUnit_Framework_TestCase
{
public function testConstructorAndGetters()
{
$buffer = array(1,2,3);
$overwrite = true;
$waitFlush = false;
$waitSearcher = true;
$expungeDeletes = false;
$event = new PreCommit($buffer, $overwrite, $waitFlush, $waitSearcher, $expungeDeletes);
$this->assertEquals($buffer, $event->getBuffer());
$this->assertEquals($overwrite, $event->getOverwrite());
$this->assertEquals($waitFlush, $event->getWaitFlush());
$this->assertEquals($waitSearcher, $event->getWaitSearcher());
$this->assertEquals($expungeDeletes, $event->getExpungeDeletes());
return $event;
}
/**
* @depends testConstructorAndGetters
*
* @param PreCommit $event
*/
public function testSetAndGetBuffer($event)
{
$buffer = array(4,5,6);
$event->setBuffer($buffer);
$this->assertEquals($buffer, $event->getBuffer());
}
/**
* @depends testConstructorAndGetters
*
* @param PreCommit $event
*/
public function testSetAndGetExpungeDeletes($event)
{
$expungeDeletes = true;
$event->setExpungeDeletes($expungeDeletes);
$this->assertEquals($expungeDeletes, $event->getExpungeDeletes());
}
/**
* @depends testConstructorAndGetters
*
* @param PreCommit $event
*/
public function testSetAndGetOverwrite($event)
{
$overwrite = false;
$event->setOverwrite($overwrite);
$this->assertEquals($overwrite, $event->getOverwrite());
}
/**
* @depends testConstructorAndGetters
*
* @param PreCommit $event
*/
public function testSetAndGetWaitFlush($event)
{
$waitFlush = true;
$event->setWaitFlush($waitFlush);
$this->assertEquals($waitFlush, $event->getWaitFlush());
}
/**
* @depends testConstructorAndGetters
*
* @param PreCommit $event
*/
public function testSetAndGetWaitSearcher($event)
{
$waitSearcher = false;
$event->setWaitSearcher($waitSearcher);
$this->assertEquals($waitSearcher, $event->getWaitSearcher());
}
}
<?php
/**
* Copyright 2011 Bas de Nooijer. 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.
*/
namespace Solarium\Tests\Plugin\BufferedAdd\Event;
use Solarium\Plugin\BufferedAdd\Event\PreFlush;
class PreFlushTest extends \PHPUnit_Framework_TestCase
{
public function testConstructorAndGetters()
{
$buffer = array(1,2,3);
$overwrite = true;
$commitWithin = 567;
$event = new PreFlush($buffer, $overwrite, $commitWithin);
$this->assertEquals($buffer, $event->getBuffer());
$this->assertEquals($overwrite, $event->getOverwrite());
$this->assertEquals($commitWithin, $event->getCommitWithin());
return $event;
}
/**
* @depends testConstructorAndGetters
*
* @param PreFlush $event
*/
public function testSetAndGetBuffer($event)
{
$buffer = array(4,5,6);
$event->setBuffer($buffer);
$this->assertEquals($buffer, $event->getBuffer());
}
/**
* @depends testConstructorAndGetters
*
* @param PreFlush $event
*/
public function testSetAndGetCommitWithin($event)
{
$commitWithin = 321;
$event->setCommitWithin($commitWithin);
$this->assertEquals($commitWithin, $event->getCommitWithin());
}
/**
* @depends testConstructorAndGetters
*
* @param PreFlush $event
*/
public function testSetAndGetOverwrite($event)
{
$overwrite = false;
$event->setOverwrite($overwrite);
$this->assertEquals($overwrite, $event->getOverwrite());
}
}
......@@ -32,7 +32,9 @@
namespace Solarium\Tests\Plugin\CustomizeRequest;
use Solarium\Plugin\CustomizeRequest\CustomizeRequest;
use Solarium\Plugin\CustomizeRequest\Customization;
use Solarium\Core\Client\Client;
use Solarium\Core\Client\Request;
use Solarium\Core\Client\Response;
use Solarium\Core\Client\Endpoint;
use Solarium\Core\Event\PreExecuteRequest as PreExecuteRequestEvent;
......@@ -90,6 +92,33 @@ class CustomizeRequestTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(false, $id->getOverwrite());
}
public function testPluginIntegration()
{
$client = new Client;
$client->registerPlugin('testplugin', $this->plugin);
$input = array(
'key' => 'xid',
'type' => 'param',
'name' => 'xid',
'value' => 123,
);
$this->plugin->addCustomization($input);
$originalRequest = new Request();
$expectedRequest = new Request();
$expectedRequest->addParam('xid', 123); // this should be the effect of the customization
$observer = $this->getMock('Solarium\Core\Client\Adapter\Http', array('execute'));
$observer->expects($this->once())
->method('execute')
->with($this->equalTo($expectedRequest))
->will($this->returnValue(new Response('',array('HTTP 1.0 200 OK'))));
$client->setAdapter($observer);
$client->executeRequest($originalRequest);
}
public function testCreateCustomization()
{
$customization = $this->plugin->createCustomization('id1');
......
<?php
/**
* Copyright 2011 Bas de Nooijer. 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.
*/
namespace Solarium\Tests\Plugin\Loadbalancer\Event;
use Solarium\Plugin\Loadbalancer\Event\EndpointFailure;
use Solarium\Core\Client\Client;
use Solarium\Exception\HttpException;
class EndpointFailureTest extends \PHPUnit_Framework_TestCase
{
public function testConstructorAndGetters()
{
$client = new Client;
$endpoint = $client->getEndpoint();
$httpException = new HttpException('test exception');
$event = new EndpointFailure($endpoint, $httpException);
$this->assertEquals($endpoint, $event->getEndpoint());
$this->assertEquals($httpException, $event->getException());
}
}
......@@ -43,7 +43,6 @@ class ParallelExecutionTest extends \PHPUnit_Framework_TestCase
public function setUp()
{
$this->plugin = new ParallelExecution();
}
public function testAddAndGetQueries()
......
......@@ -112,4 +112,16 @@ class PostBigRequestTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($requestInput, $requestOutput);
}
public function testPluginIntegration()
{
$client = new Client;
$client->registerPlugin('testplugin', $this->plugin);
$this->plugin->setMaxQueryStringLength(1); // this forces POST for even the smallest queries
$query = $client->createSelect();
$request = $client->createRequest($query);
// default method is GET, the plugin should have changed this to POST
$this->assertEquals(Request::METHOD_POST, $request->getMethod());
}
}
<?php
/**
* Copyright 2011 Bas de Nooijer. 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.
*/
namespace Solarium\Tests\QueryType\Extract;
use Solarium\Core\Client\Client;
use Solarium\QueryType\Update\Query\Document;
use Solarium\QueryType\Extract\Query;
class QueryTest extends \PHPUnit_Framework_TestCase
{
/**
* @var Query
*/
protected $query;
public function setUp()
{
$this->query = new Query;
}
public function testGetType()
{
$this->assertEquals(Client::QUERY_EXTRACT, $this->query->getType());
}
public function testGetResponseParser()
{
$this->assertInstanceOf('Solarium\QueryType\Update\ResponseParser', $this->query->getResponseParser());
}
public function testGetRequestBuilder()
{
$this->assertInstanceOf('Solarium\QueryType\Extract\RequestBuilder', $this->query->getRequestBuilder());
}
public function testConfigMode()
{
$mappings = array(
'from1' => 'to1',
'from2' => 'to2',
);
$options = array(
'fmap' => $mappings
);
$this->query->setOptions($options);
$this->assertEquals(
$mappings,
$this->query->getFieldMappings()
);
}
public function testSetAndGetStart()
{
$doc = new Document(array('field1', 'value1'));
$this->query->setDocument($doc);
$this->assertEquals($doc, $this->query->getDocument());
}
public function testSetAndGetFilename()
{
$this->query->setFile(__FILE__);
$this->assertEquals(__FILE__, $this->query->getFile());
}
public function testSetAndGetUprefix()
{
$this->query->setUprefix('dyn_');
$this->assertEquals('dyn_', $this->query->getUprefix());
}
public function testSetAndGetDefaultField()
{
$this->query->setDefaultField('defaulttext');
$this->assertEquals('defaulttext', $this->query->getDefaultField());
}
public function testSetAndGetLowernames()
{
$this->query->setLowernames(true);
$this->assertEquals(true, $this->query->getLowernames());
}
public function testSetAndGetCommit()
{
$this->query->setCommit(true);
$this->assertEquals(true, $this->query->getCommit());
}
public function testSetAndGetCommitWithin()
{
$this->query->setCommitWithin(458);
$this->assertEquals(458, $this->query->getCommitWithin());
}
public function testSetAndGetDocumentClass()
{
$this->query->setDocumentClass('Solarium\Tests\QueryType\Extract\MyCustomDoc');
$this->assertEquals('Solarium\Tests\QueryType\Extract\MyCustomDoc', $this->query->getDocumentClass());
return $this->query;
}
/**
* @depends testSetAndGetDocumentClass
*/
public function testCreateDocument($query)
{
$fields = array('key1' => 'value1', 'key2' => 'value2');
$boosts = array('key1' => 1, 'key2' => 2);
$document = $query->createDocument($fields, $boosts);
$this->assertInstanceOf('Solarium\Tests\QueryType\Extract\MyCustomDoc', $document);
$this->assertEquals($boosts, $document->getFieldBoosts());
$this->assertEquals($fields, $document->getFields());
}
public function testAddFieldMapping()
{
$expectedFields = $this->query->getFieldMappings();
$expectedFields['newfield'] = 'tofield';
$this->query->addFieldMapping('newfield', 'tofield');
$this->assertEquals($expectedFields, $this->query->getFieldMappings());
return $this->query;
}
/**
* @depends testAddFieldMapping
* @param Query $query
*/
public function testClearFieldMappingss($query)
{
$query->clearFieldMappings();
$this->assertEquals(array(), $query->getFieldMappings());
return $query;
}
/**
* @depends testClearFieldMappingss
* @param Query $query
*/
public function testAddFieldMappings($query)
{
$fields = array('field1' => 'target1','field2' => 'target2');
$query->addFieldMappings($fields);
$this->assertEquals($fields, $query->getFieldMappings());
return $query;
}
/**
* @depends testAddFieldMappings
* @param Query $query
*/
public function testRemoveFieldMapping($query)
{
$query->removeFieldMapping('field1');
$this->assertEquals(array('field2' => 'target2'), $query->getFieldMappings());
return $query;
}
/**
* @depends testRemoveFieldMapping
* @param Query $query
*/
public function testSetFields($query)
{
$fields = array('field3' => 'target3','field4' => 'target4');
$query->setFieldMappings($fields);
$this->assertEquals($fields, $query->getFieldMappings());
}
}
class MyCustomDoc extends Document{
}
......@@ -84,5 +84,39 @@ class RequestBuilderTest extends \PHPUnit_Framework_TestCase
);
}
public function testDocumentFieldAndBoostParams()
{
$fields = array('field1' => 'value1', 'field2' => 'value2');
$boosts = array('field1' => 1, 'field2' => 5);
$document = $this->query->createDocument($fields, $boosts);
$this->query->setDocument($document);
$request = $this->builder->build($this->query);
$this->assertEquals(
array(
'boost.field1' => 1,
'boost.field2' => 5,
'fmap.from-field' => 'to-field',
'literal.field1' => 'value1',
'literal.field2' => 'value2',
'omitHeader' => true,
'param1' => 'value1',
'resource.name' => 'RequestBuilderTest.php',
'wt' => 'json',
),
$request->getParams()
);
}
public function testDocumentWithBoostThrowsException()
{
$document = $this->query->createDocument();
$document->setBoost(4);
$this->query->setDocument($document);
$this->setExpectedException('Solarium\Exception\RuntimeException');
$this->builder->build($this->query);
}
}
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