Commit 4b1fb0b0 authored by Markus Kalkbrenner's avatar Markus Kalkbrenner Committed by GitHub

add integration tests for all HTTP adapters (#540)

parent 4a16523d
...@@ -5,7 +5,7 @@ namespace Solarium\Tests\Integration; ...@@ -5,7 +5,7 @@ namespace Solarium\Tests\Integration;
use Solarium\Core\Client\ClientInterface; use Solarium\Core\Client\ClientInterface;
use Solarium\QueryType\Select\Query\Query as SelectQuery; use Solarium\QueryType\Select\Query\Query as SelectQuery;
class TechproductsTest extends \PHPUnit_Framework_TestCase abstract class AbstractTechproductsTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
...@@ -23,7 +23,9 @@ class TechproductsTest extends \PHPUnit_Framework_TestCase ...@@ -23,7 +23,9 @@ class TechproductsTest extends \PHPUnit_Framework_TestCase
'path' => '/solr/', 'path' => '/solr/',
'core' => 'techproducts', 'core' => 'techproducts',
] ]
] ],
// Curl is the default adapter.
//'adapter' => 'Solarium\Core\Client\Adapter\Curl',
]; ];
$this->client = new \Solarium\Client($config); $this->client = new \Solarium\Client($config);
......
<?php
namespace Solarium\Tests\Integration\TechproductsAdapters;
use Solarium\Tests\Integration\AbstractTechproductsTest;
class TechproductsCurlTest extends AbstractTechproductsTest {}
<?php
namespace Solarium\Tests\Integration\TechproductsAdapters;
use Solarium\Tests\Integration\AbstractTechproductsTest;
class TechproductsGuzzle3Test extends AbstractTechproductsTest
{
public function setUp()
{
if (!class_exists('\\Guzzle\\Http\\Client')) {
$this->markTestSkipped('Guzzle 3 not installed');
}
else {
parent::setUp();
$this->client->setAdapter('Solarium\Core\Client\Adapter\Guzzle');
}
}
}
<?php
namespace Solarium\Tests\Integration\TechproductsAdapters;
use Solarium\Tests\Integration\AbstractTechproductsTest;
class TechproductsGuzzleTest extends AbstractTechproductsTest
{
public function setUp()
{
if (!class_exists('\\GuzzleHttp\\Client')) {
$this->markTestSkipped('Guzzle 6 not installed');
}
else {
parent::setUp();
$this->client->setAdapter('Solarium\Core\Client\Adapter\Guzzle3');
}
}
}
<?php
namespace Solarium\Tests\Integration\TechproductsAdapters;
use Solarium\Tests\Integration\AbstractTechproductsTest;
class TechproductsHttpTest extends AbstractTechproductsTest
{
public function setUp()
{
parent::setUp();
$this->client->setAdapter('Solarium\Core\Client\Adapter\Http');
}
}
<?php
namespace Solarium\Tests\Integration\TechproductsAdapters;
use Solarium\Tests\Integration\AbstractTechproductsTest;
use Solarium\Core\Client\Adapter\PeclHttp;
class TechproductsPeclHttpTestTest extends AbstractTechproductsTest
{
public function setUp()
{
if (!function_exists('http_get')) {
$this->markTestSkipped('Pecl_http not available, skipping PeclHttp adapter tests');
}
else {
parent::setUp();
$this->client->setAdapter(new PeclHttp(array('timeout' => 10)));
}
}
}
<?php
namespace Solarium\Tests\Integration\TechproductsAdapters;
use Solarium\Tests\Integration\AbstractTechproductsTest;
class TechproductsZendHttpTest extends AbstractTechproductsTest
{
public function setUp()
{
if (!class_exists('Zend_Loader_Autoloader') && !(@include_once 'Zend/Loader/Autoloader.php')) {
$this->markTestSkipped('ZF not in include_path, skipping ZendHttp adapter tests');
}
else {
parent::setUp();
$this->client->setAdapter('Solarium\Core\Client\Adapter\ZendHttp');
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment