Skip to content

Commit

Permalink
Several improvements based on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
basdenooijer committed Oct 21, 2011
1 parent 076c0c8 commit c0bbb20
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ protected function _facetRange($facet, $data)

$offset = 0;
$counts = array();
while(isset($data['counts'][$offset]) && isset($data['counts'][$offset+1])) {
while (isset($data['counts'][$offset]) && isset($data['counts'][$offset+1])) {
$counts[$data['counts'][$offset]] = $data['counts'][$offset+1];
$offset += 2;
}
Expand Down
5 changes: 2 additions & 3 deletions library/Solarium/Configurable.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function __construct($options = null)
* @param array|Zend_Config $options
* @param boolean $overwrite True for overwriting existing options, false
* for merging (new values overwrite old ones if needed)
*
*
* @return void
*/
public function setOptions($options, $overwrite = false)
Expand All @@ -98,8 +98,7 @@ public function setOptions($options, $overwrite = false)
if (is_object($options)) {
$options = $options->toArray();
} else {
throw new Solarium_Exception('Options must be an '
. 'array or a Zend_Config object');
throw new Solarium_Exception('Options must be an array or a Zend_Config object');
}
}

Expand Down
7 changes: 3 additions & 4 deletions library/Solarium/Query/Select/Component/Facet/MultiQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Solarium_Query_Select_Component_Facet_MultiQuery extends Solarium_Query_Se
protected function _init()
{
parent::_init();

foreach ($this->_options AS $name => $value) {
switch ($name) {
case 'query':
Expand All @@ -79,7 +79,7 @@ protected function _init()

/**
* Get the facet type
*
*
* @return string
*/
public function getType()
Expand Down Expand Up @@ -133,8 +133,7 @@ public function addQuery($facetQuery)
}

if (array_key_exists($key, $this->_facetQueries)) {
throw new Solarium_Exception('A query must have a unique key'
. ' value within a multiquery facet');
throw new Solarium_Exception('A query must have a unique key value within a multiquery facet');
}

// forward shared excludes
Expand Down
8 changes: 7 additions & 1 deletion tests/Solarium/Result/Analysis/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public function setUp()
'position' => 2,
'positionHistory' => array(2,1),
'type' => '<dummytype>',
'raw_text' => 'dummy raw text'
'raw_text' => 'dummy raw text',
'match' => true
);
$this->_item = new Solarium_Result_Analysis_Item($this->_data);
}
Expand Down Expand Up @@ -101,4 +102,9 @@ public function testGetRawTextEmpty()
$item = new Solarium_Result_Analysis_Item($data);
$this->assertEquals(null, $item->getRawText());
}

public function testGetMatch()
{
$this->assertEquals($this->_data['match'], $this->_item->getMatch());
}
}

0 comments on commit c0bbb20

Please sign in to comment.