Skip to content

Commit 18377a1

Browse files
committed
#105514 Получение списка индексов
1 parent 3e1c451 commit 18377a1

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tests/Functional/ClientTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace Ensi\LaravelElasticQuery\Tests\Functional;
4+
5+
use Ensi\LaravelElasticQuery\ElasticClient;
6+
use Ensi\LaravelElasticQuery\Tests\Models\ProductsIndex;
7+
use Ensi\LaravelElasticQuery\Tests\Seeds\ProductIndexSeeder;
8+
9+
class ClientTest extends ElasticTestCase
10+
{
11+
protected function setUp(): void
12+
{
13+
parent::setUp();
14+
15+
ProductIndexSeeder::run();
16+
}
17+
18+
public function testCatIndices(): void
19+
{
20+
$results = $this->newClient()->catIndices(ProductsIndex::fullName());
21+
22+
}
23+
24+
private function newClient(): ElasticClient
25+
{
26+
return resolve(ElasticClient::class);
27+
}
28+
}

tests/Models/ProductsIndex.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ class ProductsIndex extends ElasticIndex
99
protected string $name = 'test_products';
1010

1111
protected string $tiebreaker = 'product_id';
12+
13+
public static function fullName(): string
14+
{
15+
return (new static())->indexName();
16+
}
1217
}

0 commit comments

Comments
 (0)