Completed
Push — master ( cb7970...970861 )
by Colin
12:52 queued 03:09
created

ServiceProviderTests   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 37
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testAbstractsAreLoaded() 0 11 1
A testFacadeWorks() 0 6 1
A testInfoWorks() 0 7 1
1
<?php namespace Cviebrock\LaravelElasticsearch\Tests;
2
3
use Cviebrock\LaravelElasticsearch\Factory;
4
use Cviebrock\LaravelElasticsearch\Manager;
5
use Elasticsearch;
6
use Elasticsearch\Client;
7
8
9
class ServiceProviderTests extends TestCase
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: artisan, be, call, seed
Loading history...
10
{
11
12
    public function testAbstractsAreLoaded(): void
13
    {
14
        $factory = app('elasticsearch.factory');
15
        $this->assertInstanceOf(Factory::class, $factory);
16
17
        $manager = app('elasticsearch');
18
        $this->assertInstanceOf(Manager::class, $manager);
19
20
        $client = app(Client::class);
21
        $this->assertInstanceOf(Client::class, $client);
22
    }
23
24
    /**
25
     * Test that the facade works.
26
     * @todo This seems a bit simplistic ... maybe a better way to do this?
27
     */
28
    public function testFacadeWorks(): void
29
    {
30
        $ping = Elasticsearch::ping();
31
32
        $this->assertTrue($ping);
33
    }
34
35
    /**
36
     * Test we can get the ES info.
37
     */
38
    public function testInfoWorks(): void
39
    {
40
        $info = Elasticsearch::info();
41
42
        $this->assertIsArray($info);
43
        $this->assertArrayHasKey('cluster_name', $info);
44
    }
45
}
46