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
ba3b3f2b
Commit
ba3b3f2b
authored
Aug 07, 2012
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature/nextgen
Conflicts: library/Solarium/Client.php tests/Solarium/ClientTest.php
parents
2053bb76
c2865cea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
library/Solarium/Core/Client/Client.php
library/Solarium/Core/Client/Client.php
+2
-2
tests/Solarium/Tests/Core/Client/ClientTest.php
tests/Solarium/Tests/Core/Client/ClientTest.php
+17
-0
No files found.
library/Solarium/Core/Client/Client.php
View file @
ba3b3f2b
...
@@ -224,7 +224,7 @@ class Client extends Configurable
...
@@ -224,7 +224,7 @@ class Client extends Configurable
foreach
(
$this
->
options
as
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
switch
(
$name
)
{
case
'endpoint'
:
case
'endpoint'
:
$this
->
add
Endpoints
(
$value
);
$this
->
set
Endpoints
(
$value
);
break
;
break
;
case
'querytype'
:
case
'querytype'
:
$this
->
registerQueryTypes
(
$value
);
$this
->
registerQueryTypes
(
$value
);
...
@@ -452,7 +452,7 @@ class Client extends Configurable
...
@@ -452,7 +452,7 @@ class Client extends Configurable
return
$this
->
setOption
(
'adapter'
,
$adapter
);
return
$this
->
setOption
(
'adapter'
,
$adapter
);
}
elseif
(
$adapter
instanceof
AdapterInterface
)
{
}
elseif
(
$adapter
instanceof
AdapterInterface
)
{
// forward options
// forward options
$adapter
->
setOptions
(
$this
->
options
);
$adapter
->
setOptions
(
$this
->
getOption
(
'adapteroptions'
)
);
// overwrite existing adapter
// overwrite existing adapter
$this
->
adapter
=
$adapter
;
$this
->
adapter
=
$adapter
;
...
...
tests/Solarium/Tests/Core/Client/ClientTest.php
View file @
ba3b3f2b
...
@@ -381,6 +381,23 @@ class ClientTest extends \PHPUnit_Framework_TestCase
...
@@ -381,6 +381,23 @@ class ClientTest extends \PHPUnit_Framework_TestCase
$this
->
client
->
getAdapter
();
$this
->
client
->
getAdapter
();
}
}
public
function
testSetAdapterWithOptions
()
{
$adapterOptions
=
array
(
'host'
=>
'myhost'
,
'port'
=>
8080
,
'customOption'
=>
'foobar'
);
$observer
=
$this
->
getMock
(
'Solarium\Core\Client\Adapter\Http'
,
array
(
'setOptions'
,
'execute'
));
$observer
->
expects
(
$this
->
once
())
->
method
(
'setOptions'
)
->
with
(
$this
->
equalTo
(
$adapterOptions
));
$this
->
client
->
setOptions
(
array
(
'adapteroptions'
=>
$adapterOptions
));
$this
->
client
->
setAdapter
(
$observer
);
}
public
function
testRegisterQueryTypeAndGetQueryTypes
()
public
function
testRegisterQueryTypeAndGetQueryTypes
()
{
{
$queryTypes
=
$this
->
client
->
getQueryTypes
();
$queryTypes
=
$this
->
client
->
getQueryTypes
();
...
...
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