forked from solariumphp/solarium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomQueryClassTest.php
35 lines (31 loc) · 1.04 KB
/
CustomQueryClassTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace Solarium\Tests\Integration\Query;
use PHPUnit\Framework\TestCase;
use Solarium\Component\QueryInterface;
class CustomQueryClassTest extends TestCase
{
/**
* Test the various return types that are valid for custom query classes that
* override the {@see \Solarium\Component\QueryTrait::setQuery()} method.
*
* If this test throws a fatal error, the return type of the parent might no
* longer be backward compatible with existing code that overrides it.
*
* @see https://github.com/solariumphp/solarium/issues/1097
*
* @dataProvider customQueryClassProvider
*/
public function testCustomQueryClassSetQueryReturnType(string $queryClass)
{
$query = new $queryClass();
$this->assertInstanceOf(QueryInterface::class, $query->setQuery('*:*'));
}
public function customQueryClassProvider(): array
{
return [
[CustomStaticQuery::class],
[CustomSelfQuery::class],
[CustomQueryInterfaceQuery::class],
];
}
}