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
168e6a09
Commit
168e6a09
authored
May 16, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added create methods
- unittest improvements
parent
41c60725
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
291 additions
and
100 deletions
+291
-100
library/Solarium/Client.php
library/Solarium/Client.php
+64
-0
library/Solarium/Client/Adapter/Http.php
library/Solarium/Client/Adapter/Http.php
+13
-1
library/Solarium/Client/Adapter/ZendHttp.php
library/Solarium/Client/Adapter/ZendHttp.php
+5
-15
library/Solarium/Client/RequestBuilder/Select/Component/FacetSet.php
...arium/Client/RequestBuilder/Select/Component/FacetSet.php
+4
-4
library/Solarium/Client/RequestBuilder/Update.php
library/Solarium/Client/RequestBuilder/Update.php
+5
-5
library/Solarium/Client/ResponseParser/Select/Component/FacetSet.php
...arium/Client/ResponseParser/Select/Component/FacetSet.php
+4
-4
library/Solarium/Plugin/Abstract.php
library/Solarium/Plugin/Abstract.php
+19
-0
library/Solarium/Query/Select.php
library/Solarium/Query/Select.php
+11
-0
library/Solarium/Query/Select/Component/Facet.php
library/Solarium/Query/Select/Component/Facet.php
+0
-8
library/Solarium/Query/Select/Component/Facet/Field.php
library/Solarium/Query/Select/Component/Facet/Field.php
+1
-1
library/Solarium/Query/Select/Component/Facet/MultiQuery.php
library/Solarium/Query/Select/Component/Facet/MultiQuery.php
+1
-1
library/Solarium/Query/Select/Component/Facet/Query.php
library/Solarium/Query/Select/Component/Facet/Query.php
+1
-1
library/Solarium/Query/Select/Component/Facet/Range.php
library/Solarium/Query/Select/Component/Facet/Range.php
+1
-1
library/Solarium/Query/Select/Component/FacetSet.php
library/Solarium/Query/Select/Component/FacetSet.php
+82
-2
library/Solarium/Query/Update.php
library/Solarium/Query/Update.php
+56
-24
library/Solarium/Query/Update/Command.php
library/Solarium/Query/Update/Command.php
+0
-9
library/Solarium/Query/Update/Command/Add.php
library/Solarium/Query/Update/Command/Add.php
+1
-1
library/Solarium/Query/Update/Command/Commit.php
library/Solarium/Query/Update/Command/Commit.php
+1
-1
library/Solarium/Query/Update/Command/Delete.php
library/Solarium/Query/Update/Command/Delete.php
+1
-1
library/Solarium/Query/Update/Command/Optimize.php
library/Solarium/Query/Update/Command/Optimize.php
+1
-1
library/Solarium/Query/Update/Command/Rollback.php
library/Solarium/Query/Update/Command/Rollback.php
+1
-1
tests/Solarium/ClientTest.php
tests/Solarium/ClientTest.php
+0
-1
tests/Solarium/Query/Select/Component/Facet/FieldTest.php
tests/Solarium/Query/Select/Component/Facet/FieldTest.php
+1
-1
tests/Solarium/Query/Select/Component/Facet/MultiQueryTest.php
.../Solarium/Query/Select/Component/Facet/MultiQueryTest.php
+1
-1
tests/Solarium/Query/Select/Component/Facet/QueryTest.php
tests/Solarium/Query/Select/Component/Facet/QueryTest.php
+1
-1
tests/Solarium/Query/Select/Component/Facet/RangeTest.php
tests/Solarium/Query/Select/Component/Facet/RangeTest.php
+1
-1
tests/Solarium/Query/Update/Command/AddTest.php
tests/Solarium/Query/Update/Command/AddTest.php
+1
-1
tests/Solarium/Query/Update/Command/CommitTest.php
tests/Solarium/Query/Update/Command/CommitTest.php
+1
-1
tests/Solarium/Query/Update/Command/DeleteTest.php
tests/Solarium/Query/Update/Command/DeleteTest.php
+1
-1
tests/Solarium/Query/Update/Command/OptimizeTest.php
tests/Solarium/Query/Update/Command/OptimizeTest.php
+1
-1
tests/Solarium/Query/Update/Command/RollbackTest.php
tests/Solarium/Query/Update/Command/RollbackTest.php
+1
-1
tests/Solarium/Query/UpdateTest.php
tests/Solarium/Query/UpdateTest.php
+10
-9
No files found.
library/Solarium/Client.php
View file @
168e6a09
...
...
@@ -80,14 +80,17 @@ class Solarium_Client extends Solarium_Configurable
*/
protected
$_queryTypes
=
array
(
self
::
QUERYTYPE_SELECT
=>
array
(
'query'
=>
'Solarium_Query_Select'
,
'requestbuilder'
=>
'Solarium_Client_RequestBuilder_Select'
,
'responseparser'
=>
'Solarium_Client_ResponseParser_Select'
),
self
::
QUERYTYPE_UPDATE
=>
array
(
'query'
=>
'Solarium_Query_Update'
,
'requestbuilder'
=>
'Solarium_Client_RequestBuilder_Update'
,
'responseparser'
=>
'Solarium_Client_ResponseParser_Update'
),
self
::
QUERYTYPE_PING
=>
array
(
'query'
=>
'Solarium_Query_Ping'
,
'requestbuilder'
=>
'Solarium_Client_RequestBuilder_Ping'
,
'responseparser'
=>
'Solarium_Client_ResponseParser_Ping'
),
...
...
@@ -462,4 +465,65 @@ class Solarium_Client extends Solarium_Configurable
{
return
$this
->
execute
(
$query
);
}
/**
* Create a query instance
*
* @param string $type
* @param array $options
* @return Solarium_Query
*/
public
function
createQuery
(
$type
,
$options
=
null
)
{
$type
=
strtolower
(
$type
);
$pluginResult
=
$this
->
_callPlugins
(
'preCreateQuery'
,
array
(
$type
,
$options
),
true
);
if
(
$pluginResult
!==
null
)
return
$pluginResult
;
if
(
!
isset
(
$this
->
_queryTypes
[
$type
]))
{
throw
new
Solarium_Exception
(
'Unknown querytype: '
.
$type
);
}
$class
=
$this
->
_queryTypes
[
$type
][
'query'
];
$query
=
new
$class
(
$options
);
$this
->
_callPlugins
(
'postCreateQuery'
,
array
(
$type
,
$options
,
$query
));
return
$query
;
}
/**
* Create a select query instance
*
* @param mixed $options
* @return Solarium_Query_Select
*/
public
function
createSelect
(
$options
=
null
)
{
return
$this
->
createQuery
(
self
::
QUERYTYPE_SELECT
,
$options
);
}
/**
* Create an update query instance
*
* @param mixed $options
* @return Solarium_Query_Update
*/
public
function
createUpdate
(
$options
=
null
)
{
return
$this
->
createQuery
(
self
::
QUERYTYPE_UPDATE
,
$options
);
}
/**
* Create a ping query instance
*
* @param mixed $options
* @return Solarium_Query_Ping
*/
public
function
createPing
(
$options
=
null
)
{
return
$this
->
createQuery
(
self
::
QUERYTYPE_PING
,
$options
);
}
}
\ No newline at end of file
library/Solarium/Client/Adapter/Http.php
View file @
168e6a09
...
...
@@ -81,7 +81,7 @@ class Solarium_Client_Adapter_Http extends Solarium_Client_Adapter
}
$uri
=
$this
->
getBaseUri
()
.
$request
->
getUri
();
$data
=
@
file_get_contents
(
$uri
,
false
,
$context
);
$data
=
$this
->
_getData
(
$uri
,
$context
);
// if there is no data and there are no headers it's a total failure,
// a connection to the host was impossible.
...
...
@@ -92,4 +92,16 @@ class Solarium_Client_Adapter_Http extends Solarium_Client_Adapter
return
new
Solarium_Client_Response
(
$data
,
$http_response_header
);
}
/**
* Execute request
*
* @param string $uri
* @param resource $context
* @return string
*/
protected
function
_getData
(
$uri
,
$context
)
{
return
@
file_get_contents
(
$uri
,
false
,
$context
);
}
}
\ No newline at end of file
library/Solarium/Client/Adapter/ZendHttp.php
View file @
168e6a09
...
...
@@ -48,7 +48,7 @@
* @package Solarium
* @subpackage Client
*/
class
Solarium_Client_Adapter_ZendHttp
extends
Solarium_Client_Adapter
_Http
class
Solarium_Client_Adapter_ZendHttp
extends
Solarium_Client_Adapter
{
/**
...
...
@@ -143,9 +143,9 @@ class Solarium_Client_Adapter_ZendHttp extends Solarium_Client_Adapter_Http
* Execute a Solr request using the Zend_Http_Client instance
*
* @param Solarium_Client_Request $request
* @return
string
* @return
Solarium_Client_Response
*/
p
rotected
function
_handleRequest
(
$request
)
p
ublic
function
execute
(
$request
)
{
$client
=
$this
->
getZendHttp
();
...
...
@@ -164,22 +164,12 @@ class Solarium_Client_Adapter_ZendHttp extends Solarium_Client_Adapter_Http
}
if
(
$request
->
getMethod
()
==
Solarium_Client_Request
::
HEAD
)
{
return
true
;
$data
=
''
;
}
else
{
$data
=
$response
->
getBody
();
$type
=
$response
->
getHeader
(
'Content-Type'
);
switch
(
$type
)
{
case
'text/plain; charset=utf-8'
:
return
$this
->
_jsonDecode
(
$data
);
break
;
default
:
throw
new
Solarium_Exception
(
'Unknown Content-Type in ZendHttp adapter: '
.
$type
);
break
;
}
}
return
new
Solarium_Client_Response
(
$data
,
$response
->
getHeaders
());
}
}
\ No newline at end of file
library/Solarium/Client/RequestBuilder/Select/Component/FacetSet.php
View file @
168e6a09
...
...
@@ -69,16 +69,16 @@ class Solarium_Client_RequestBuilder_Select_Component_FacetSet extends Solarium_
foreach
(
$facets
AS
$facet
)
{
switch
(
$facet
->
getType
())
{
case
Solarium_Query_Select_Component_Facet
::
FIELD
:
case
Solarium_Query_Select_Component_Facet
Set
::
FACET_
FIELD
:
$this
->
addFacetField
(
$request
,
$facet
);
break
;
case
Solarium_Query_Select_Component_Facet
::
QUERY
:
case
Solarium_Query_Select_Component_Facet
Set
::
FACET_
QUERY
:
$this
->
addFacetQuery
(
$request
,
$facet
);
break
;
case
Solarium_Query_Select_Component_Facet
::
MULTIQUERY
:
case
Solarium_Query_Select_Component_Facet
Set
::
FACET_
MULTIQUERY
:
$this
->
addFacetMultiQuery
(
$request
,
$facet
);
break
;
case
Solarium_Query_Select_Component_Facet
::
RANGE
:
case
Solarium_Query_Select_Component_Facet
Set
::
FACET_
RANGE
:
$this
->
addFacetRange
(
$request
,
$facet
);
break
;
default
:
...
...
library/Solarium/Client/RequestBuilder/Update.php
View file @
168e6a09
...
...
@@ -75,19 +75,19 @@ class Solarium_Client_RequestBuilder_Update extends Solarium_Client_RequestBuild
$xml
=
'<update>'
;
foreach
(
$query
->
getCommands
()
AS
$command
)
{
switch
(
$command
->
getType
())
{
case
Solarium_Query_Update
_Command
::
ADD
:
case
Solarium_Query_Update
::
COMMAND_
ADD
:
$xml
.=
$this
->
buildAddXml
(
$command
);
break
;
case
Solarium_Query_Update
_Command
::
DELETE
:
case
Solarium_Query_Update
::
COMMAND_
DELETE
:
$xml
.=
$this
->
buildDeleteXml
(
$command
);
break
;
case
Solarium_Query_Update
_Command
::
OPTIMIZE
:
case
Solarium_Query_Update
::
COMMAND_
OPTIMIZE
:
$xml
.=
$this
->
buildOptimizeXml
(
$command
);
break
;
case
Solarium_Query_Update
_Command
::
COMMIT
:
case
Solarium_Query_Update
::
COMMAND_
COMMIT
:
$xml
.=
$this
->
buildCommitXml
(
$command
);
break
;
case
Solarium_Query_Update
_Command
::
ROLLBACK
:
case
Solarium_Query_Update
::
COMMAND_
ROLLBACK
:
$xml
.=
$this
->
buildRollbackXml
();
break
;
default
:
...
...
library/Solarium/Client/ResponseParser/Select/Component/FacetSet.php
View file @
168e6a09
...
...
@@ -57,16 +57,16 @@ class Solarium_Client_ResponseParser_Select_Component_FacetSet
$facets
=
array
();
foreach
(
$facetSet
->
getFacets
()
AS
$key
=>
$facet
)
{
switch
(
$facet
->
getType
())
{
case
Solarium_Query_Select_Component_Facet
::
FIELD
:
case
Solarium_Query_Select_Component_Facet
Set
::
FACET_
FIELD
:
$result
=
$this
->
_facetField
(
$facet
,
$data
);
break
;
case
Solarium_Query_Select_Component_Facet
::
QUERY
:
case
Solarium_Query_Select_Component_Facet
Set
::
FACET_
QUERY
:
$result
=
$this
->
_facetQuery
(
$facet
,
$data
);
break
;
case
Solarium_Query_Select_Component_Facet
::
MULTIQUERY
:
case
Solarium_Query_Select_Component_Facet
Set
::
FACET_
MULTIQUERY
:
$result
=
$this
->
_facetMultiQuery
(
$facet
,
$data
);
break
;
case
Solarium_Query_Select_Component_Facet
::
RANGE
:
case
Solarium_Query_Select_Component_Facet
Set
::
FACET_
RANGE
:
$result
=
$this
->
_facetRange
(
$facet
,
$data
);
break
;
default
:
...
...
library/Solarium/Plugin/Abstract.php
View file @
168e6a09
...
...
@@ -148,5 +148,24 @@ abstract class Solarium_Plugin_Abstract extends Solarium_Configurable
public
function
postExecute
(
$query
,
$result
)
{
}
/**
* @param string $query
* @param mixed $options
* @return void|Solarium_Query
*/
public
function
preCreateQuery
(
$type
,
$options
)
{
}
/**
* @param string $query
* @param mixed $options
* @param Solarium_Query
* @return void
*/
public
function
postCreateQuery
(
$type
,
$options
,
$query
)
{
}
}
\ No newline at end of file
library/Solarium/Query/Select.php
View file @
168e6a09
...
...
@@ -468,6 +468,17 @@ class Solarium_Query_Select extends Solarium_Query
return
$this
;
}
/**
* Create a filterquery instance
*
* @param mixed $options
* @return Solarium_Query_Select_FilterQuery
*/
public
function
createFilterQuery
(
$options
=
null
)
{
return
new
Solarium_Query_Select_FilterQuery
(
$options
);
}
/**
* Add a filter query
*
...
...
library/Solarium/Query/Select/Component/Facet.php
View file @
168e6a09
...
...
@@ -46,14 +46,6 @@
abstract
class
Solarium_Query_Select_Component_Facet
extends
Solarium_Configurable
{
/**
* Constants for the facet types
*/
const
QUERY
=
'query'
;
const
FIELD
=
'field'
;
const
MULTIQUERY
=
'multiquery'
;
const
RANGE
=
'range'
;
/**
* Exclude tags for this facet
*
...
...
library/Solarium/Query/Select/Component/Facet/Field.php
View file @
168e6a09
...
...
@@ -74,7 +74,7 @@ class Solarium_Query_Select_Component_Facet_Field extends Solarium_Query_Select_
*/
public
function
getType
()
{
return
self
::
FIELD
;
return
Solarium_Query_Select_Component_FacetSet
::
FACET_
FIELD
;
}
/**
...
...
library/Solarium/Query/Select/Component/Facet/MultiQuery.php
View file @
168e6a09
...
...
@@ -81,7 +81,7 @@ class Solarium_Query_Select_Component_Facet_MultiQuery extends Solarium_Query_Se
*/
public
function
getType
()
{
return
self
::
MULTIQUERY
;
return
Solarium_Query_Select_Component_FacetSet
::
FACET_
MULTIQUERY
;
}
/**
...
...
library/Solarium/Query/Select/Component/Facet/Query.php
View file @
168e6a09
...
...
@@ -62,7 +62,7 @@ class Solarium_Query_Select_Component_Facet_Query extends Solarium_Query_Select_
*/
public
function
getType
()
{
return
self
::
QUERY
;
return
Solarium_Query_Select_Component_FacetSet
::
FACET_
QUERY
;
}
/**
...
...
library/Solarium/Query/Select/Component/Facet/Range.php
View file @
168e6a09
...
...
@@ -93,7 +93,7 @@ class Solarium_Query_Select_Component_Facet_Range extends Solarium_Query_Select_
*/
public
function
getType
()
{
return
self
::
RANGE
;
return
Solarium_Query_Select_Component_FacetSet
::
FACET_
RANGE
;
}
/**
...
...
library/Solarium/Query/Select/Component/FacetSet.php
View file @
168e6a09
...
...
@@ -46,6 +46,26 @@
class
Solarium_Query_Select_Component_FacetSet
extends
Solarium_Query_Select_Component
{
/**
* Facet type keys
*/
const
FACET_FIELD
=
'field'
;
const
FACET_QUERY
=
'query'
;
const
FACET_MULTIQUERY
=
'multiquery'
;
const
FACET_RANGE
=
'range'
;
/**
* Facet type mapping
*
* @var array
*/
protected
$_facetTypes
=
array
(
self
::
FACET_FIELD
=>
'Solarium_Query_Select_Component_Facet_Field'
,
self
::
FACET_QUERY
=>
'Solarium_Query_Select_Component_Facet_Query'
,
self
::
FACET_MULTIQUERY
=>
'Solarium_Query_Select_Component_Facet_MultiQuery'
,
self
::
FACET_RANGE
=>
'Solarium_Query_Select_Component_Facet_Range'
,
);
/**
* Component type
*
...
...
@@ -224,8 +244,7 @@ class Solarium_Query_Select_Component_FacetSet extends Solarium_Query_Select_Com
public
function
addFacet
(
$facet
)
{
if
(
is_array
(
$facet
))
{
$className
=
'Solarium_Query_Select_Component_Facet_'
.
ucfirst
(
$facet
[
'type'
]);
$facet
=
new
$className
(
$facet
);
$facet
=
$this
->
createFacet
(
$facet
[
'type'
],
$facet
);
}
$key
=
$facet
->
getKey
();
...
...
@@ -328,4 +347,65 @@ class Solarium_Query_Select_Component_FacetSet extends Solarium_Query_Select_Com
$this
->
addFacets
(
$facets
);
}
/**
* @param string $type
* @param array|object|null $options
* @return Solarium_Query_Select_Component_Facet
*/
public
function
createFacet
(
$type
,
$options
=
null
)
{
$type
=
strtolower
(
$type
);
if
(
!
isset
(
$this
->
_facetTypes
[
$type
]))
{
throw
new
Solarium_Exception
(
"Facettype unknown: "
.
$type
);
}
$class
=
$this
->
_facetTypes
[
$type
];
return
new
$class
(
$options
);
}
/**
* Get a facet field instance
*
* @param mixed $options
* @return Solarium_Query_Select_Component_Facet_Field
*/
public
function
createFacetField
(
$options
=
null
)
{
return
$this
->
createFacet
(
self
::
FACET_FIELD
,
$options
);
}
/**
* Get a facet query instance
*
* @param mixed $options
* @return Solarium_Query_Select_Component_Facet_Query
*/
public
function
createFacetQuery
(
$options
=
null
)
{
return
$this
->
createFacet
(
self
::
FACET_QUERY
,
$options
);
}
/**
* Get a facet multiquery instance
*
* @param mixed $options
* @return Solarium_Query_Select_Component_Facet_MultiQuery
*/
public
function
createFacetMultiQuery
(
$options
=
null
)
{
return
$this
->
createFacet
(
self
::
FACET_MULTIQUERY
,
$options
);
}
/**
* Get a facet range instance
*
* @param mixed $options
* @return Solarium_Query_Select_Component_Facet_Range
*/
public
function
createFacetRange
(
$options
=
null
)
{
return
$this
->
createFacet
(
self
::
FACET_RANGE
,
$options
);
}
}
\ No newline at end of file
library/Solarium/Query/Update.php
View file @
168e6a09
...
...
@@ -49,14 +49,26 @@ class Solarium_Query_Update extends Solarium_Query
{
/**
* Get type for this query
* Update command type names
*/
const
COMMAND_ADD
=
'add'
;
const
COMMAND_DELETE
=
'delete'
;
const
COMMAND_COMMIT
=
'commit'
;
const
COMMAND_ROLLBACK
=
'rollback'
;
const
COMMAND_OPTIMIZE
=
'optimize'
;
/**
* Update command types
*
* @
return string
* @
var array
*/
public
function
getType
()
{
return
Solarium_Client
::
QUERYTYPE_UPDATE
;
}
protected
$_commandTypes
=
array
(
self
::
COMMAND_ADD
=>
'Solarium_Query_Update_Command_Add'
,
self
::
COMMAND_DELETE
=>
'Solarium_Query_Update_Command_Delete'
,
self
::
COMMAND_COMMIT
=>
'Solarium_Query_Update_Command_Commit'
,
self
::
COMMAND_OPTIMIZE
=>
'Solarium_Query_Update_Command_Optimize'
,
self
::
COMMAND_ROLLBACK
=>
'Solarium_Query_Update_Command_Rollback'
,
);
/**
* Default options
...
...
@@ -78,6 +90,16 @@ class Solarium_Query_Update extends Solarium_Query
*/
protected
$_commands
=
array
();
/**
* Get type for this query
*
* @return string
*/
public
function
getType
()
{
return
Solarium_Client
::
QUERYTYPE_UPDATE
;
}
/**
* Initialize options
*
...
...
@@ -90,31 +112,41 @@ class Solarium_Query_Update extends Solarium_Query
{
if
(
isset
(
$this
->
_options
[
'command'
]))
{
foreach
(
$this
->
_options
[
'command'
]
as
$key
=>
$value
)
{
switch
(
$value
[
'type'
])
{
case
'delete'
:
$command
=
new
Solarium_Query_Update_Command_Delete
(
$value
);
break
;
case
'commit'
:
$command
=
new
Solarium_Query_Update_Command_Commit
(
$value
);
break
;
case
'optimize'
:
$command
=
new
Solarium_Query_Update_Command_Optimize
(
$value
);
break
;
case
'rollback'
:
$command
=
new
Solarium_Query_Update_Command_Rollback
(
$value
);
break
;
case
'add'
:
throw
new
Solarium_Exception
(
"Adding documents is not supported in configuration, use the API for this"
);
$type
=
$value
[
'type'
];
if
(
$type
==
self
::
COMMAND_ADD
)
{
throw
new
Solarium_Exception
(
"Adding documents is not supported in configuration, use the API for this"
);
}
$this
->
add
(
$key
,
$
command
);
$this
->
add
(
$key
,
$
this
->
createCommand
(
$type
,
$value
)
);
}
}
}
/**
* Create a command instance
*
* @throws Solarium_Exception
* @param string $type
* @param mixed $options
* @return Solarium_Query_Update_Command
*/
public
function
createCommand
(
$type
,
$options
=
null
)
{
$type
=
strtolower
(
$type
);
if
(
!
isset
(
$this
->
_commandTypes
[
$type
]))
{
throw
new
Solarium_Exception
(
"Update commandtype unknown: "
.
$type
);
}
$class
=
$this
->
_commandTypes
[
$type
];
return
new
$class
(
$options
);
}
/**
* Get all commands for this update query
*
...
...
library/Solarium/Query/Update/Command.php
View file @
168e6a09
...
...
@@ -44,15 +44,6 @@
abstract
class
Solarium_Query_Update_Command
extends
Solarium_Configurable
{
/**
* Command types
*/
const
ADD
=
'add'
;
const
DELETE
=
'delete'
;
const
COMMIT
=
'commit'
;
const
OPTIMIZE
=
'optimize'
;
const
ROLLBACK
=
'rollback'
;
/**
* Returns command type, for use in adapters
*
...
...
library/Solarium/Query/Update/Command/Add.php
View file @
168e6a09
...
...
@@ -61,7 +61,7 @@ class Solarium_Query_Update_Command_Add extends Solarium_Query_Update_Command
*/
public
function
getType
()
{
return
Solarium_Query_Update
_Command
::
ADD
;
return
Solarium_Query_Update
::
COMMAND_
ADD
;
}
/**
...
...
library/Solarium/Query/Update/Command/Commit.php
View file @
168e6a09
...
...
@@ -54,7 +54,7 @@ class Solarium_Query_Update_Command_Commit extends Solarium_Query_Update_Command
*/
public
function
getType
()
{
return
Solarium_Query_Update
_Command
::
COMMIT
;
return
Solarium_Query_Update
::
COMMAND_
COMMIT
;
}
/**
...
...
library/Solarium/Query/Update/Command/Delete.php
View file @
168e6a09
...
...
@@ -68,7 +68,7 @@ class Solarium_Query_Update_Command_Delete extends Solarium_Query_Update_Command
*/
public
function
getType
()
{
return
Solarium_Query_Update
_Command
::
DELETE
;
return
Solarium_Query_Update
::
COMMAND_
DELETE
;
}
/**
...
...
library/Solarium/Query/Update/Command/Optimize.php
View file @
168e6a09
...
...
@@ -54,7 +54,7 @@ class Solarium_Query_Update_Command_Optimize
*/
public
function
getType
()
{
return
Solarium_Query_Update
_Command
::
OPTIMIZE
;
return
Solarium_Query_Update
::
COMMAND_
OPTIMIZE
;
}
/**
...
...
library/Solarium/Query/Update/Command/Rollback.php
View file @
168e6a09
...
...
@@ -54,7 +54,7 @@ class Solarium_Query_Update_Command_Rollback
*/
public
function
getType
()
{
return
Solarium_Query_Update
_Command
::
ROLLBACK
;
return
Solarium_Query_Update
::
COMMAND_
ROLLBACK
;
}
}
\ No newline at end of file
tests/Solarium/ClientTest.php
View file @
168e6a09
...
...
@@ -44,7 +44,6 @@ class Solarium_ClientTest extends PHPUnit_Framework_TestCase
public
function
testGetAdapterWithDefaultAdapter
()
{
$defaultAdapter
=
$this
->
_client
->
getOption
(
'adapter'
);
$adapter
=
$this
->
_client
->
getAdapter
();
$this
->
assertThat
(
$adapter
,
$this
->
isInstanceOf
(
$defaultAdapter
));
...
...
tests/Solarium/Query/Select/Component/Facet/FieldTest.php
View file @
168e6a09
...
...
@@ -42,7 +42,7 @@ class Solarium_Query_Select_Component_Facet_FieldTest extends PHPUnit_Framework_
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Select_Component_Facet
::
FIELD
,
Solarium_Query_Select_Component_Facet
Set
::
FACET_
FIELD
,
$this
->
_facet
->
getType
()
);
}
...
...
tests/Solarium/Query/Select/Component/Facet/MultiQueryTest.php
View file @
168e6a09
...
...
@@ -45,7 +45,7 @@ class Solarium_Query_Select_Component_Facet_MultiQueryTest extends PHPUnit_Frame
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Select_Component_Facet
::
MULTIQUERY
,
Solarium_Query_Select_Component_Facet
Set
::
FACET_
MULTIQUERY
,
$this
->
_facet
->
getType
()
);
}
...
...
tests/Solarium/Query/Select/Component/Facet/QueryTest.php
View file @
168e6a09
...
...
@@ -42,7 +42,7 @@ class Solarium_Query_Select_Component_Facet_QueryTest extends PHPUnit_Framework_
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Select_Component_Facet
::
QUERY
,
Solarium_Query_Select_Component_Facet
Set
::
FACET_
QUERY
,
$this
->
_facet
->
getType
()
);
}
...
...
tests/Solarium/Query/Select/Component/Facet/RangeTest.php
View file @
168e6a09
...
...
@@ -42,7 +42,7 @@ class Solarium_Query_Select_Component_Facet_RangeTest extends PHPUnit_Framework_
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Select_Component_Facet
::
RANGE
,
Solarium_Query_Select_Component_Facet
Set
::
FACET_
RANGE
,
$this
->
_facet
->
getType
()
);
}
...
...
tests/Solarium/Query/Update/Command/AddTest.php
View file @
168e6a09
...
...
@@ -41,7 +41,7 @@ class Solarium_Query_Update_Command_AddTest extends PHPUnit_Framework_TestCase
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
ADD
,
Solarium_Query_Update
::
COMMAND_
ADD
,
$this
->
_command
->
getType
()
);
}
...
...
tests/Solarium/Query/Update/Command/CommitTest.php
View file @
168e6a09
...
...
@@ -41,7 +41,7 @@ class Solarium_Query_Update_Command_CommitTest extends PHPUnit_Framework_TestCas
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
COMMIT
,
Solarium_Query_Update
::
COMMAND_
COMMIT
,
$this
->
_command
->
getType
()
);
}
...
...
tests/Solarium/Query/Update/Command/DeleteTest.php
View file @
168e6a09
...
...
@@ -41,7 +41,7 @@ class Solarium_Query_Update_Command_DeleteTest extends PHPUnit_Framework_TestCas
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
DELETE
,
Solarium_Query_Update
::
COMMAND_
DELETE
,
$this
->
_command
->
getType
()
);
}
...
...
tests/Solarium/Query/Update/Command/OptimizeTest.php
View file @
168e6a09
...
...
@@ -41,7 +41,7 @@ class Solarium_Query_Update_Command_OptimizeTest extends PHPUnit_Framework_TestC
public
function
testGetType
()
{
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
OPTIMIZE
,
Solarium_Query_Update
::
COMMAND_
OPTIMIZE
,
$this
->
_command
->
getType
()
);
}
...
...
tests/Solarium/Query/Update/Command/RollbackTest.php
View file @
168e6a09
...
...
@@ -35,7 +35,7 @@ class Solarium_Query_Update_Command_RollbackTest extends PHPUnit_Framework_TestC
{
$command
=
new
Solarium_Query_Update_Command_Rollback
;
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
ROLLBACK
,
Solarium_Query_Update
::
COMMAND_
ROLLBACK
,
$command
->
getType
()
);
}
...
...
tests/Solarium/Query/UpdateTest.php
View file @
168e6a09
...
...
@@ -107,7 +107,7 @@ class Solarium_Query_UpdateTest extends PHPUnit_Framework_TestCase
$commands
=
$this
->
_query
->
getCommands
();
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
ROLLBACK
,
Solarium_Query_Update
::
COMMAND_
ROLLBACK
,
$commands
[
0
]
->
getType
()
);
}
...
...
@@ -118,7 +118,7 @@ class Solarium_Query_UpdateTest extends PHPUnit_Framework_TestCase
$commands
=
$this
->
_query
->
getCommands
();
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
DELETE
,
Solarium_Query_Update
::
COMMAND_
DELETE
,
$commands
[
0
]
->
getType
()
);
...
...
@@ -134,7 +134,7 @@ class Solarium_Query_UpdateTest extends PHPUnit_Framework_TestCase
$commands
=
$this
->
_query
->
getCommands
();
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
DELETE
,
Solarium_Query_Update
::
COMMAND_
DELETE
,
$commands
[
0
]
->
getType
()
);
...
...
@@ -150,7 +150,7 @@ class Solarium_Query_UpdateTest extends PHPUnit_Framework_TestCase
$commands
=
$this
->
_query
->
getCommands
();
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
DELETE
,
Solarium_Query_Update
::
COMMAND_
DELETE
,
$commands
[
0
]
->
getType
()
);
...
...
@@ -166,7 +166,7 @@ class Solarium_Query_UpdateTest extends PHPUnit_Framework_TestCase
$commands
=
$this
->
_query
->
getCommands
();
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
DELETE
,
Solarium_Query_Update
::
COMMAND_
DELETE
,
$commands
[
0
]
->
getType
()
);
...
...
@@ -184,7 +184,7 @@ class Solarium_Query_UpdateTest extends PHPUnit_Framework_TestCase
$commands
=
$this
->
_query
->
getCommands
();
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
ADD
,
Solarium_Query_Update
::
COMMAND_
ADD
,
$commands
[
0
]
->
getType
()
);
...
...
@@ -203,7 +203,7 @@ class Solarium_Query_UpdateTest extends PHPUnit_Framework_TestCase
$commands
=
$this
->
_query
->
getCommands
();
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
ADD
,
Solarium_Query_Update
::
COMMAND_
ADD
,
$commands
[
0
]
->
getType
()
);
...
...
@@ -229,7 +229,7 @@ class Solarium_Query_UpdateTest extends PHPUnit_Framework_TestCase
$commands
=
$this
->
_query
->
getCommands
();
$this
->
assertEquals
(
Solarium_Query_Update
_Command
::
COMMIT
,
Solarium_Query_Update
::
COMMAND_
COMMIT
,
$commands
[
0
]
->
getType
()
);
...
...
@@ -255,7 +255,8 @@ class Solarium_Query_UpdateTest extends PHPUnit_Framework_TestCase
$commands
=
$this
->
_query
->
getCommands
();
$this
->
assertEquals
(
Solarium_Query_Update_Command
::
OPTIMIZE
,
Solarium_Query_Update
::
COMMAND_OPTIMIZE
,
Solarium_Query_Update
::
COMMAND_OPTIMIZE
,
$commands
[
0
]
->
getType
()
);
...
...
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