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
5f61e63a
Commit
5f61e63a
authored
Jan 19, 2018
by
thePanz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'master'
parents
75ac5576
243d9ac0
Changes
57
Hide whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
126 additions
and
129 deletions
+126
-129
.travis.yml
.travis.yml
+7
-0
library/Solarium/Core/Client/Adapter/Curl.php
library/Solarium/Core/Client/Adapter/Curl.php
+1
-1
library/Solarium/Core/Client/Adapter/Guzzle.php
library/Solarium/Core/Client/Adapter/Guzzle.php
+1
-0
library/Solarium/Core/Client/Adapter/Guzzle3.php
library/Solarium/Core/Client/Adapter/Guzzle3.php
+1
-2
library/Solarium/Core/Client/Adapter/Http.php
library/Solarium/Core/Client/Adapter/Http.php
+16
-4
library/Solarium/Core/Client/Response.php
library/Solarium/Core/Client/Response.php
+1
-1
library/Solarium/Core/Query/Helper.php
library/Solarium/Core/Query/Helper.php
+2
-2
library/Solarium/Plugin/BufferedAdd/BufferedAdd.php
library/Solarium/Plugin/BufferedAdd/BufferedAdd.php
+2
-2
library/Solarium/Plugin/CustomizeRequest/CustomizeRequest.php
...ary/Solarium/Plugin/CustomizeRequest/CustomizeRequest.php
+1
-1
library/Solarium/QueryType/Analysis/ResponseParser/Field.php
library/Solarium/QueryType/Analysis/ResponseParser/Field.php
+2
-2
library/Solarium/QueryType/Analysis/Result/Types.php
library/Solarium/QueryType/Analysis/Result/Types.php
+0
-4
library/Solarium/QueryType/Extract/RequestBuilder.php
library/Solarium/QueryType/Extract/RequestBuilder.php
+0
-1
library/Solarium/QueryType/Ping/Query.php
library/Solarium/QueryType/Ping/Query.php
+0
-1
library/Solarium/QueryType/Select/Query/Component/DisMax.php
library/Solarium/QueryType/Select/Query/Component/DisMax.php
+0
-1
library/Solarium/QueryType/Select/Query/Component/DistributedSearch.php
...um/QueryType/Select/Query/Component/DistributedSearch.php
+0
-1
library/Solarium/QueryType/Select/Query/Component/Grouping.php
...ry/Solarium/QueryType/Select/Query/Component/Grouping.php
+4
-0
library/Solarium/QueryType/Select/Query/Component/Spatial.php
...ary/Solarium/QueryType/Select/Query/Component/Spatial.php
+0
-1
library/Solarium/QueryType/Select/Query/Component/Stats/Stats.php
...Solarium/QueryType/Select/Query/Component/Stats/Stats.php
+4
-0
library/Solarium/QueryType/Select/RequestBuilder/Component/DisMax.php
...rium/QueryType/Select/RequestBuilder/Component/DisMax.php
+1
-1
library/Solarium/QueryType/Select/RequestBuilder/Component/EdisMax.php
...ium/QueryType/Select/RequestBuilder/Component/EdisMax.php
+1
-1
library/Solarium/QueryType/Select/ResponseParser/ResponseParser.php
...larium/QueryType/Select/ResponseParser/ResponseParser.php
+4
-4
library/Solarium/QueryType/Update/RequestBuilder.php
library/Solarium/QueryType/Update/RequestBuilder.php
+5
-6
library/Solarium/Support/DataFixtures/Loader.php
library/Solarium/Support/DataFixtures/Loader.php
+1
-1
phpunit.xml.dist
phpunit.xml.dist
+7
-1
tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php
tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php
+9
-10
tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php
tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php
+5
-6
tests/Solarium/Tests/Core/Client/Adapter/HttpTest.php
tests/Solarium/Tests/Core/Client/Adapter/HttpTest.php
+7
-3
tests/Solarium/Tests/Core/Client/Adapter/PeclHttpTest.php
tests/Solarium/Tests/Core/Client/Adapter/PeclHttpTest.php
+1
-1
tests/Solarium/Tests/Core/Client/ClientTest.php
tests/Solarium/Tests/Core/Client/ClientTest.php
+2
-4
tests/Solarium/Tests/Core/Event/PostCreateResultTest.php
tests/Solarium/Tests/Core/Event/PostCreateResultTest.php
+0
-1
tests/Solarium/Tests/Core/Event/PostExecuteTest.php
tests/Solarium/Tests/Core/Event/PostExecuteTest.php
+0
-1
tests/Solarium/Tests/Core/Event/PreCreateResultTest.php
tests/Solarium/Tests/Core/Event/PreCreateResultTest.php
+0
-1
tests/Solarium/Tests/Core/Event/PreExecuteTest.php
tests/Solarium/Tests/Core/Event/PreExecuteTest.php
+0
-1
tests/Solarium/Tests/Plugin/BufferedAdd/Event/PostCommitTest.php
...olarium/Tests/Plugin/BufferedAdd/Event/PostCommitTest.php
+0
-1
tests/Solarium/Tests/Plugin/BufferedAdd/Event/PostFlushTest.php
...Solarium/Tests/Plugin/BufferedAdd/Event/PostFlushTest.php
+0
-1
tests/Solarium/Tests/Plugin/Loadbalancer/WeightedRandomChoiceTest.php
...um/Tests/Plugin/Loadbalancer/WeightedRandomChoiceTest.php
+1
-1
tests/Solarium/Tests/Plugin/MinimumScoreFilter/ResultTest.php
...s/Solarium/Tests/Plugin/MinimumScoreFilter/ResultTest.php
+1
-1
tests/Solarium/Tests/Plugin/PrefetchIteratorTest.php
tests/Solarium/Tests/Plugin/PrefetchIteratorTest.php
+3
-3
tests/Solarium/Tests/QueryType/Extract/RequestBuilderTest.php
...s/Solarium/Tests/QueryType/Extract/RequestBuilderTest.php
+1
-3
tests/Solarium/Tests/QueryType/MoreLikeThis/QueryTest.php
tests/Solarium/Tests/QueryType/MoreLikeThis/QueryTest.php
+1
-1
tests/Solarium/Tests/QueryType/RealtimeGet/RequestBuilderTest.php
...larium/Tests/QueryType/RealtimeGet/RequestBuilderTest.php
+0
-1
tests/Solarium/Tests/QueryType/Select/Query/AbstractQueryTest.php
...larium/Tests/QueryType/Select/Query/AbstractQueryTest.php
+3
-3
tests/Solarium/Tests/QueryType/Select/Query/Component/DistributedSearchTest.php
...ueryType/Select/Query/Component/DistributedSearchTest.php
+6
-6
tests/Solarium/Tests/QueryType/Select/Query/Component/Facet/FieldTest.php
...ests/QueryType/Select/Query/Component/Facet/FieldTest.php
+2
-2
tests/Solarium/Tests/QueryType/Select/Query/Component/Facet/PivotTest.php
...ests/QueryType/Select/Query/Component/Facet/PivotTest.php
+1
-1
tests/Solarium/Tests/QueryType/Select/Query/Component/FacetSetTest.php
...m/Tests/QueryType/Select/Query/Component/FacetSetTest.php
+3
-3
tests/Solarium/Tests/QueryType/Select/Query/Component/Highlighting/FieldTest.php
...eryType/Select/Query/Component/Highlighting/FieldTest.php
+1
-2
tests/Solarium/Tests/QueryType/Select/Query/Component/Highlighting/HighlightingTest.php
.../Select/Query/Component/Highlighting/HighlightingTest.php
+1
-1
tests/Solarium/Tests/QueryType/Select/Query/Component/Stats/StatsTest.php
...ests/QueryType/Select/Query/Component/Stats/StatsTest.php
+1
-1
tests/Solarium/Tests/QueryType/Select/RequestBuilder/RequestBuilderTest.php
...ts/QueryType/Select/RequestBuilder/RequestBuilderTest.php
+1
-1
tests/Solarium/Tests/QueryType/Select/ResponseParser/Component/DebugTest.php
...s/QueryType/Select/ResponseParser/Component/DebugTest.php
+6
-6
tests/Solarium/Tests/QueryType/Select/ResponseParser/Component/StatsTest.php
...s/QueryType/Select/ResponseParser/Component/StatsTest.php
+1
-1
tests/Solarium/Tests/QueryType/Select/Result/AbstractDocumentTest.php
...um/Tests/QueryType/Select/Result/AbstractDocumentTest.php
+4
-14
tests/Solarium/Tests/QueryType/Select/Result/ResultTest.php
tests/Solarium/Tests/QueryType/Select/Result/ResultTest.php
+0
-4
tests/Solarium/Tests/QueryType/Terms/ResponseParserTest.php
tests/Solarium/Tests/QueryType/Terms/ResponseParserTest.php
+2
-2
tests/Solarium/Tests/QueryType/Update/Query/Command/AddTest.php
...Solarium/Tests/QueryType/Update/Query/Command/AddTest.php
+1
-1
tests/Solarium/Tests/QueryType/Update/RequestBuilderTest.php
tests/Solarium/Tests/QueryType/Update/RequestBuilderTest.php
+1
-3
No files found.
.travis.yml
View file @
5f61e63a
language
:
php
dist
:
trusty
php
:
-
7.1
-
7.0
-
5.6
-
5.5
...
...
@@ -15,6 +18,10 @@ env:
-
SYMFONY_VERSION=2.8.*
-
SYMFONY_VERSION=3.0.*
# Does not work with php below 5.5
cache
:
directories
:
-
$HOME/.composer/cache
before_script
:
-
bash -c "if [ $TRAVIS_PHP_VERSION != 'hhvm' ] && [ $TRAVIS_PHP_VERSION != '7.0' ] && [ $TRAVIS_PHP_VERSION != 'nightly' ]; then printf '\n\n\n\n' | pecl install pecl_http-1.7.6; fi"
-
composer require --prefer-source --dev symfony/event-dispatcher:${SYMFONY_VERSION}
...
...
library/Solarium/Core/Client/Adapter/Curl.php
View file @
5f61e63a
...
...
@@ -116,7 +116,7 @@ class Curl extends Configurable implements AdapterInterface
$handler
=
curl_init
();
curl_setopt
(
$handler
,
CURLOPT_URL
,
$uri
);
curl_setopt
(
$handler
,
CURLOPT_RETURNTRANSFER
,
true
);
if
(
!
ini_get
(
'open_basedir'
))
{
if
(
!
(
function_exists
(
'ini_get'
)
&&
ini_get
(
'open_basedir'
)
))
{
curl_setopt
(
$handler
,
CURLOPT_FOLLOWLOCATION
,
true
);
}
curl_setopt
(
$handler
,
CURLOPT_TIMEOUT
,
$options
[
'timeout'
]);
...
...
library/Solarium/Core/Client/Adapter/Guzzle.php
View file @
5f61e63a
...
...
@@ -74,6 +74,7 @@ class Guzzle extends Configurable implements AdapterInterface
RequestOptions
::
HEADERS
=>
$this
->
getRequestHeaders
(
$request
),
RequestOptions
::
BODY
=>
$this
->
getRequestBody
(
$request
),
RequestOptions
::
TIMEOUT
=>
$endpoint
->
getTimeout
(),
RequestOptions
::
CONNECT_TIMEOUT
=>
$endpoint
->
getTimeout
(),
];
// Try endpoint authentication first, fallback to request for backwards compatibility
...
...
library/Solarium/Core/Client/Adapter/Guzzle3.php
View file @
5f61e63a
...
...
@@ -41,7 +41,6 @@ namespace Solarium\Core\Client\Adapter;
use
Guzzle\Http\Client
as
GuzzleClient
;
use
Solarium\Core\Configurable
;
use
Solarium\Core\Client\Adapter\AdapterInterface
;
use
Solarium\Core\Client\Request
;
use
Solarium\Core\Client\Response
;
use
Solarium\Core\Client\Endpoint
;
...
...
@@ -76,7 +75,7 @@ class Guzzle3 extends Configurable implements AdapterInterface
$this
->
getRequestBody
(
$request
),
array
(
'timeout'
=>
$endpoint
->
getTimeout
(),
'connecttimeout'
=>
$endpoint
->
getTimeout
(),
'connect
_
timeout'
=>
$endpoint
->
getTimeout
(),
)
);
...
...
library/Solarium/Core/Client/Adapter/Http.php
View file @
5f61e63a
...
...
@@ -111,13 +111,25 @@ class Http extends Configurable implements AdapterInterface
if
(
$method
==
Request
::
METHOD_POST
)
{
if
(
$request
->
getFileUpload
())
{
$boundary
=
'----------'
.
md5
(
time
());
$CRLF
=
"
\r\n
"
;
$file
=
$request
->
getFileUpload
();
$filename
=
basename
(
$file
);
// Add the proper boundary to the Content-Type header
$request
->
addHeader
(
"Content-Type: multipart/form-data; boundary=
{
$boundary
}
"
);
$data
=
"--
{
$boundary
}
"
.
$CRLF
;
$data
.=
'Content-Disposition: form-data; name="upload"; filename='
.
$filename
.
$CRLF
;
$data
.=
'Content-Type: application/octet-stream'
.
$CRLF
.
$CRLF
;
$data
.=
file_get_contents
(
$request
->
getFileUpload
())
.
$CRLF
;
$data
.=
'--'
.
$boundary
.
'--'
;
$content_length
=
strlen
(
$data
);
$request
->
addHeader
(
"Content-Length:
$content_length
\r\n
"
);
stream_context_set_option
(
$context
,
'http'
,
'content'
,
file_get_contents
(
$request
->
getFileUpload
())
$data
);
$request
->
addHeader
(
'Content-Type: multipart/form-data'
);
}
else
{
$data
=
$request
->
getRawData
();
if
(
null
!==
$data
)
{
...
...
@@ -171,10 +183,10 @@ class Http extends Configurable implements AdapterInterface
// @codeCoverageIgnoreStart
$data
=
@
file_get_contents
(
$uri
,
false
,
$context
);
$headers
=
array
();
if
(
isset
(
$http_response_header
))
{
$headers
=
$http_response_header
;
}
else
{
$headers
=
array
();
}
return
array
(
$data
,
$headers
);
...
...
library/Solarium/Core/Client/Response.php
View file @
5f61e63a
...
...
@@ -157,7 +157,7 @@ class Response
// $statusInfo[1] = the HTTP response code
// $statusInfo[2] = the response message
$statusInfo
=
explode
(
' '
,
$statusHeader
,
3
);
$this
->
statusCode
=
$statusInfo
[
1
];
$this
->
statusCode
=
(
int
)
$statusInfo
[
1
];
$this
->
statusMessage
=
$statusInfo
[
2
];
}
}
library/Solarium/Core/Query/Helper.php
View file @
5f61e63a
...
...
@@ -460,10 +460,10 @@ class Helper
*/
public
function
cacheControl
(
$useCache
,
$cost
=
null
)
{
$cache
=
'false'
;
if
(
$useCache
===
true
)
{
$cache
=
'true'
;
}
else
{
$cache
=
'false'
;
}
$result
=
'{!cache='
.
$cache
;
...
...
library/Solarium/Plugin/BufferedAdd/BufferedAdd.php
View file @
5f61e63a
...
...
@@ -223,7 +223,7 @@ class BufferedAdd extends AbstractPlugin
$this
->
client
->
getEventDispatcher
()
->
dispatch
(
Events
::
PRE_FLUSH
,
$event
);
$this
->
updateQuery
->
addDocuments
(
$event
->
getBuffer
(),
$event
->
getOverwrite
(),
$event
->
getCommitWithin
());
$result
=
$this
->
client
->
update
(
$this
->
updateQuery
,
$this
->
getEnd
p
oint
());
$result
=
$this
->
client
->
update
(
$this
->
updateQuery
,
$this
->
getEnd
P
oint
());
$this
->
clear
();
$event
=
new
PostFlushEvent
(
$result
);
...
...
@@ -251,7 +251,7 @@ class BufferedAdd extends AbstractPlugin
$this
->
updateQuery
->
addDocuments
(
$this
->
buffer
,
$event
->
getOverwrite
());
$this
->
updateQuery
->
addCommit
(
$event
->
getSoftCommit
(),
$event
->
getWaitSearcher
(),
$event
->
getExpungeDeletes
());
$result
=
$this
->
client
->
update
(
$this
->
updateQuery
,
$this
->
getEnd
p
oint
());
$result
=
$this
->
client
->
update
(
$this
->
updateQuery
,
$this
->
getEnd
P
oint
());
$this
->
clear
();
$event
=
new
PostCommitEvent
(
$result
);
...
...
library/Solarium/Plugin/CustomizeRequest/CustomizeRequest.php
View file @
5f61e63a
...
...
@@ -44,7 +44,7 @@ use Solarium\Core\Plugin\AbstractPlugin;
use
Solarium\Exception\InvalidArgumentException
;
use
Solarium\Exception\RuntimeException
;
use
Solarium\Core\Event\Events
;
use
Solarium\Core\Event\
p
reExecuteRequest
as
preExecuteRequestEvent
;
use
Solarium\Core\Event\
P
reExecuteRequest
as
preExecuteRequestEvent
;
/**
* CustomizeRequest plugin.
...
...
library/Solarium/QueryType/Analysis/ResponseParser/Field.php
View file @
5f61e63a
...
...
@@ -64,10 +64,10 @@ class Field extends ResponseParserAbstract implements ResponseParserInterface
{
$data
=
$result
->
getData
();
$items
=
array
();
if
(
isset
(
$data
[
'analysis'
]))
{
$items
=
$this
->
parseAnalysis
(
$result
,
$data
[
'analysis'
]);
}
else
{
$items
=
array
();
}
return
$this
->
addHeaderInfo
(
$data
,
array
(
'items'
=>
$items
));
...
...
library/Solarium/QueryType/Analysis/Result/Types.php
View file @
5f61e63a
...
...
@@ -64,8 +64,6 @@ class Types extends ResultList
return
$item
;
}
}
return
;
}
/**
...
...
@@ -80,7 +78,5 @@ class Types extends ResultList
return
$item
;
}
}
return
;
}
}
library/Solarium/QueryType/Extract/RequestBuilder.php
View file @
5f61e63a
...
...
@@ -107,7 +107,6 @@ class RequestBuilder extends BaseRequestBuilder
}
elseif
(
is_readable
(
$file
))
{
$request
->
setFileUpload
(
$file
);
$request
->
addParam
(
'resource.name'
,
basename
(
$query
->
getFile
()));
$request
->
addHeader
(
'Content-Type: multipart/form-data'
);
}
else
{
throw
new
RuntimeException
(
'Extract query file path/url invalid or not available'
);
}
...
...
library/Solarium/QueryType/Ping/Query.php
View file @
5f61e63a
...
...
@@ -88,6 +88,5 @@ class Query extends BaseQuery
*/
public
function
getResponseParser
()
{
return
;
}
}
library/Solarium/QueryType/Select/Query/Component/DisMax.php
View file @
5f61e63a
...
...
@@ -92,7 +92,6 @@ class DisMax extends AbstractComponent
*/
public
function
getResponseParser
()
{
return
;
}
/**
...
...
library/Solarium/QueryType/Select/Query/Component/DistributedSearch.php
View file @
5f61e63a
...
...
@@ -97,7 +97,6 @@ class DistributedSearch extends AbstractComponent
*/
public
function
getResponseParser
()
{
return
;
}
/**
...
...
library/Solarium/QueryType/Select/Query/Component/Grouping.php
View file @
5f61e63a
...
...
@@ -191,11 +191,15 @@ class Grouping extends AbstractComponent
* This overwrites any existing fields
*
* @param array $fields
*
* @return self Provides fluent interface
*/
public
function
setFields
(
$fields
)
{
$this
->
clearFields
();
$this
->
addFields
(
$fields
);
return
$this
;
}
/**
...
...
library/Solarium/QueryType/Select/Query/Component/Spatial.php
View file @
5f61e63a
...
...
@@ -37,7 +37,6 @@ class Spatial extends AbstractComponent
*/
public
function
getResponseParser
()
{
return
;
}
/**
...
...
library/Solarium/QueryType/Select/Query/Component/Stats/Stats.php
View file @
5f61e63a
...
...
@@ -248,11 +248,15 @@ class Stats extends AbstractComponent
* This overwrites any existing fields
*
* @param array $fields
*
* @return self Provides fluent interface
*/
public
function
setFields
(
$fields
)
{
$this
->
clearFields
();
$this
->
addFields
(
$fields
);
return
$this
;
}
/**
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/DisMax.php
View file @
5f61e63a
...
...
@@ -40,7 +40,7 @@
namespace
Solarium\QueryType\Select\RequestBuilder\Component
;
use
Solarium\QueryType\Select\Query\Component\Dis
m
ax
as
DismaxComponent
;
use
Solarium\QueryType\Select\Query\Component\Dis
M
ax
as
DismaxComponent
;
use
Solarium\Core\Client\Request
;
/**
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/EdisMax.php
View file @
5f61e63a
...
...
@@ -40,7 +40,7 @@
namespace
Solarium\QueryType\Select\RequestBuilder\Component
;
use
Solarium\QueryType\Select\Query\Component\Edis
m
ax
as
EdismaxComponent
;
use
Solarium\QueryType\Select\Query\Component\Edis
M
ax
as
EdismaxComponent
;
use
Solarium\Core\Client\Request
;
/**
...
...
library/Solarium/QueryType/Select/ResponseParser/ResponseParser.php
View file @
5f61e63a
...
...
@@ -95,16 +95,16 @@ class ResponseParser extends ResponseParserAbstract implements ResponseParserInt
}
}
$numFound
=
null
;
if
(
isset
(
$data
[
'response'
][
'numFound'
]))
{
$numFound
=
$data
[
'response'
][
'numFound'
];
}
else
{
$numFound
=
null
;
}
$maxScore
=
null
;
if
(
isset
(
$data
[
'response'
][
'maxScore'
]))
{
$maxScore
=
$data
[
'response'
][
'maxScore'
];
}
else
{
$maxScore
=
null
;
}
return
$this
->
addHeaderInfo
(
...
...
library/Solarium/QueryType/Update/RequestBuilder.php
View file @
5f61e63a
...
...
@@ -229,10 +229,6 @@ class RequestBuilder extends BaseRequestBuilder
*/
protected
function
buildFieldXml
(
$name
,
$boost
,
$value
,
$modifier
=
null
,
$query
=
null
)
{
if
(
$value
instanceof
\DateTime
)
{
$value
=
$query
->
getHelper
()
->
formatDate
(
$value
);
}
$xml
=
'<field name="'
.
$name
.
'"'
;
$xml
.=
$this
->
attrib
(
'boost'
,
$boost
);
$xml
.=
$this
->
attrib
(
'update'
,
$modifier
);
...
...
@@ -242,10 +238,13 @@ class RequestBuilder extends BaseRequestBuilder
$value
=
'false'
;
}
elseif
(
$value
===
true
)
{
$value
=
'true'
;
}
elseif
(
$value
instanceof
\DateTime
)
{
$value
=
$query
->
getHelper
()
->
formatDate
(
$value
);
}
else
{
$value
=
htmlspecialchars
(
$value
,
ENT_NOQUOTES
,
'UTF-8'
);
}
$xml
.=
'>'
.
htmlspecialchars
(
$value
,
ENT_NOQUOTES
,
'UTF-8'
);
$xml
.=
'</field>'
;
$xml
.=
'>'
.
$value
.
'</field>'
;
return
$xml
;
}
...
...
library/Solarium/Support/DataFixtures/Loader.php
View file @
5f61e63a
...
...
@@ -66,7 +66,7 @@ class Loader
if
((
$fileName
=
$file
->
getBasename
(
$this
->
fileExtension
))
==
$file
->
getBasename
())
{
continue
;
}
$sourceFile
=
realpath
(
$file
->
getPath
N
ame
());
$sourceFile
=
realpath
(
$file
->
getPath
n
ame
());
/** @noinspection PhpIncludeInspection */
require_once
$sourceFile
;
$includedFiles
[]
=
$sourceFile
;
...
...
phpunit.xml.dist
View file @
5f61e63a
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals=
"false"
backupStaticAttributes=
"false"
syntaxCheck=
"false"
bootstrap=
"tests/bootstrap.php"
>
<phpunit
backupGlobals=
"false"
backupStaticAttributes=
"false"
syntaxCheck=
"false"
bootstrap=
"tests/bootstrap.php"
colors=
"true"
>
<testsuites>
<testsuite
name=
"Solarium"
>
...
...
tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php
View file @
5f61e63a
...
...
@@ -33,7 +33,6 @@ namespace Solarium\Tests\Core\Client\Adapter;
use
Guzzle\Plugin\Mock\MockPlugin
;
use
Guzzle\Http\Message\Response
;
use
Guzzle\Http\Client
as
GuzzleClient
;
use
Solarium\Core\Client\Adapter\Guzzle3
as
GuzzleAdapter
;
use
Solarium\Core\Client\Request
;
use
Solarium\Core\Client\Endpoint
;
...
...
@@ -89,7 +88,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response
=
$this
->
adapter
->
execute
(
$request
,
$endpoint
);
$this
->
assertSame
(
'OK'
,
$response
->
getStatusMessage
());
$this
->
assertSame
(
'200'
,
$response
->
getStatusCode
());
$this
->
assertSame
(
200
,
$response
->
getStatusCode
());
$this
->
assertSame
(
array
(
'HTTP/1.1 200 OK'
,
...
...
@@ -102,7 +101,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$receivedRequests
=
$plugin
->
getReceivedRequests
();
$this
->
assert
Same
(
1
,
count
(
$receivedRequests
)
);
$this
->
assert
Count
(
1
,
$receivedRequests
);
$this
->
assertSame
(
'GET'
,
$receivedRequests
[
0
]
->
getMethod
());
$this
->
assertSame
(
...
...
@@ -136,7 +135,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response
=
$this
->
adapter
->
execute
(
$request
,
$endpoint
);
$this
->
assertSame
(
'OK'
,
$response
->
getStatusMessage
());
$this
->
assertSame
(
'200'
,
$response
->
getStatusCode
());
$this
->
assertSame
(
200
,
$response
->
getStatusCode
());
$this
->
assertSame
(
array
(
'HTTP/1.1 200 OK'
,
...
...
@@ -149,10 +148,10 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$receivedRequests
=
$plugin
->
getReceivedRequests
();
$this
->
assert
Same
(
1
,
count
(
$receivedRequests
)
);
$this
->
assert
Count
(
1
,
$receivedRequests
);
$this
->
assertSame
(
'POST'
,
$receivedRequests
[
0
]
->
getMethod
());
$this
->
assertS
ame
(
file_get_contents
(
__FILE__
)
,
(
string
)
$receivedRequests
[
0
]
->
getBody
());
$this
->
assertS
tringEqualsFile
(
__FILE__
,
(
string
)
$receivedRequests
[
0
]
->
getBody
());
$this
->
assertSame
(
'request value'
,
(
string
)
$receivedRequests
[
0
]
->
getHeader
(
'X-PHPUnit'
)
...
...
@@ -185,7 +184,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response
=
$this
->
adapter
->
execute
(
$request
,
$endpoint
);
$this
->
assertSame
(
'OK'
,
$response
->
getStatusMessage
());
$this
->
assertSame
(
'200'
,
$response
->
getStatusCode
());
$this
->
assertSame
(
200
,
$response
->
getStatusCode
());
$this
->
assertSame
(
array
(
'HTTP/1.1 200 OK'
,
...
...
@@ -198,7 +197,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$receivedRequests
=
$plugin
->
getReceivedRequests
();
$this
->
assert
Same
(
1
,
count
(
$receivedRequests
)
);
$this
->
assert
Count
(
1
,
$receivedRequests
);
$this
->
assertSame
(
'POST'
,
$receivedRequests
[
0
]
->
getMethod
());
$this
->
assertSame
(
$xml
,
(
string
)
$receivedRequests
[
0
]
->
getBody
());
...
...
@@ -237,7 +236,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response
=
$this
->
adapter
->
execute
(
$request
,
$endpoint
);
$this
->
assertSame
(
'OK'
,
$response
->
getStatusMessage
());
$this
->
assertSame
(
'200'
,
$response
->
getStatusCode
());
$this
->
assertSame
(
200
,
$response
->
getStatusCode
());
$this
->
assertSame
(
array
(
'HTTP/1.1 200 OK'
,
...
...
@@ -250,7 +249,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$receivedRequests
=
$plugin
->
getReceivedRequests
();
$this
->
assert
Same
(
1
,
count
(
$receivedRequests
)
);
$this
->
assert
Count
(
1
,
$receivedRequests
);
$this
->
assertSame
(
'GET'
,
$receivedRequests
[
0
]
->
getMethod
());
$this
->
assertSame
(
...
...
tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php
View file @
5f61e63a
...
...
@@ -35,7 +35,6 @@
namespace
Solarium\Tests\Core\Client\Adapter
;
use
GuzzleHttp\Client
as
GuzzleClient
;
use
GuzzleHttp\Handler\MockHandler
;
use
GuzzleHttp\HandlerStack
;
use
GuzzleHttp\Middleware
;
...
...
@@ -94,7 +93,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response
=
$adapter
->
execute
(
$request
,
$endpoint
);
$this
->
assertSame
(
'OK'
,
$response
->
getStatusMessage
());
$this
->
assertSame
(
'200'
,
$response
->
getStatusCode
());
$this
->
assertSame
(
200
,
$response
->
getStatusCode
());
$this
->
assertSame
(
array
(
'HTTP/1.1 200 OK'
,
...
...
@@ -141,7 +140,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response
=
$adapter
->
execute
(
$request
,
$endpoint
);
$this
->
assertSame
(
'OK'
,
$response
->
getStatusMessage
());
$this
->
assertSame
(
'200'
,
$response
->
getStatusCode
());
$this
->
assertSame
(
200
,
$response
->
getStatusCode
());
$this
->
assertSame
(
array
(
'HTTP/1.1 200 OK'
,
...
...
@@ -155,7 +154,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$this
->
assertCount
(
1
,
$container
);
$this
->
assertSame
(
'POST'
,
$container
[
0
][
'request'
]
->
getMethod
());
$this
->
assertSame
(
'request value'
,
$container
[
0
][
'request'
]
->
getHeaderline
(
'X-PHPUnit'
));
$this
->
assertS
ame
(
file_get_contents
(
__FILE__
)
,
(
string
)
$container
[
0
][
'request'
]
->
getBody
());
$this
->
assertS
tringEqualsFile
(
__FILE__
,
(
string
)
$container
[
0
][
'request'
]
->
getBody
());
}
/**
...
...
@@ -190,7 +189,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response
=
$adapter
->
execute
(
$request
,
$endpoint
);
$this
->
assertSame
(
'OK'
,
$response
->
getStatusMessage
());
$this
->
assertSame
(
'200'
,
$response
->
getStatusCode
());
$this
->
assertSame
(
200
,
$response
->
getStatusCode
());
$this
->
assertSame
(
array
(
'HTTP/1.1 200 OK'
,
...
...
@@ -239,7 +238,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response
=
$adapter
->
execute
(
$request
,
$endpoint
);
$this
->
assertSame
(
'OK'
,
$response
->
getStatusMessage
());
$this
->
assertSame
(
'200'
,
$response
->
getStatusCode
());
$this
->
assertSame
(
200
,
$response
->
getStatusCode
());
$this
->
assertSame
(
array
(
'HTTP/1.1 200 OK'
,
...
...
tests/Solarium/Tests/Core/Client/Adapter/HttpTest.php
View file @
5f61e63a
...
...
@@ -184,16 +184,20 @@ class HttpTest extends \PHPUnit_Framework_TestCase
$context
=
$this
->
adapter
->
createContext
(
$request
,
$endpoint
);
// Remove content from comparison, since we can't determine the
// random boundary string.
$stream_context_get_options
=
stream_context_get_options
(
$context
);
unset
(
$stream_context_get_options
[
'http'
][
'content'
]);
unset
(
$stream_context_get_options
[
'http'
][
'header'
]);
$this
->
assertEquals
(
array
(
'http'
=>
array
(
'method'
=>
$method
,
'timeout'
=>
$timeout
,
'content'
=>
file_get_contents
(
__FILE__
),
'header'
=>
'Content-Type: multipart/form-data'
,
)
),
stream_context_get_options
(
$context
)
$stream_context_get_options
);
}
...
...
tests/Solarium/Tests/Core/Client/Adapter/PeclHttpTest.php
View file @
5f61e63a
...
...
@@ -211,7 +211,7 @@ EOF;
$response
=
$mock
->
execute
(
$request
,
$endpoint
);
$this
->
assertEquals
(
$body
,
$response
->
getBody
());
$this
->
assert
Equals
(
$statusCode
,
$response
->
getStatusCode
());
$this
->
assert
Same
(
$statusCode
,
$response
->
getStatusCode
());
$this
->
assertEquals
(
$statusMessage
,
$response
->
getStatusMessage
());
}
...
...
tests/Solarium/Tests/Core/Client/ClientTest.php
View file @
5f61e63a
...
...
@@ -551,7 +551,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
->
method
(
'getRequestBuilder'
)
->
will
(
$this
->
returnValue
(
$observer
));
$this
->
client
->
registerQueryType
(
'testquerytype'
,
'Solarium\QueryType\Select\Query\Query'
,
$observer
,
''
);
$this
->
client
->
registerQueryType
(
'testquerytype'
,
'Solarium\QueryType\Select\Query\Query'
);
$this
->
client
->
createRequest
(
$queryStub
);
}
...
...
@@ -1293,9 +1293,7 @@ class MyAdapter extends ClientAdapterHttp
{
public
function
execute
(
$request
,
$endpoint
)
{
$response
=
new
Response
(
'{}'
,
array
(
'HTTP/1.1 200 OK'
));
return
$response
;
return
new
Response
(
'{}'
,
array
(
'HTTP/1.1 200 OK'
));
}
}
...
...
tests/Solarium/Tests/Core/Event/PostCreateResultTest.php
View file @
5f61e63a
...
...
@@ -33,7 +33,6 @@ namespace Solarium\Tests\Core\Event;
use
Solarium\Core\Client\Client
;
use
Solarium\Core\Event\PostCreateResult
;
use
Solarium\QueryType\Select\Query\Query
;
use
Solarium\Core\Client\Response
;
use
Solarium\Core\Query\Result\Result
;
...
...
tests/Solarium/Tests/Core/Event/PostExecuteTest.php
View file @
5f61e63a
...
...
@@ -33,7 +33,6 @@ namespace Solarium\Tests\Core\Event;
use
Solarium\Core\Event\PostExecute
;
use
Solarium\Core\Client\Client
;
use
Solarium\QueryType\Select\Query\Query
;
use
Solarium\Core\Client\Response
;
use
Solarium\Core\Query\Result\Result
;
...
...
tests/Solarium/Tests/Core/Event/PreCreateResultTest.php
View file @
5f61e63a
...
...
@@ -33,7 +33,6 @@ namespace Solarium\Tests\Core\Event;
use
Solarium\Core\Client\Client
;
use
Solarium\Core\Event\PreCreateResult
;
use
Solarium\QueryType\Select\Query\Query
;
use
Solarium\Core\Client\Response
;
use
Solarium\Core\Query\Result\Result
;
...
...
tests/Solarium/Tests/Core/Event/PreExecuteTest.php
View file @
5f61e63a
...
...
@@ -33,7 +33,6 @@ namespace Solarium\Tests\Core\Event;
use
Solarium\Core\Event\PreExecute
;
use
Solarium\Core\Client\Client
;
use
Solarium\QueryType\Select\Query\Query
;
use
Solarium\Core\Client\Response
;
use
Solarium\Core\Query\Result\Result
;
...
...
tests/Solarium/Tests/Plugin/BufferedAdd/Event/PostCommitTest.php
View file @
5f61e63a
...
...
@@ -32,7 +32,6 @@
namespace
Solarium\Tests\Plugin\BufferedAdd\Event
;
use
Solarium\Plugin\BufferedAdd\Event\PostCommit
;
use
Solarium\QueryType\Select\Query\Query
;
use
Solarium\Core\Client\Client
;
use
Solarium\Core\Client\Response
;
use
Solarium\Core\Query\Result\Result
;
...
...
tests/Solarium/Tests/Plugin/BufferedAdd/Event/PostFlushTest.php
View file @
5f61e63a
...
...
@@ -32,7 +32,6 @@
namespace
Solarium\Tests\Plugin\BufferedAdd\Event
;
use
Solarium\Plugin\BufferedAdd\Event\PostFlush
;
use
Solarium\QueryType\Select\Query\Query
;
use
Solarium\Core\Client\Client
;
use
Solarium\Core\Client\Response
;
use
Solarium\Core\Query\Result\Result
;
...
...
tests/Solarium/Tests/Plugin/Loadbalancer/WeightedRandomChoiceTest.php
View file @
5f61e63a
...
...
@@ -65,7 +65,7 @@ class WeightedRandomChoiceTest extends \PHPUnit_Framework_TestCase
$key
=
$randomizer
->
getRandom
(
$excludes
);
$this
->
assert
True
(
$key
!==
'key3'
);
$this
->
assert
NotSame
(
$key
,
'key3'
);
}
public
function
testAllEntriesExcluded
()
...
...
tests/Solarium/Tests/Plugin/MinimumScoreFilter/ResultTest.php
View file @
5f61e63a
...
...
@@ -85,7 +85,7 @@ class ResultTest extends AbstractResultTest
$result
=
new
FilterResultDummy
(
1
,
12
,
$this
->
numFound
,
$this
->
maxScore
,
$this
->
docs
,
$this
->
components
,
Query
::
FILTER_MODE_REMOVE
);
$docs
=
$result
->
getDocuments
();
$this
->
assert
Equals
(
3
,
count
(
$docs
)
);
$this
->
assert
Count
(
3
,
$docs
);
$this
->
assertEquals
(
$docs
[
0
]
->
title
,
$this
->
docs
[
0
]
->
title
);
$this
->
assertEquals
(
$docs
[
1
]
->
title
,
$this
->
docs
[
1
]
->
title
);
$this
->
assertEquals
(
$docs
[
2
]
->
title
,
$this
->
docs
[
2
]
->
title
);
...
...
tests/Solarium/Tests/Plugin/PrefetchIteratorTest.php
View file @
5f61e63a
...
...
@@ -86,7 +86,7 @@ class PrefetchIteratorTest extends \PHPUnit_Framework_TestCase
$this
->
plugin
->
initPlugin
(
$mockClient
,
array
());
$this
->
plugin
->
setQuery
(
$this
->
query
);
$this
->
assert
Equals
(
5
,
count
(
$this
->
plugin
)
);
$this
->
assert
Count
(
5
,
$this
->
plugin
);
}
public
function
testIteratorAndRewind
()
...
...
@@ -200,7 +200,7 @@ class PrefetchIteratorTest extends \PHPUnit_Framework_TestCase
$this
->
plugin
->
initPlugin
(
$mockClient
,
array
());
$this
->
plugin
->
setQuery
(
$this
->
query
)
->
setEndpoint
(
's2'
);
$this
->
assert
Equals
(
5
,
count
(
$this
->
plugin
)
);
$this
->
assert
Count
(
5
,
$this
->
plugin
);
}
public
function
testWithSpecificEndpointOption
()
...
...
@@ -214,7 +214,7 @@ class PrefetchIteratorTest extends \PHPUnit_Framework_TestCase
$this
->
plugin
->
initPlugin
(
$mockClient
,
array
(
'endpoint'
=>
's3'
));
$this
->
plugin
->
setQuery
(
$this
->
query
);
$this
->
assert
Equals
(
5
,
count
(
$this
->
plugin
)
);
$this
->
assert
Count
(
5
,
$this
->
plugin
);
}
}
...
...
tests/Solarium/Tests/QueryType/Extract/RequestBuilderTest.php
View file @
5f61e63a
...
...
@@ -134,9 +134,7 @@ class RequestBuilderTest extends \PHPUnit_Framework_TestCase
public
function
testContentTypeHeader
()
{
$headers
=
array
(
'Content-Type: multipart/form-data'
);
$headers
=
array
();
$request
=
$this
->
builder
->
build
(
$this
->
query
);
$this
->
assertEquals
(
$headers
,
$request
->
getHeaders
());
...
...
tests/Solarium/Tests/QueryType/MoreLikeThis/QueryTest.php
View file @
5f61e63a
...
...
@@ -467,7 +467,7 @@ class QueryTest extends \PHPUnit_Framework_TestCase
);
$components
=
$query
->
getComponents
();
$this
->
assert
Equals
(
1
,
count
(
$components
)
);
$this
->
assert
Count
(
1
,
$components
);
$this
->
assertThat
(
array_pop
(
$components
),
$this
->
isInstanceOf
(
'Solarium\QueryType\Select\Query\Component\FacetSet'
)
...
...
tests/Solarium/Tests/QueryType/RealtimeGet/RequestBuilderTest.php
View file @
5f61e63a
...
...
@@ -31,7 +31,6 @@
namespace
Solarium\Tests\QueryType\RealtimeGet
;
use
Solarium\Core\Client\Request
;
use
Solarium\QueryType\RealtimeGet\Query
;
use
Solarium\QueryType\RealtimeGet\RequestBuilder
;
...
...
tests/Solarium/Tests/QueryType/Select/Query/AbstractQueryTest.php
View file @
5f61e63a
...
...
@@ -262,7 +262,7 @@ abstract class AbstractQueryTest extends \PHPUnit_Framework_TestCase
{
$key
=
'fq1'
;
$fq
=
$this
->
query
->
createFilterQuery
(
$key
,
true
);
$fq
=
$this
->
query
->
createFilterQuery
(
$key
);
$fq
->
setQuery
(
'category:1'
);
$this
->
assertEquals
(
...
...
@@ -470,7 +470,7 @@ abstract class AbstractQueryTest extends \PHPUnit_Framework_TestCase
);
$components
=
$query
->
getComponents
();
$this
->
assert
Equals
(
1
,
count
(
$components
)
);
$this
->
assert
Count
(
1
,
$components
);
$this
->
assertThat
(
array_pop
(
$components
),
$this
->
isInstanceOf
(
'Solarium\QueryType\Select\Query\Component\FacetSet'
)
...
...
@@ -612,7 +612,7 @@ abstract class AbstractQueryTest extends \PHPUnit_Framework_TestCase
$components
=
$this
->
query
->
getComponentTypes
();
$components
[
'mykey'
]
=
'mycomponent'
;
$this
->
query
->
registerComponentType
(
'mykey'
,
'mycomponent'
,
'mybuilder'
,
'myparser'
);
$this
->
query
->
registerComponentType
(
'mykey'
,
'mycomponent'
);
$this
->
assertEquals
(
$components
,
...
...
tests/Solarium/Tests/QueryType/Select/Query/Component/DistributedSearchTest.php
View file @
5f61e63a
...
...
@@ -138,7 +138,7 @@ class DistributedSearchTest extends \PHPUnit_Framework_TestCase
$this
->
distributedSearch
->
clearShards
();
$shards
=
$this
->
distributedSearch
->
getShards
();
$this
->
assertTrue
(
is_array
(
$shards
));
$this
->
assert
Equals
(
0
,
count
(
$shards
)
);
$this
->
assert
Count
(
0
,
$shards
);
}
public
function
testAddShards
()
...
...
@@ -167,7 +167,7 @@ class DistributedSearchTest extends \PHPUnit_Framework_TestCase
)
);
$shards
=
$this
->
distributedSearch
->
getShards
();
$this
->
assert
Equals
(
3
,
count
(
$shards
)
);
$this
->
assert
Count
(
3
,
$shards
);
$this
->
assertEquals
(
array
(
'shard3'
=>
'localhost:8983/solr/shard3'
,
...
...
@@ -216,7 +216,7 @@ class DistributedSearchTest extends \PHPUnit_Framework_TestCase
$this
->
distributedSearch
->
clearCollections
();
$collections
=
$this
->
distributedSearch
->
getCollections
();
$this
->
assertTrue
(
is_array
(
$collections
));
$this
->
assert
Equals
(
0
,
count
(
$collections
)
);
$this
->
assert
Count
(
0
,
$collections
);
}
public
function
testAddCollections
()
...
...
@@ -245,7 +245,7 @@ class DistributedSearchTest extends \PHPUnit_Framework_TestCase
)
);
$collections
=
$this
->
distributedSearch
->
getCollections
();
$this
->
assert
Equals
(
3
,
count
(
$collections
)
);
$this
->
assert
Count
(
3
,
$collections
);
$this
->
assertEquals
(
array
(
'collection3'
=>
'localhost:8983/solr/collection3'
,
...
...
@@ -285,7 +285,7 @@ class DistributedSearchTest extends \PHPUnit_Framework_TestCase
$this
->
distributedSearch
->
clearReplicas
();
$replicas
=
$this
->
distributedSearch
->
getReplicas
();
$this
->
assertTrue
(
is_array
(
$replicas
));
$this
->
assert
Equals
(
0
,
count
(
$replicas
)
);
$this
->
assert
Count
(
0
,
$replicas
);
}
public
function
testAddReplicas
()
...
...
@@ -314,7 +314,7 @@ class DistributedSearchTest extends \PHPUnit_Framework_TestCase
)
);
$replicas
=
$this
->
distributedSearch
->
getReplicas
();
$this
->
assert
Equals
(
3
,
count
(
$replicas
)
);
$this
->
assert
Count
(
3
,
$replicas
);
$this
->
assertEquals
(
array
(
'replica3'
=>
'localhost:8983/solr/replica3'
,
...
...
tests/Solarium/Tests/QueryType/Select/Query/Component/Facet/FieldTest.php
View file @
5f61e63a
...
...
@@ -117,8 +117,8 @@ class FieldTest extends \PHPUnit_Framework_TestCase
public
function
testSetAndGetMinCount
()
{
$this
->
facet
->
setMin
c
ount
(
100
);
$this
->
assertEquals
(
100
,
$this
->
facet
->
getMin
c
ount
());
$this
->
facet
->
setMin
C
ount
(
100
);
$this
->
assertEquals
(
100
,
$this
->
facet
->
getMin
C
ount
());
}
public
function
testSetAndGetMissing
()
...
...
tests/Solarium/Tests/QueryType/Select/Query/Component/Facet/PivotTest.php
View file @
5f61e63a
...
...
@@ -157,7 +157,7 @@ class PivotTest extends \PHPUnit_Framework_TestCase
$this
->
facet
->
clearStats
();
$this
->
facet
->
addStats
(
array
(
'stat1'
,
'stat2'
));
$this
->
facet
->
removeStat
(
'stat1'
);
$this
->
assertEquals
(
array
(
'stat2'
),
$this
->
facet
->
get
s
tats
());
$this
->
assertEquals
(
array
(
'stat2'
),
$this
->
facet
->
get
S
tats
());
}
public
function
testSetStats
()
...
...
tests/Solarium/Tests/QueryType/Select/Query/Component/FacetSetTest.php
View file @
5f61e63a
...
...
@@ -69,7 +69,7 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
2
,
count
(
$facets
));
$this
->
assertEquals
(
$options
[
'prefix'
],
$this
->
facetSet
->
getPrefix
());
$this
->
assertEquals
(
$options
[
'sort'
],
$this
->
facetSet
->
getSort
());
$this
->
assertEquals
(
$options
[
'mincount'
],
$this
->
facetSet
->
getMin
c
ount
());
$this
->
assertEquals
(
$options
[
'mincount'
],
$this
->
facetSet
->
getMin
C
ount
());
$this
->
assertEquals
(
$options
[
'missing'
],
$this
->
facetSet
->
getMissing
());
$this
->
assertEquals
(
$options
[
'extractfromresponse'
],
$this
->
facetSet
->
getExtractFromResponse
());
$this
->
assertEquals
(
$options
[
'contains'
],
$this
->
facetSet
->
getContains
());
...
...
@@ -117,8 +117,8 @@ class FacetSetTest extends \PHPUnit_Framework_TestCase
public
function
testSetAndGetMinCount
()
{
$this
->
facetSet
->
setMin
c
ount
(
100
);
$this
->
assertEquals
(
100
,
$this
->
facetSet
->
getMin
c
ount
());
$this
->
facetSet
->
setMin
C
ount
(
100
);
$this
->
assertEquals
(
100
,
$this
->
facetSet
->
getMin
C
ount
());
}
public
function
testSetAndGetMissing
()
...
...
tests/Solarium/Tests/QueryType/Select/Query/Component/Highlighting/FieldTest.php
View file @
5f61e63a
...
...
@@ -33,7 +33,6 @@ namespace Solarium\Tests\QueryType\Select\Query\Component\Highlighting;
use
Solarium\QueryType\Select\Query\Component\Highlighting\Highlighting
;
use
Solarium\QueryType\Select\Query\Component\Highlighting\Field
;
use
Solarium\QueryType\Select\Query\Query
;
class
FieldTest
extends
\PHPUnit_Framework_TestCase
{
...
...
@@ -101,7 +100,7 @@ class FieldTest extends \PHPUnit_Framework_TestCase
public
function
testSetAndGetFragSize
()
{
$value
=
20
;
$this
->
fld
->
setFrag
s
ize
(
$value
);
$this
->
fld
->
setFrag
S
ize
(
$value
);
$this
->
assertEquals
(
$value
,
...
...
tests/Solarium/Tests/QueryType/Select/Query/Component/Highlighting/HighlightingTest.php
View file @
5f61e63a
...
...
@@ -294,7 +294,7 @@ class HighlightingTest extends \PHPUnit_Framework_TestCase
public
function
testSetAndGetFragSize
()
{
$value
=
20
;
$this
->
hlt
->
setFrag
s
ize
(
$value
);
$this
->
hlt
->
setFrag
S
ize
(
$value
);
$this
->
assertEquals
(
$value
,
...
...
tests/Solarium/Tests/QueryType/Select/Query/Component/Stats/StatsTest.php
View file @
5f61e63a
...
...
@@ -139,7 +139,7 @@ class StatsTest extends \PHPUnit_Framework_TestCase
{
$key
=
'f1'
;
$fld
=
$this
->
stats
->
createField
(
$key
,
true
);
$fld
=
$this
->
stats
->
createField
(
$key
);
$this
->
assertEquals
(
$key
,
...
...
tests/Solarium/Tests/QueryType/Select/RequestBuilder/RequestBuilderTest.php
View file @
5f61e63a
...
...
@@ -163,7 +163,7 @@ class RequestBuilderTest extends \PHPUnit_Framework_TestCase
public
function
testWithEdismaxComponent
()
{
$this
->
query
->
getE
d
isMax
();
$this
->
query
->
getE
D
isMax
();
$request
=
$this
->
builder
->
build
(
$this
->
query
);
$this
->
assertEquals
(
...
...
tests/Solarium/Tests/QueryType/Select/ResponseParser/Component/DebugTest.php
View file @
5f61e63a
...
...
@@ -124,7 +124,7 @@ class DebugTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
'dummy-qp'
,
$result
->
getQueryParser
());
$this
->
assertEquals
(
'dummy-oq'
,
$result
->
getOtherQuery
());
$this
->
assert
Equals
(
1
,
count
(
$result
->
getExplain
()
));
$this
->
assert
Count
(
1
,
$result
->
getExplain
(
));
$doc
=
$result
->
getExplain
()
->
getDocument
(
'MA147LL/A'
);
$this
->
assertEquals
(
0.5
,
$doc
->
getValue
());
$this
->
assertEquals
(
true
,
$doc
->
getMatch
());
...
...
@@ -146,7 +146,7 @@ class DebugTest extends \PHPUnit_Framework_TestCase
)
);
$this
->
assertEquals
(
array
(
$expectedDetail
),
$doc
->
getDetails
());
$this
->
assert
Equals
(
1
,
count
(
$result
->
getExplainOther
()
));
$this
->
assert
Count
(
1
,
$result
->
getExplainOther
(
));
$doc
=
$result
->
getExplainOther
()
->
getDocument
(
'IW-02'
);
$this
->
assertEquals
(
0.6
,
$doc
->
getValue
());
$this
->
assertEquals
(
true
,
$doc
->
getMatch
());
...
...
@@ -158,10 +158,10 @@ class DebugTest extends \PHPUnit_Framework_TestCase
$timing
=
$result
->
getTiming
();
$this
->
assertEquals
(
36
,
$timing
->
getTime
());
$this
->
assert
Equals
(
2
,
count
(
$timing
->
getPhases
()
));
$this
->
assert
Count
(
2
,
$timing
->
getPhases
(
));
$phase
=
$timing
->
getPhase
(
'process'
);
$this
->
assertEquals
(
8
,
$phase
->
getTime
());
$this
->
assert
Equals
(
2
,
count
(
$phase
->
getTimings
()
));
$this
->
assert
Count
(
2
,
$phase
->
getTimings
(
));
$this
->
assertEquals
(
5
,
$phase
->
getTiming
(
'org.apache.solr.handler.component.QueryComponent'
));
$this
->
assertEquals
(
3
,
$phase
->
getTiming
(
'org.apache.solr.handler.component.MoreLikeThisComponent'
));
}
...
...
@@ -183,8 +183,8 @@ class DebugTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
'dummy-qp'
,
$result
->
getQueryParser
());
$this
->
assertEquals
(
'dummy-oq'
,
$result
->
getOtherQuery
());
$this
->
assert
Equals
(
0
,
count
(
$result
->
getExplain
()
));
$this
->
assert
Equals
(
0
,
count
(
$result
->
getExplainOther
()
));
$this
->
assert
Count
(
0
,
$result
->
getExplain
(
));
$this
->
assert
Count
(
0
,
$result
->
getExplainOther
(
));
}
public
function
testParseNoData
()
...
...
tests/Solarium/Tests/QueryType/Select/ResponseParser/Component/StatsTest.php
View file @
5f61e63a
...
...
@@ -76,6 +76,6 @@ class StatsTest extends \PHPUnit_Framework_TestCase
public
function
testParseNoData
()
{
$result
=
$this
->
parser
->
parse
(
null
,
null
,
array
());
$this
->
assert
Equals
(
0
,
count
(
$result
)
);
$this
->
assert
Count
(
0
,
$result
);
}
}
tests/Solarium/Tests/QueryType/Select/Result/AbstractDocumentTest.php
View file @
5f61e63a
...
...
@@ -73,13 +73,8 @@ abstract class AbstractDocumentTest extends \PHPUnit_Framework_TestCase
public
function
testPropertyEmpty
()
{
$this
->
assertTrue
(
empty
(
$this
->
doc
->
empty_field
)
);
$this
->
assertFalse
(
empty
(
$this
->
doc
->
categories
)
);
$this
->
assertEmpty
(
$this
->
doc
->
empty_field
);
$this
->
assertNotEmpty
(
$this
->
doc
->
categories
);
}
public
function
testSetField
()
...
...
@@ -124,13 +119,8 @@ abstract class AbstractDocumentTest extends \PHPUnit_Framework_TestCase
public
function
testArrayEmpty
()
{
$this
->
assertTrue
(
empty
(
$this
->
doc
[
'empty_field'
])
);
$this
->
assertFalse
(
empty
(
$this
->
doc
[
'categories'
])
);
$this
->
assertEmpty
(
$this
->
doc
[
'empty_field'
]);
$this
->
assertNotEmpty
(
$this
->
doc
[
'categories'
]);
}
public
function
testArraySet
()
...
...
tests/Solarium/Tests/QueryType/Select/Result/ResultTest.php
View file @
5f61e63a
...
...
@@ -33,8 +33,4 @@ namespace Solarium\Tests\QueryType\Select\Result;
class
ResultTest
extends
AbstractResultTest
{
public
function
setUp
()
{
parent
::
setUp
();
}
}
tests/Solarium/Tests/QueryType/Terms/ResponseParserTest.php
View file @
5f61e63a
...
...
@@ -85,7 +85,7 @@ class ResponseParserTest extends \PHPUnit_Framework_TestCase
);
$this
->
assertEquals
(
$expected
,
$result
[
'results'
]);
$this
->
assert
Equals
(
2
,
count
(
$result
[
'results'
])
);
$this
->
assert
Count
(
2
,
$result
[
'results'
]
);
}
public
function
testParseSolr14Format
()
...
...
@@ -139,6 +139,6 @@ class ResponseParserTest extends \PHPUnit_Framework_TestCase
);
$this
->
assertEquals
(
$expected
,
$result
[
'results'
]);
$this
->
assert
Equals
(
2
,
count
(
$result
[
'results'
])
);
$this
->
assert
Count
(
2
,
$result
[
'results'
]
);
}
}
tests/Solarium/Tests/QueryType/Update/Query/Command/AddTest.php
View file @
5f61e63a
...
...
@@ -71,7 +71,7 @@ class AddTest extends \PHPUnit_Framework_TestCase
}
try
{
$doc
=
new
\
StdClass
()
;
$doc
=
new
\
stdClass
;
$this
->
command
->
addDocument
(
$doc
);
$this
->
fail
(
...
...
tests/Solarium/Tests/QueryType/Update/RequestBuilderTest.php
View file @
5f61e63a
...
...
@@ -437,11 +437,9 @@ class RequestBuilderTest extends \PHPUnit_Framework_TestCase
public
function
testBuildRollbackXml
()
{
$command
=
new
RollbackCommand
;
$this
->
assertEquals
(
'<rollback/>'
,
$this
->
builder
->
buildRollbackXml
(
$command
)
$this
->
builder
->
buildRollbackXml
()
);
}
...
...
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