Commit 4286bea6 authored by Bas de Nooijer's avatar Bas de Nooijer

fixed tests

parent 9b84d58f
...@@ -35,13 +35,6 @@ ...@@ -35,13 +35,6 @@
class Solarium_Result_Select_Facet_Field implements Iterator, Countable class Solarium_Result_Select_Facet_Field implements Iterator, Countable
{ {
/**
* Pointer to document array position for iterator implementation
*
* @var int
*/
protected $_position;
/** /**
* Value array * Value array
* *
...@@ -87,7 +80,7 @@ class Solarium_Result_Select_Facet_Field implements Iterator, Countable ...@@ -87,7 +80,7 @@ class Solarium_Result_Select_Facet_Field implements Iterator, Countable
*/ */
public function rewind() public function rewind()
{ {
$this->_position = 0; reset($this->_values);
} }
/** /**
...@@ -97,7 +90,7 @@ class Solarium_Result_Select_Facet_Field implements Iterator, Countable ...@@ -97,7 +90,7 @@ class Solarium_Result_Select_Facet_Field implements Iterator, Countable
*/ */
function current() function current()
{ {
return $this->_values[$this->_position]; return current($this->_values);
} }
/** /**
...@@ -107,7 +100,7 @@ class Solarium_Result_Select_Facet_Field implements Iterator, Countable ...@@ -107,7 +100,7 @@ class Solarium_Result_Select_Facet_Field implements Iterator, Countable
*/ */
public function key() public function key()
{ {
return $this->_position; return key($this->_values);
} }
/** /**
...@@ -117,7 +110,7 @@ class Solarium_Result_Select_Facet_Field implements Iterator, Countable ...@@ -117,7 +110,7 @@ class Solarium_Result_Select_Facet_Field implements Iterator, Countable
*/ */
public function next() public function next()
{ {
++$this->_position; next($this->_values);
} }
/** /**
...@@ -127,7 +120,7 @@ class Solarium_Result_Select_Facet_Field implements Iterator, Countable ...@@ -127,7 +120,7 @@ class Solarium_Result_Select_Facet_Field implements Iterator, Countable
*/ */
public function valid() public function valid()
{ {
return isset($this->_values[$this->_position]); return true;
} }
} }
\ No newline at end of file
...@@ -74,7 +74,7 @@ class Solarium_Query_Select_FacetTest extends PHPUnit_Framework_TestCase ...@@ -74,7 +74,7 @@ class Solarium_Query_Select_FacetTest extends PHPUnit_Framework_TestCase
public function testSetExcludes() public function testSetExcludes()
{ {
$this->_facet->addExcludes(array('e1','e2')); $this->_facet->addExcludes(array('e1','e2'));
$this->_facet->addExcludes(array('e3','e4')); $this->_facet->setExcludes(array('e3','e4'));
$this->assertEquals(array('e3','e4'), $this->_facet->getExcludes()); $this->assertEquals(array('e3','e4'), $this->_facet->getExcludes());
} }
} }
......
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