Skip to content

Commit

Permalink
Merge pull request solariumphp#362 from chadicus/fea/ClientInterface
Browse files Browse the repository at this point in the history
[WIP] Fea/client interface
  • Loading branch information
basdenooijer committed Nov 1, 2015
2 parents 4d4207e + 21f1799 commit 2bb12fb
Show file tree
Hide file tree
Showing 9 changed files with 567 additions and 17 deletions.
550 changes: 550 additions & 0 deletions library/Solarium/Core/Client/ClientInterface.php

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions library/Solarium/Support/DataFixtures/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Solarium\Support\DataFixtures;

use Solarium\Core\Client\Client;
use Solarium\Core\Client\ClientInterface;

/**
* @author Baldur Rensch <[email protected]>
Expand All @@ -17,9 +17,9 @@ class Executor
/**
* Constructor.
*
* @param \Solarium\Core\Client\Client $client
* @param \Solarium\Core\Client\ClientInterface $client
*/
public function __construct(Client $client)
public function __construct(ClientInterface $client)
{
$this->client = $client;
}
Expand Down
6 changes: 3 additions & 3 deletions library/Solarium/Support/DataFixtures/FixtureInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Solarium\Support\DataFixtures;

use Solarium\Core\Client\Client;
use Solarium\Core\Client\ClientInterface;

/**
* @author Baldur Rensch <[email protected]>
*/
interface FixtureInterface
{
/**
* @param Client $client
* @param ClientInterface $client
*/
public function load(Client $client);
public function load(ClientInterface $client);
}
6 changes: 3 additions & 3 deletions library/Solarium/Support/DataFixtures/Purger.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Solarium\Support\DataFixtures;

use Solarium\Core\Client\Client;
use Solarium\Core\Client\ClientInterface;

/**
* DataFixtures Purger.
Expand All @@ -20,9 +20,9 @@ class Purger
private $deleteQuery = '*:*';

/**
* @param Client $client
* @param ClientInterface $client
*/
public function __construct(Client $client)
public function __construct(ClientInterface $client)
{
$this->client = $client;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Solarium/Tests/Support/DataFixtures/ExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ExecutorTest extends \PHPUnit_Framework_TestCase
{
public function testLoad()
{
$solarium = $this->getMock('Solarium\Core\Client\Client');
$solarium = $this->getMock('Solarium\Core\Client\ClientInterface');

$mockFixtures = array(
$this->getMockFixture($solarium),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testWithPurging()

protected function setUp()
{
$this->client = $this->getMock('Solarium\Core\Client\Client');
$this->client = $this->getMock('Solarium\Core\Client\ClientInterface');
$this->fixturePath = __DIR__ . '/Fixtures/';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Solarium\Tests\Support\DataFixtures\Fixtures;

use Solarium\Core\Client\Client;
use Solarium\Core\Client\ClientInterface;
use Solarium\Support\DataFixtures\FixtureInterface;

class MockFixture1 implements FixtureInterface
{
/**
* @param Client $client
*/
public function load(Client $client)
public function load(ClientInterface $client)
{
// Not needed in unit test
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Solarium\Tests\Support\DataFixtures\Fixtures;

use Solarium\Core\Client\Client;
use Solarium\Core\Client\ClientInterface;
use Solarium\Support\DataFixtures\FixtureInterface;

class MockFixture2 implements FixtureInterface
{
/**
* @param Client $client
*/
public function load(Client $client)
public function load(ClientInterface $client)
{
// Not needed in unit test
}
Expand All @@ -21,7 +21,7 @@ class MockFixture3 implements FixtureInterface
/**
* @param Client $client
*/
public function load(Client $client)
public function load(ClientInterface $client)
{
// Not needed in unit test
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Solarium/Tests/Support/DataFixtures/PurgerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class PurgerTest extends \PHPUnit_Framework_TestCase
{
public function testPurge()
{
$solarium = $this->getMock('Solarium\Core\Client\Client');
$solarium = $this->getMock('Solarium\Core\Client\ClientInterface');

$update = $this->getMock('\Solarium\QueryType\Update\Query\Query');
$update->expects($this->once())
Expand Down

0 comments on commit 2bb12fb

Please sign in to comment.