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
a5a462f8
Commit
a5a462f8
authored
Sep 10, 2015
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #360 from basdenooijer/develop
Improvements based on SensioLabs Insight analysis
parents
b473ccaa
ad6e9508
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
67 additions
and
47 deletions
+67
-47
library/Solarium/Client.php
library/Solarium/Client.php
+2
-2
library/Solarium/Core/Client/Client.php
library/Solarium/Core/Client/Client.php
+43
-26
library/Solarium/Core/Configurable.php
library/Solarium/Core/Configurable.php
+4
-4
library/Solarium/Core/Query/AbstractRequestBuilder.php
library/Solarium/Core/Query/AbstractRequestBuilder.php
+1
-1
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
+1
-1
library/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php
...ary/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php
+0
-1
library/Solarium/QueryType/Extract/RequestBuilder.php
library/Solarium/QueryType/Extract/RequestBuilder.php
+1
-1
library/Solarium/QueryType/MoreLikeThis/ResponseParser.php
library/Solarium/QueryType/MoreLikeThis/ResponseParser.php
+1
-1
library/Solarium/QueryType/MoreLikeThis/Result.php
library/Solarium/QueryType/MoreLikeThis/Result.php
+1
-1
library/Solarium/QueryType/Select/Query/Component/FacetSet.php
...ry/Solarium/QueryType/Select/Query/Component/FacetSet.php
+0
-1
library/Solarium/QueryType/Select/Query/Component/Stats/Stats.php
...Solarium/QueryType/Select/Query/Component/Stats/Stats.php
+0
-1
library/Solarium/QueryType/Select/Query/Query.php
library/Solarium/QueryType/Select/Query/Query.php
+1
-2
library/Solarium/QueryType/Update/Result.php
library/Solarium/QueryType/Update/Result.php
+2
-2
tests/Solarium/Tests/Core/Client/ClientTest.php
tests/Solarium/Tests/Core/Client/ClientTest.php
+10
-3
No files found.
library/Solarium/Client.php
View file @
a5a462f8
...
@@ -95,7 +95,7 @@ class Client extends CoreClient
...
@@ -95,7 +95,7 @@ class Client extends CoreClient
* - 1.2.4 (higher)
* - 1.2.4 (higher)
*
*
*
*
*
@internal a
string compare is used instead of version_compare because
*
A
string compare is used instead of version_compare because
* version_compare returns false for a compare of 1.0.0 with 1.0
* version_compare returns false for a compare of 1.0.0 with 1.0
*
*
* @param string $version
* @param string $version
...
...
library/Solarium/Core/Client/Client.php
View file @
a5a462f8
...
@@ -217,6 +217,23 @@ class Client extends Configurable
...
@@ -217,6 +217,23 @@ class Client extends Configurable
*/
*/
protected
$adapter
;
protected
$adapter
;
/**
* Constructor.
*
* If options are passed they will be merged with {@link $options} using
* the {@link setOptions()} method.
*
* If an EventDispatcher instance is provided this will be used instead of creating a new instance
*
* @param array|\Zend_Config $options
* @param EventDispatcher $eventDispatcher
*/
public
function
__construct
(
$options
=
null
,
$eventDispatcher
=
null
)
{
$this
->
eventDispatcher
=
$eventDispatcher
;
parent
::
__construct
(
$options
);
}
/**
/**
* Create a endpoint instance.
* Create a endpoint instance.
*
*
...
@@ -243,7 +260,7 @@ class Client extends Configurable
...
@@ -243,7 +260,7 @@ class Client extends Configurable
if
(
$endpoint
->
getKey
()
!==
null
)
{
if
(
$endpoint
->
getKey
()
!==
null
)
{
$this
->
addEndpoint
(
$endpoint
);
$this
->
addEndpoint
(
$endpoint
);
if
(
$setAsDefault
==
true
)
{
if
(
$setAsDefault
==
=
true
)
{
$this
->
setDefaultEndpoint
(
$endpoint
);
$this
->
setDefaultEndpoint
(
$endpoint
);
}
}
}
}
...
@@ -276,7 +293,6 @@ class Client extends Configurable
...
@@ -276,7 +293,6 @@ class Client extends Configurable
}
}
//double add calls for the same endpoint are ignored, but non-unique keys cause an exception
//double add calls for the same endpoint are ignored, but non-unique keys cause an exception
//@todo add trigger_error with a notice for double add calls?
if
(
array_key_exists
(
$key
,
$this
->
endpoints
)
&&
$this
->
endpoints
[
$key
]
!==
$endpoint
)
{
if
(
array_key_exists
(
$key
,
$this
->
endpoints
)
&&
$this
->
endpoints
[
$key
]
!==
$endpoint
)
{
throw
new
InvalidArgumentException
(
'An endpoint must have a unique key'
);
throw
new
InvalidArgumentException
(
'An endpoint must have a unique key'
);
}
else
{
}
else
{
...
@@ -799,6 +815,9 @@ class Client extends Configurable
...
@@ -799,6 +815,9 @@ class Client extends Configurable
/**
/**
* Execute a ping query.
* Execute a ping query.
*
*
* This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
*
* Example usage:
* Example usage:
* <code>
* <code>
* $client = new Solarium\Client;
* $client = new Solarium\Client;
...
@@ -808,9 +827,6 @@ class Client extends Configurable
...
@@ -808,9 +827,6 @@ class Client extends Configurable
*
*
* @see Solarium\QueryType\Ping
* @see Solarium\QueryType\Ping
*
*
* @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
*
* @param QueryInterface|\Solarium\QueryType\Ping\Query $query
* @param QueryInterface|\Solarium\QueryType\Ping\Query $query
* @param Endpoint|string|null $endpoint
* @param Endpoint|string|null $endpoint
*
*
...
@@ -824,6 +840,9 @@ class Client extends Configurable
...
@@ -824,6 +840,9 @@ class Client extends Configurable
/**
/**
* Execute an update query.
* Execute an update query.
*
*
* This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
*
* Example usage:
* Example usage:
* <code>
* <code>
* $client = new Solarium\Client;
* $client = new Solarium\Client;
...
@@ -835,9 +854,6 @@ class Client extends Configurable
...
@@ -835,9 +854,6 @@ class Client extends Configurable
* @see Solarium\QueryType\Update
* @see Solarium\QueryType\Update
* @see Solarium\Result\Update
* @see Solarium\Result\Update
*
*
* @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
*
* @param QueryInterface|\Solarium\QueryType\Update\Query\Query $query
* @param QueryInterface|\Solarium\QueryType\Update\Query\Query $query
* @param Endpoint|string|null $endpoint
* @param Endpoint|string|null $endpoint
*
*
...
@@ -851,6 +867,9 @@ class Client extends Configurable
...
@@ -851,6 +867,9 @@ class Client extends Configurable
/**
/**
* Execute a select query.
* Execute a select query.
*
*
* This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
*
* Example usage:
* Example usage:
* <code>
* <code>
* $client = new Solarium\Client;
* $client = new Solarium\Client;
...
@@ -861,9 +880,6 @@ class Client extends Configurable
...
@@ -861,9 +880,6 @@ class Client extends Configurable
* @see Solarium\QueryType\Select
* @see Solarium\QueryType\Select
* @see Solarium\Result\Select
* @see Solarium\Result\Select
*
*
* @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
*
* @param QueryInterface|\Solarium\QueryType\Select\Query\Query $query
* @param QueryInterface|\Solarium\QueryType\Select\Query\Query $query
* @param Endpoint|string|null $endpoint
* @param Endpoint|string|null $endpoint
*
*
...
@@ -877,6 +893,9 @@ class Client extends Configurable
...
@@ -877,6 +893,9 @@ class Client extends Configurable
/**
/**
* Execute a MoreLikeThis query.
* Execute a MoreLikeThis query.
*
*
* This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
*
* Example usage:
* Example usage:
* <code>
* <code>
* $client = new Solarium\Client;
* $client = new Solarium\Client;
...
@@ -887,9 +906,6 @@ class Client extends Configurable
...
@@ -887,9 +906,6 @@ class Client extends Configurable
* @see Solarium\QueryType\MoreLikeThis
* @see Solarium\QueryType\MoreLikeThis
* @see Solarium\Result\MoreLikeThis
* @see Solarium\Result\MoreLikeThis
*
*
* @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
*
* @param QueryInterface|\Solarium\QueryType\MoreLikeThis\Query $query
* @param QueryInterface|\Solarium\QueryType\MoreLikeThis\Query $query
* @param Endpoint|string|null $endpoint
* @param Endpoint|string|null $endpoint
*
*
...
@@ -903,7 +919,7 @@ class Client extends Configurable
...
@@ -903,7 +919,7 @@ class Client extends Configurable
/**
/**
* Execute an analysis query.
* Execute an analysis query.
*
*
*
@internal
This is a convenience method that forwards the query to the
* This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
* execute method, thus allowing for an easy to use and clean API.
*
*
* @param QueryInterface|\Solarium\QueryType\Analysis\Query\Document|\Solarium\QueryType\Analysis\Query\Field $query
* @param QueryInterface|\Solarium\QueryType\Analysis\Query\Document|\Solarium\QueryType\Analysis\Query\Field $query
...
@@ -919,7 +935,7 @@ class Client extends Configurable
...
@@ -919,7 +935,7 @@ class Client extends Configurable
/**
/**
* Execute a terms query.
* Execute a terms query.
*
*
*
@internal
This is a convenience method that forwards the query to the
* This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
* execute method, thus allowing for an easy to use and clean API.
*
*
* @param QueryInterface|\Solarium\QueryType\Terms\Query $query
* @param QueryInterface|\Solarium\QueryType\Terms\Query $query
...
@@ -935,7 +951,7 @@ class Client extends Configurable
...
@@ -935,7 +951,7 @@ class Client extends Configurable
/**
/**
* Execute a suggester query.
* Execute a suggester query.
*
*
*
@internal
This is a convenience method that forwards the query to the
* This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
* execute method, thus allowing for an easy to use and clean API.
*
*
* @param QueryInterface|\Solarium\QueryType\Suggester\Query $query
* @param QueryInterface|\Solarium\QueryType\Suggester\Query $query
...
@@ -951,7 +967,7 @@ class Client extends Configurable
...
@@ -951,7 +967,7 @@ class Client extends Configurable
/**
/**
* Execute an extract query.
* Execute an extract query.
*
*
*
@internal
This is a convenience method that forwards the query to the
* This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
* execute method, thus allowing for an easy to use and clean API.
*
*
* @param QueryInterface|\Solarium\QueryType\Extract\Query $query
* @param QueryInterface|\Solarium\QueryType\Extract\Query $query
...
@@ -967,7 +983,7 @@ class Client extends Configurable
...
@@ -967,7 +983,7 @@ class Client extends Configurable
/**
/**
* Execute a RealtimeGet query.
* Execute a RealtimeGet query.
*
*
*
@internal
This is a convenience method that forwards the query to the
* This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API.
* execute method, thus allowing for an easy to use and clean API.
*
*
* @param QueryInterface|\Solarium\QueryType\RealtimeGet\Query $query
* @param QueryInterface|\Solarium\QueryType\RealtimeGet\Query $query
...
@@ -1144,8 +1160,9 @@ class Client extends Configurable
...
@@ -1144,8 +1160,9 @@ class Client extends Configurable
*/
*/
protected
function
init
()
protected
function
init
()
{
{
//@todo use injection
if
(
$this
->
eventDispatcher
===
null
)
{
$this
->
eventDispatcher
=
new
EventDispatcher
();
$this
->
eventDispatcher
=
new
EventDispatcher
();
}
foreach
(
$this
->
options
as
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
switch
(
$name
)
{
...
...
library/Solarium/Core/Configurable.php
View file @
a5a462f8
...
@@ -108,7 +108,7 @@ class Configurable implements ConfigurableInterface
...
@@ -108,7 +108,7 @@ class Configurable implements ConfigurableInterface
}
}
}
}
if
(
true
==
$overwrite
)
{
if
(
true
==
=
$overwrite
)
{
$this
->
options
=
$options
;
$this
->
options
=
$options
;
}
else
{
}
else
{
$this
->
options
=
array_merge
(
$this
->
options
,
$options
);
$this
->
options
=
array_merge
(
$this
->
options
,
$options
);
...
@@ -157,7 +157,7 @@ class Configurable implements ConfigurableInterface
...
@@ -157,7 +157,7 @@ class Configurable implements ConfigurableInterface
* This hook is called by the constructor after saving the constructor
* This hook is called by the constructor after saving the constructor
* arguments in {@link $options}
* arguments in {@link $options}
*
*
*
@internal
This empty implementation can optionally be implemented in
* This empty implementation can optionally be implemented in
* descending classes. It's not an abstract method on purpose, there are
* descending classes. It's not an abstract method on purpose, there are
* many cases where no initialization is needed.
* many cases where no initialization is needed.
*/
*/
...
...
library/Solarium/Core/Query/AbstractRequestBuilder.php
View file @
a5a462f8
...
@@ -118,7 +118,7 @@ abstract class AbstractRequestBuilder implements RequestBuilderInterface
...
@@ -118,7 +118,7 @@ abstract class AbstractRequestBuilder implements RequestBuilderInterface
public
function
boolAttrib
(
$name
,
$value
)
public
function
boolAttrib
(
$name
,
$value
)
{
{
if
(
null
!==
$value
)
{
if
(
null
!==
$value
)
{
$value
=
(
true
==
$value
)
?
'true'
:
'false'
;
$value
=
(
true
==
=
(
bool
)
$value
)
?
'true'
:
'false'
;
return
$this
->
attrib
(
$name
,
$value
);
return
$this
->
attrib
(
$name
,
$value
);
}
else
{
}
else
{
...
...
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
View file @
a5a462f8
...
@@ -469,7 +469,7 @@ class Loadbalancer extends AbstractPlugin
...
@@ -469,7 +469,7 @@ class Loadbalancer extends AbstractPlugin
$this
->
endpointExcludes
=
array
();
// reset for each query
$this
->
endpointExcludes
=
array
();
// reset for each query
$adapter
=
$this
->
client
->
getAdapter
();
$adapter
=
$this
->
client
->
getAdapter
();
if
(
$this
->
getFailoverEnabled
()
==
true
)
{
if
(
$this
->
getFailoverEnabled
()
==
=
true
)
{
$maxRetries
=
$this
->
getFailoverMaxRetries
();
$maxRetries
=
$this
->
getFailoverMaxRetries
();
for
(
$i
=
0
;
$i
<=
$maxRetries
;
$i
++
)
{
for
(
$i
=
0
;
$i
<=
$maxRetries
;
$i
++
)
{
$endpoint
=
$this
->
getRandomEndpoint
();
$endpoint
=
$this
->
getRandomEndpoint
();
...
...
library/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php
View file @
a5a462f8
...
@@ -110,7 +110,6 @@ class WeightedRandomChoice
...
@@ -110,7 +110,6 @@ class WeightedRandomChoice
}
}
// continue until a non-excluded value is found
// continue until a non-excluded value is found
// @todo optimize?
$result
=
null
;
$result
=
null
;
while
(
1
)
{
while
(
1
)
{
$result
=
$this
->
values
[
$this
->
getKey
()];
$result
=
$this
->
values
[
$this
->
getKey
()];
...
...
library/Solarium/QueryType/Extract/RequestBuilder.php
View file @
a5a462f8
...
@@ -80,7 +80,7 @@ class RequestBuilder extends BaseRequestBuilder
...
@@ -80,7 +80,7 @@ class RequestBuilder extends BaseRequestBuilder
}
}
// add document settings to request
// add document settings to request
if
((
$doc
=
$query
->
getDocument
())
!=
null
)
{
if
((
$doc
=
$query
->
getDocument
())
!=
=
null
)
{
if
(
$doc
->
getBoost
()
!==
null
)
{
if
(
$doc
->
getBoost
()
!==
null
)
{
throw
new
RuntimeException
(
'Extract does not support document-level boosts, use field boosts instead.'
);
throw
new
RuntimeException
(
'Extract does not support document-level boosts, use field boosts instead.'
);
}
}
...
...
library/Solarium/QueryType/MoreLikeThis/ResponseParser.php
View file @
a5a462f8
...
@@ -71,7 +71,7 @@ class ResponseParser extends SelectResponseParser
...
@@ -71,7 +71,7 @@ class ResponseParser extends SelectResponseParser
$parseResult
[
'interestingTerms'
]
=
$terms
;
$parseResult
[
'interestingTerms'
]
=
$terms
;
}
}
if
(
isset
(
$data
[
'match'
][
'docs'
][
0
])
&&
true
==
$query
->
getMatchInclude
())
{
if
(
isset
(
$data
[
'match'
][
'docs'
][
0
])
&&
true
==
=
$query
->
getMatchInclude
())
{
$matchData
=
$data
[
'match'
][
'docs'
][
0
];
$matchData
=
$data
[
'match'
][
'docs'
][
0
];
$documentClass
=
$query
->
getOption
(
'documentclass'
);
$documentClass
=
$query
->
getOption
(
'documentclass'
);
...
...
library/Solarium/QueryType/MoreLikeThis/Result.php
View file @
a5a462f8
...
@@ -119,7 +119,7 @@ class Result extends SelectResult
...
@@ -119,7 +119,7 @@ class Result extends SelectResult
public
function
getMatch
()
public
function
getMatch
()
{
{
$query
=
$this
->
getQuery
();
$query
=
$this
->
getQuery
();
if
(
true
!=
$query
->
getMatchInclude
())
{
if
(
true
!=
=
$query
->
getMatchInclude
())
{
throw
new
UnexpectedValueException
(
'matchinclude was disabled in the MLT query'
);
throw
new
UnexpectedValueException
(
'matchinclude was disabled in the MLT query'
);
}
}
$this
->
parseResponse
();
$this
->
parseResponse
();
...
...
library/Solarium/QueryType/Select/Query/Component/FacetSet.php
View file @
a5a462f8
...
@@ -319,7 +319,6 @@ class FacetSet extends AbstractComponent
...
@@ -319,7 +319,6 @@ class FacetSet extends AbstractComponent
}
}
//double add calls for the same facet are ignored, but non-unique keys cause an exception
//double add calls for the same facet are ignored, but non-unique keys cause an exception
//@todo add trigger_error with a notice for double add calls?
if
(
array_key_exists
(
$key
,
$this
->
facets
)
&&
$this
->
facets
[
$key
]
!==
$facet
)
{
if
(
array_key_exists
(
$key
,
$this
->
facets
)
&&
$this
->
facets
[
$key
]
!==
$facet
)
{
throw
new
InvalidArgumentException
(
'A facet must have a unique key value within a query'
);
throw
new
InvalidArgumentException
(
'A facet must have a unique key value within a query'
);
}
else
{
}
else
{
...
...
library/Solarium/QueryType/Select/Query/Component/Stats/Stats.php
View file @
a5a462f8
...
@@ -152,7 +152,6 @@ class Stats extends AbstractComponent
...
@@ -152,7 +152,6 @@ class Stats extends AbstractComponent
}
}
//double add calls for the same field are ignored, but non-unique keys cause an exception
//double add calls for the same field are ignored, but non-unique keys cause an exception
//@todo add trigger_error with a notice for double add calls?
if
(
array_key_exists
(
$key
,
$this
->
fields
)
&&
$this
->
fields
[
$key
]
!==
$field
)
{
if
(
array_key_exists
(
$key
,
$this
->
fields
)
&&
$this
->
fields
[
$key
]
!==
$field
)
{
throw
new
InvalidArgumentException
(
'A field must have a unique key value'
);
throw
new
InvalidArgumentException
(
'A field must have a unique key value'
);
}
else
{
}
else
{
...
...
library/Solarium/QueryType/Select/Query/Query.php
View file @
a5a462f8
...
@@ -634,7 +634,6 @@ class Query extends BaseQuery
...
@@ -634,7 +634,6 @@ class Query extends BaseQuery
}
}
//double add calls for the same FQ are ignored, but non-unique keys cause an exception
//double add calls for the same FQ are ignored, but non-unique keys cause an exception
//@todo add trigger_error with a notice for double add calls?
if
(
array_key_exists
(
$key
,
$this
->
filterQueries
)
&&
$this
->
filterQueries
[
$key
]
!==
$filterQuery
)
{
if
(
array_key_exists
(
$key
,
$this
->
filterQueries
)
&&
$this
->
filterQueries
[
$key
]
!==
$filterQuery
)
{
throw
new
InvalidArgumentException
(
'A filterquery must have a unique key value within a query'
);
throw
new
InvalidArgumentException
(
'A filterquery must have a unique key value within a query'
);
}
else
{
}
else
{
...
@@ -792,7 +791,7 @@ class Query extends BaseQuery
...
@@ -792,7 +791,7 @@ class Query extends BaseQuery
if
(
isset
(
$this
->
components
[
$key
]))
{
if
(
isset
(
$this
->
components
[
$key
]))
{
return
$this
->
components
[
$key
];
return
$this
->
components
[
$key
];
}
else
{
}
else
{
if
(
$autoload
==
true
)
{
if
(
$autoload
==
=
true
)
{
if
(
!
isset
(
$this
->
componentTypes
[
$key
]))
{
if
(
!
isset
(
$this
->
componentTypes
[
$key
]))
{
throw
new
OutOfBoundsException
(
'Cannot autoload unknown component: '
.
$key
);
throw
new
OutOfBoundsException
(
'Cannot autoload unknown component: '
.
$key
);
}
}
...
...
library/Solarium/QueryType/Update/Result.php
View file @
a5a462f8
...
@@ -48,7 +48,7 @@ use Solarium\Core\Query\Result\QueryType as BaseResult;
...
@@ -48,7 +48,7 @@ use Solarium\Core\Query\Result\QueryType as BaseResult;
* An update query only returns a query time and status. Both are accessible
* An update query only returns a query time and status. Both are accessible
* using the methods provided by {@link Solarium\Result\Query}.
* using the methods provided by {@link Solarium\Result\Query}.
*
*
*
@internal
For now this class only exists to distinguish the different result
* For now this class only exists to distinguish the different result
* types. It might get some extra behaviour in the future.
* types. It might get some extra behaviour in the future.
*/
*/
class
Result
extends
BaseResult
class
Result
extends
BaseResult
...
...
tests/Solarium/Tests/Core/Client/ClientTest.php
View file @
a5a462f8
...
@@ -121,9 +121,16 @@ class ClientTest extends \PHPUnit_Framework_TestCase
...
@@ -121,9 +121,16 @@ class ClientTest extends \PHPUnit_Framework_TestCase
*/
*/
public
function
testGetEventDispatcher
()
{
public
function
testGetEventDispatcher
()
{
$this
->
assertInstanceOf
(
'\Symfony\Component\EventDispatcher\EventDispatcherInterface'
,
$this
->
client
->
getEventDispatcher
());
$this
->
assertInstanceOf
(
'\Symfony\Component\EventDispatcher\EventDispatcherInterface'
,
$this
->
client
->
getEventDispatcher
());
$event_dispatcher
=
$this
->
getMock
(
'\Symfony\Component\EventDispatcher\EventDispatcherInterface'
);
$eventDispatcher
=
$this
->
getMock
(
'\Symfony\Component\EventDispatcher\EventDispatcherInterface'
);
$this
->
client
->
setEventDispatcher
(
$event_dispatcher
);
$this
->
client
->
setEventDispatcher
(
$eventDispatcher
);
$this
->
assertSame
(
$event_dispatcher
,
$this
->
client
->
getEventDispatcher
());
$this
->
assertSame
(
$eventDispatcher
,
$this
->
client
->
getEventDispatcher
());
}
public
function
testEventDispatcherInjection
()
{
$eventDispatcher
=
$this
->
getMock
(
'\Symfony\Component\EventDispatcher\EventDispatcherInterface'
);
$client
=
new
Client
(
null
,
$eventDispatcher
);
$this
->
assertSame
(
$eventDispatcher
,
$client
->
getEventDispatcher
());
}
}
public
function
testConfigModeWithoutKeys
()
public
function
testConfigModeWithoutKeys
()
...
...
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