Commit 48baa9be authored by Bas de Nooijer's avatar Bas de Nooijer

Unittest improvements

parent a7ff6fa6
...@@ -467,18 +467,18 @@ class Highlighting extends Component ...@@ -467,18 +467,18 @@ class Highlighting extends Component
{ {
return $this->getOption('simplepostfix'); return $this->getOption('simplepostfix');
} }
/** /**
* Set tag prefix option * Set tag prefix option
* *
* Solr option h1.tag.post * Solr option h1.tag.post
* *
* @param string $prefix * @param string $prefix
* @return Solarium_Query_Select_Component_Highlighting Provides fluent interface * @return self Provides fluent interface
*/ */
public function setTagPrefix($prefix) public function setTagPrefix($prefix)
{ {
return $this->_setOption('tagprefix', $prefix); return $this->setOption('tagprefix', $prefix);
} }
/** /**
...@@ -492,18 +492,18 @@ class Highlighting extends Component ...@@ -492,18 +492,18 @@ class Highlighting extends Component
{ {
return $this->getOption('tagprefix'); return $this->getOption('tagprefix');
} }
/** /**
* Set tag postfix option * Set tag postfix option
* *
* Solr option h1.tag.post * Solr option h1.tag.post
* *
* @param string $postfix * @param string $postfix
* @return Solarium_Query_Select_Component_Highlighting Provides fluent interface * @return self Provides fluent interface
*/ */
public function setTagPostfix($postfix) public function setTagPostfix($postfix)
{ {
return $this->_setOption('tagpostfix', $postfix); return $this->setOption('tagpostfix', $postfix);
} }
/** /**
......
...@@ -67,6 +67,8 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase ...@@ -67,6 +67,8 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase
'formatter' => 'myFormatter', 'formatter' => 'myFormatter',
'simpleprefix' => '<b>', 'simpleprefix' => '<b>',
'simplepostfix' => '</b>', 'simplepostfix' => '</b>',
'tagprefix' => '<i>',
'tagpostfix' => '<\i>',
'fragmenter' => 'myFragmenter', 'fragmenter' => 'myFragmenter',
'fraglistbuilder' => 'regex', 'fraglistbuilder' => 'regex',
'fragmentsbuilder' => 'myBuilder', 'fragmentsbuilder' => 'myBuilder',
...@@ -96,6 +98,8 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase ...@@ -96,6 +98,8 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($options['formatter'], $this->hlt->getFormatter()); $this->assertEquals($options['formatter'], $this->hlt->getFormatter());
$this->assertEquals($options['simpleprefix'], $this->hlt->getSimplePrefix()); $this->assertEquals($options['simpleprefix'], $this->hlt->getSimplePrefix());
$this->assertEquals($options['simplepostfix'], $this->hlt->getSimplePostfix()); $this->assertEquals($options['simplepostfix'], $this->hlt->getSimplePostfix());
$this->assertEquals($options['tagprefix'], $this->hlt->getTagPrefix());
$this->assertEquals($options['tagpostfix'], $this->hlt->getTagPostfix());
$this->assertEquals($options['fragmenter'], $this->hlt->getFragmenter()); $this->assertEquals($options['fragmenter'], $this->hlt->getFragmenter());
$this->assertEquals($options['fraglistbuilder'], $this->hlt->getFragListBuilder()); $this->assertEquals($options['fraglistbuilder'], $this->hlt->getFragListBuilder());
$this->assertEquals($options['fragmentsbuilder'], $this->hlt->getFragmentsBuilder()); $this->assertEquals($options['fragmentsbuilder'], $this->hlt->getFragmentsBuilder());
...@@ -490,22 +494,22 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase ...@@ -490,22 +494,22 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase
public function testSetAndGetTagPrefix() public function testSetAndGetTagPrefix()
{ {
$value = '<i>'; $value = '<i>';
$this->_hlt->setTagPrefix($value); $this->hlt->setTagPrefix($value);
$this->assertEquals( $this->assertEquals(
$value, $value,
$this->_hlt->getTagPrefix() $this->hlt->getTagPrefix()
); );
} }
public function testSetAndGetTagPostfix() public function testSetAndGetTagPostfix()
{ {
$value = '</i>'; $value = '</i>';
$this->_hlt->setTagPostfix($value); $this->hlt->setTagPostfix($value);
$this->assertEquals( $this->assertEquals(
$value, $value,
$this->_hlt->getTagPostfix() $this->hlt->getTagPostfix()
); );
} }
......
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