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

Unittest improvements

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