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
8db8dacc
Commit
8db8dacc
authored
Aug 12, 2013
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testcases for #188
parent
747a3ea7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
tests/Solarium/Tests/QueryType/Update/Query/Document/DocumentTest.php
...um/Tests/QueryType/Update/Query/Document/DocumentTest.php
+15
-0
tests/Solarium/Tests/QueryType/Update/RequestBuilderTest.php
tests/Solarium/Tests/QueryType/Update/RequestBuilderTest.php
+15
-0
No files found.
tests/Solarium/Tests/QueryType/Update/Query/Document/DocumentTest.php
View file @
8db8dacc
...
@@ -203,6 +203,21 @@ class DocumentTest extends \PHPUnit_Framework_TestCase
...
@@ -203,6 +203,21 @@ class DocumentTest extends \PHPUnit_Framework_TestCase
);
);
}
}
public
function
testRemoveFieldBySettingNullValueWithModifier
()
{
$this
->
doc
->
setKey
(
'key'
,
123
);
$this
->
doc
->
setField
(
'name'
,
null
,
null
,
Document
::
MODIFIER_SET
);
$expectedFields
=
$this
->
fields
;
$expectedFields
[
'key'
]
=
123
;
$expectedFields
[
'name'
]
=
null
;
$this
->
assertEquals
(
$expectedFields
,
$this
->
doc
->
getFields
()
);
}
public
function
testRemoveFieldBySettingToNull
()
public
function
testRemoveFieldBySettingToNull
()
{
{
$this
->
doc
->
setField
(
'name'
,
NULL
);
$this
->
doc
->
setField
(
'name'
,
NULL
);
...
...
tests/Solarium/Tests/QueryType/Update/RequestBuilderTest.php
View file @
8db8dacc
...
@@ -219,6 +219,21 @@ class RequestBuilderTest extends \PHPUnit_Framework_TestCase
...
@@ -219,6 +219,21 @@ class RequestBuilderTest extends \PHPUnit_Framework_TestCase
);
);
}
}
public
function
testBuildAddXmlWithFieldModifierAndNullValue
()
{
$doc
=
new
Document
();
$doc
->
setKey
(
'employeeId'
,
'05991'
);
$doc
->
addField
(
'skills'
,
null
,
null
,
Document
::
MODIFIER_SET
);
$command
=
new
AddCommand
();
$command
->
addDocument
(
$doc
);
$this
->
assertEquals
(
'<add><doc><field name="employeeId">05991</field><field name="skills" update="set" null="true"></field></doc></add>'
,
$this
->
builder
->
buildAddXml
(
$command
)
);
}
public
function
testBuildDeleteXml
()
public
function
testBuildDeleteXml
()
{
{
$command
=
new
DeleteCommand
;
$command
=
new
DeleteCommand
;
...
...
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