Repository navigation
Expand file tree
/
Copy pathClientTest.php
More file actions
46 lines (41 loc) · 1.73 KB
/
Copy pathClientTest.php
File metadata and controls
46 lines (41 loc) · 1.73 KB
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
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Typesense\Collections;
use Typesense\Stopwords;
use Typesense\Aliases;
use Typesense\Keys;
use Typesense\Debug;
use Typesense\Metrics;
use Typesense\Health;
use Typesense\Operations;
use Typesense\MultiSearch;
use Typesense\Presets;
use Typesense\Analytics;
use Typesense\Conversations;
use Typesense\NLSearchModel;
class ClientTest extends TestCase
{
public function testCanCreateAClient(): void
{
$this->assertInstanceOf(Collections::class, $this->client()->collections);
$this->assertInstanceOf(Stopwords::class, $this->client()->stopwords);
$this->assertInstanceOf(Aliases::class, $this->client()->aliases);
$this->assertInstanceOf(Keys::class, $this->client()->keys);
$this->assertInstanceOf(Debug::class, $this->client()->debug);
$this->assertInstanceOf(Metrics::class, $this->client()->metrics);
$this->assertInstanceOf(Health::class, $this->client()->health);
$this->assertInstanceOf(Operations::class, $this->client()->operations);
$this->assertInstanceOf(MultiSearch::class, $this->client()->multiSearch);
$this->assertInstanceOf(Presets::class, $this->client()->presets);
$this->assertInstanceOf(Analytics::class, $this->client()->analytics);
$this->assertInstanceOf(Conversations::class, $this->client()->conversations);
}
public function testPrivateFieldNamesResolveToNLSearchModels(): void
{
$models = $this->client()->nlSearchModels;
$this->assertInstanceOf(NLSearchModel::class, $models->apiCall);
$this->assertSame($models['apiCall'], $models->apiCall);
$this->assertSame($models['nlSearchModels'], $models->nlSearchModels);
}
}