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
1ad41093
Commit
1ad41093
authored
Jun 04, 2012
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed unittests
parent
2a9ffab2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
1 deletion
+25
-1
library/Solarium/Query/Select/Query/Component/Facet/MultiQuery.php
...olarium/Query/Select/Query/Component/Facet/MultiQuery.php
+1
-1
tests/Solarium/Tests/Plugin/Loadbalancer/WeightedRandomChoiceTest.php
...um/Tests/Plugin/Loadbalancer/WeightedRandomChoiceTest.php
+7
-0
tests/Solarium/Tests/Query/Select/Query/Component/Facet/MultiQueryTest.php
...sts/Query/Select/Query/Component/Facet/MultiQueryTest.php
+11
-0
tests/Solarium/Tests/Query/Select/Result/Spellcheck/SpellcheckTest.php
...m/Tests/Query/Select/Result/Spellcheck/SpellcheckTest.php
+6
-0
No files found.
library/Solarium/Query/Select/Query/Component/Facet/MultiQuery.php
View file @
1ad41093
...
...
@@ -72,7 +72,7 @@ class MultiQuery extends Facet
switch
(
$name
)
{
case
'query'
:
if
(
!
is_array
(
$value
))
{
$value
=
array
(
$value
);
$value
=
array
(
array
(
'query'
=>
$value
)
);
}
$this
->
addQueries
(
$value
);
break
;
...
...
tests/Solarium/Tests/Plugin/Loadbalancer/WeightedRandomChoiceTest.php
View file @
1ad41093
...
...
@@ -79,4 +79,11 @@ class WeightedRandomChoiceTest extends \PHPUnit_Framework_TestCase
$randomizer
->
getRandom
(
$excludes
);
}
public
function
testInvalidWeigth
()
{
$choices
=
array
(
'key1'
=>
-
1
,
'key2'
=>
2
);
$this
->
setExpectedException
(
'Solarium\Core\Exception'
);
new
WeightedRandomChoice
(
$choices
);
}
}
\ No newline at end of file
tests/Solarium/Tests/Query/Select/Query/Component/Facet/MultiQueryTest.php
View file @
1ad41093
...
...
@@ -79,6 +79,17 @@ class MultiQueryTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
'category:2'
,
$query2
->
getQuery
());
}
public
function
testConfigModeSingleQuery
()
{
$options
=
array
(
'query'
=>
'category:2'
);
$this
->
facet
->
setOptions
(
$options
);
$this
->
assertEquals
(
'category:2'
,
$this
->
facet
->
getQuery
(
0
)
->
getQuery
());
}
public
function
testGetType
()
{
$this
->
assertEquals
(
...
...
tests/Solarium/Tests/Query/Select/Result/Spellcheck/SpellcheckTest.php
View file @
1ad41093
...
...
@@ -59,6 +59,12 @@ class SpellcheckTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
$this
->
collations
[
1
],
$this
->
result
->
getCollation
());
}
public
function
testGetCollationWithoutData
()
{
$result
=
new
Result
(
$this
->
suggestions
,
array
(),
$this
->
correctlySpelled
);
$this
->
assertEquals
(
null
,
$result
->
getCollation
());
}
public
function
testGetCollationWithKey
()
{
$this
->
assertEquals
(
$this
->
collations
[
0
],
$this
->
result
->
getCollation
(
0
));
...
...
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