File manager - Edit - /var/www/payraty/helpdesk/vendor/handcraftedinthealps/elasticsearch-dsl/tests/Unit/SearchEndpoint/QueryEndpointTest.php
Back
<?php /* * This file is part of the ONGR package. * * (c) NFQ Technologies UAB <info@nfq.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace ONGR\ElasticsearchDSL\Tests\Unit\SearchEndpoint; use ONGR\ElasticsearchDSL\Query\MatchAllQuery; use ONGR\ElasticsearchDSL\SearchEndpoint\QueryEndpoint; use PHPUnit_Framework_MockObject_MockObject as MockObject; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; /** * Unit test class for the QueryEndpoint. */ class QueryEndpointTest extends \PHPUnit\Framework\TestCase { /** * Tests constructor. */ public function testItCanBeInstantiated() { $this->assertInstanceOf(QueryEndpoint::class, new QueryEndpoint()); } /** * Tests if correct order is returned. Query must be executed after filter and post filter. */ public function testGetOrder() { $instance = new QueryEndpoint(); $this->assertEquals(2, $instance->getOrder()); } /** * Tests if endpoint return correct normalized data. */ public function testEndpoint() { $instance = new QueryEndpoint(); /** @var NormalizerInterface|MockObject $normalizerInterface */ $normalizerInterface = $this->getMockForAbstractClass( NormalizerInterface::class ); $this->assertFalse($instance->normalize($normalizerInterface)); $matchAll = new MatchAllQuery(); $instance->add($matchAll); $this->assertEquals( $matchAll->toArray(), $instance->normalize($normalizerInterface) ); } /** * Tests if endpoint returns builders. */ public function testEndpointGetter() { $queryName = 'acme_query'; $query = new MatchAllQuery(); $endpoint = new QueryEndpoint(); $endpoint->add($query, $queryName); $builders = $endpoint->getAll(); $this->assertCount(1, $builders); $this->assertSame($query, $builders[$queryName]); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings