Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
48baa9be
Commit
48baa9be
authored
Jul 13, 2012
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unittest improvements
parent
a7ff6fa6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
library/Solarium/QueryType/Select/Query/Component/Highlighting/Highlighting.php
...Type/Select/Query/Component/Highlighting/Highlighting.php
+6
-6
tests/Solarium/Tests/QueryType/Select/Query/Component/Highlighting/HighlightingTest.php
.../Select/Query/Component/Highlighting/HighlightingTest.php
+8
-4
No files found.
library/Solarium/QueryType/Select/Query/Component/Highlighting/Highlighting.php
View file @
48baa9be
...
@@ -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
);
}
}
/**
/**
...
...
tests/Solarium/Tests/QueryType/Select/Query/Component/Highlighting/HighlightingTest.php
View file @
48baa9be
...
@@ -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
()
);
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment