Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecations for abstract test classes in PHPUnit 9.6 #1077

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use PHPUnit\Framework\TestCase;
use Solarium\Component\Highlighting\HighlightingInterface;

abstract class AbstractHighlightingTest extends TestCase
abstract class AbstractHighlightingTestCase extends TestCase
{
/**
* @var HighlightingInterface
Expand Down
2 changes: 1 addition & 1 deletion tests/Component/Highlighting/FieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Solarium\Component\Highlighting\Field;

class FieldTest extends AbstractHighlightingTest
class FieldTest extends AbstractHighlightingTestCase
{
/**
* @var Field
Expand Down
2 changes: 1 addition & 1 deletion tests/Component/Highlighting/HighlightingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Solarium\Exception\InvalidArgumentException;
use Solarium\QueryType\Select\Query\Query;

class HighlightingTest extends AbstractHighlightingTest
class HighlightingTest extends AbstractHighlightingTestCase
{
/**
* @var Highlighting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Abstract base class.
*/
abstract class AbstractCloudTest extends AbstractTechproductsTest
abstract class AbstractCloudTestCase extends AbstractTechproductsTestCase
{
protected static function createTechproducts(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Solarium\Exception\HttpException;

abstract class AbstractServerTest extends AbstractTechproductsTest
abstract class AbstractServerTestCase extends AbstractTechproductsTestCase
{
protected static function createTechproducts(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
use Solarium\Tests\Integration\Plugin\EventTimer;
use Symfony\Contracts\EventDispatcher\Event;

abstract class AbstractTechproductsTest extends TestCase
abstract class AbstractTechproductsTestCase extends TestCase
{
/**
* @var ClientInterface
Expand Down Expand Up @@ -219,7 +219,7 @@ public function testPing()
$this->assertSame(0, $result->getStatus());
$this->assertSame('OK', $result->getPingStatus());

if ($this instanceof AbstractCloudTest) {
if ($this instanceof AbstractCloudTestCase) {
$this->assertTrue($result->getZkConnected());
} else {
$this->assertNull($result->getZkConnected());
Expand Down Expand Up @@ -960,7 +960,7 @@ public function testMoreLikeThisComponent()
// Solr 7 doesn't support mlt.interestingTerms for MoreLikeThisComponent
// Solr 8 & Solr 9: "To use this parameter with the search component, the query cannot be distributed."
// https://solr.apache.org/guide/morelikethis.html#common-handler-and-component-parameters
if (8 <= self::$solrVersion && $this instanceof AbstractServerTest) {
if (8 <= self::$solrVersion && $this instanceof AbstractServerTestCase) {
// with 'details', interesting terms are an associative array of terms and their boost values
$interestingTerms = $mlt->getInterestingTerm($document->id);
$this->assertSame('cat:search', key($interestingTerms));
Expand Down Expand Up @@ -1224,7 +1224,7 @@ public function testTerms()
$terms->setFields('name');

// Setting distrib to true in a non cloud setup causes exceptions.
if ($this instanceof AbstractCloudTest) {
if ($this instanceof AbstractCloudTestCase) {
$terms->setDistrib(true);
}

Expand All @@ -1250,7 +1250,7 @@ public function testTermsComponent()
$select = self::$client->createQuery('test');

// Setting distrib to true in a non cloud setup causes exceptions.
if ($this instanceof AbstractCloudTest) {
if ($this instanceof AbstractCloudTestCase) {
$select->setDistrib(true);
}

Expand Down Expand Up @@ -1391,7 +1391,7 @@ public function testUpdate(string $requestFormat)
$this->assertSame(0, $response->getStatus());

// rollback is currently not supported in SolrCloud mode (SOLR-4895)
if ($this instanceof AbstractServerTest) {
if ($this instanceof AbstractServerTestCase) {
// add, rollback, commit
$update = self::$client->createUpdate();
$update->setRequestFormat($requestFormat);
Expand Down Expand Up @@ -1635,7 +1635,7 @@ public function testModifiers(string $requestFormat)
], $result->getIterator()->current()->getFields());

// add-distinct with multiple values can add duplicates in Solr 7 cloud mode (SOLR-14550)
if (7 === self::$solrVersion && $this instanceof AbstractCloudTest) {
if (7 === self::$solrVersion && $this instanceof AbstractCloudTestCase) {
// we still have to emulate a successful atomic update for the remainder of this test to pass
$doc = $update->createDocument();
$doc->setKey('id', 'solarium-test');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @group integration
*/
abstract class AbstractProxyTest extends TestCase
abstract class AbstractProxyTestCase extends TestCase
{
/**
* @var ClientInterface
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Proxy/CurlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @group integration
*/
class CurlTest extends AbstractProxyTest
class CurlTest extends AbstractProxyTestCase
{
protected static function createClient(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Proxy/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @group integration
*/
class HttpTest extends AbstractProxyTest
class HttpTest extends AbstractProxyTestCase
{
protected static function createClient(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/SolrCloud/CurlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace Solarium\Tests\Integration\SolrCloud;

use Solarium\Core\Client\Adapter\Curl;
use Solarium\Tests\Integration\AbstractCloudTest;
use Solarium\Tests\Integration\AbstractCloudTestCase;

/**
* @group integration
* @group skip_for_solr_server
*/
class CurlTest extends AbstractCloudTest
class CurlTest extends AbstractCloudTestCase
{
public function setUp(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/SolrCloud/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace Solarium\Tests\Integration\SolrCloud;

use Solarium\Core\Client\Adapter\Http;
use Solarium\Tests\Integration\AbstractCloudTest;
use Solarium\Tests\Integration\AbstractCloudTestCase;

/**
* @group integration
* @group skip_for_solr_server
*/
class HttpTest extends AbstractCloudTest
class HttpTest extends AbstractCloudTestCase
{
public function setUp(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/SolrCloud/Psr18Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Solarium\Tests\Integration\SolrCloud;

use Solarium\Tests\Integration\AbstractCloudTest;
use Solarium\Tests\Integration\AbstractCloudTestCase;

/**
* @group integration
* @group skip_for_solr_server
*/
class Psr18Test extends AbstractCloudTest
class Psr18Test extends AbstractCloudTestCase
{
}
4 changes: 2 additions & 2 deletions tests/Integration/SolrServer/CurlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace Solarium\Tests\Integration\SolrServer;

use Solarium\Core\Client\Adapter\Curl;
use Solarium\Tests\Integration\AbstractServerTest;
use Solarium\Tests\Integration\AbstractServerTestCase;

/**
* @group integration
* @group skip_for_solr_cloud
*/
class CurlTest extends AbstractServerTest
class CurlTest extends AbstractServerTestCase
{
public function setUp(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/SolrServer/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace Solarium\Tests\Integration\SolrServer;

use Solarium\Core\Client\Adapter\Http;
use Solarium\Tests\Integration\AbstractServerTest;
use Solarium\Tests\Integration\AbstractServerTestCase;

/**
* @group integration
* @group skip_for_solr_cloud
*/
class HttpTest extends AbstractServerTest
class HttpTest extends AbstractServerTestCase
{
public function setUp(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/SolrServer/Psr18Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Solarium\Tests\Integration\SolrServer;

use Solarium\Tests\Integration\AbstractServerTest;
use Solarium\Tests\Integration\AbstractServerTestCase;

/**
* @group integration
* @group skip_for_solr_cloud
*/
class Psr18Test extends AbstractServerTest
class Psr18Test extends AbstractServerTestCase
{
}
4 changes: 2 additions & 2 deletions tests/Plugin/MinimumScoreFilter/DocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Solarium\Plugin\MinimumScoreFilter\Document as FilterDocument;
use Solarium\QueryType\Select\Result\Document;
use Solarium\Tests\QueryType\Select\Result\AbstractDocumentTest;
use Solarium\Tests\QueryType\Select\Result\AbstractDocumentTestCase;

class DocumentTest extends AbstractDocumentTest
class DocumentTest extends AbstractDocumentTestCase
{
public function setUp(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Plugin/MinimumScoreFilter/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Solarium\Plugin\MinimumScoreFilter\Query;
use Solarium\Plugin\MinimumScoreFilter\QueryGroupResult;
use Solarium\Plugin\MinimumScoreFilter\ValueGroupResult;
use Solarium\Tests\QueryType\Select\Query\AbstractQueryTest;
use Solarium\Tests\QueryType\Select\Query\AbstractQueryTestCase;

class QueryTest extends AbstractQueryTest
class QueryTest extends AbstractQueryTestCase
{
public function setUp(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Plugin/MinimumScoreFilter/ResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Solarium\Plugin\MinimumScoreFilter\Query;
use Solarium\Plugin\MinimumScoreFilter\Result;
use Solarium\QueryType\Select\Result\Document;
use Solarium\Tests\QueryType\Select\Result\AbstractResultTest;
use Solarium\Tests\QueryType\Select\Result\AbstractResultTestCase;

class ResultTest extends AbstractResultTest
class ResultTest extends AbstractResultTestCase
{
public function setUp(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/QueryType/Extract/ResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Solarium\QueryType\Extract\Query as ExtractQuery;
use Solarium\QueryType\Extract\Result as ExtractResult;
use Solarium\Tests\QueryType\Update\AbstractResultTest;
use Solarium\Tests\QueryType\Update\AbstractResultTestCase;

class ResultTest extends AbstractResultTest
class ResultTest extends AbstractResultTestCase
{
public function setUp(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Solarium\QueryType\Luke\Result\Schema\Field\WildcardField;
use Solarium\QueryType\Luke\Result\Schema\Type\Type;

abstract class AbstractFieldTest extends TestCase
abstract class AbstractFieldTestCase extends TestCase
{
/**
* @var AbstractField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Solarium\QueryType\Luke\Result\Schema\Field\DynamicField;
use Solarium\QueryType\Luke\Result\Schema\Field\SchemaFieldInterface;

class DynamicBasedFieldTest extends AbstractFieldTest
class DynamicBasedFieldTest extends AbstractFieldTestCase
{
/**
* @var DynamicBasedField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Solarium\QueryType\Luke\Result\Schema\Field\SchemaFieldInterface;
use Solarium\QueryType\Luke\Result\Schema\Type\Type;

class DynamicFieldTest extends AbstractFieldTest
class DynamicFieldTest extends AbstractFieldTestCase
{
/**
* @var DynamicField
Expand Down
2 changes: 1 addition & 1 deletion tests/QueryType/Luke/Result/Schema/Field/FieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Solarium\QueryType\Luke\Result\Schema\Field\Field;
use Solarium\QueryType\Luke\Result\Schema\Field\SchemaFieldInterface;

class FieldTest extends AbstractFieldTest
class FieldTest extends AbstractFieldTestCase
{
/**
* @var Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Solarium\QueryType\Luke\Result\Schema\Type\Filter;
use Solarium\QueryType\Luke\Result\Schema\Type\Tokenizer;

abstract class AbstractAnalyzerTest extends TestCase
abstract class AbstractAnalyzerTestCase extends TestCase
{
/**
* @var AbstractAnalyzer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use PHPUnit\Framework\TestCase;
use Solarium\QueryType\Luke\Result\Schema\Type\AbstractFilter;

abstract class AbstractFilterTest extends TestCase
abstract class AbstractFilterTestCase extends TestCase
{
/**
* @var AbstractFilter
Expand Down
2 changes: 1 addition & 1 deletion tests/QueryType/Luke/Result/Schema/Type/CharFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Solarium\QueryType\Luke\Result\Schema\Type\CharFilter;

class CharFilterTest extends AbstractFilterTest
class CharFilterTest extends AbstractFilterTestCase
{
/**
* @var CharFilter
Expand Down
2 changes: 1 addition & 1 deletion tests/QueryType/Luke/Result/Schema/Type/FilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Solarium\QueryType\Luke\Result\Schema\Type\Filter;

class FilterTest extends AbstractFilterTest
class FilterTest extends AbstractFilterTestCase
{
/**
* @var Filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Solarium\QueryType\Luke\Result\Schema\Type\IndexAnalyzer;

class IndexAnalyzerTest extends AbstractAnalyzerTest
class IndexAnalyzerTest extends AbstractAnalyzerTestCase
{
/**
* @var IndexAnalyzer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Solarium\QueryType\Luke\Result\Schema\Type\QueryAnalyzer;

class QueryAnalyzerTest extends AbstractAnalyzerTest
class QueryAnalyzerTest extends AbstractAnalyzerTestCase
{
/**
* @var QueryAnalyzer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Solarium\QueryType\Select\Query\FilterQuery;
use Solarium\QueryType\Select\Query\Query;

abstract class AbstractQueryTest extends TestCase
abstract class AbstractQueryTestCase extends TestCase
{
/**
* @var Query
Expand Down
2 changes: 1 addition & 1 deletion tests/QueryType/Select/Query/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Solarium\QueryType\Select\Query\Query;

class QueryTest extends AbstractQueryTest
class QueryTest extends AbstractQueryTestCase
{
public function setUp(): void
{
Expand Down
Loading