Passed
Pull Request — master (#34)
by Marc
03:38
created

MaxTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testMax() 0 18 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\IntegrationTest\Aggregation;
5
6
use TBolier\RethinkQL\IntegrationTest\Query\AbstractTableTest;
7
use TBolier\RethinkQL\Response\ResponseInterface;
8
9
class MaxTest extends AbstractTableTest
10
{
11
    /**
12
     * @return void
13
     * @throws \Exception
14
     */
15
    public function testMax(): void
16
    {
17
        $this->insertDocument(5);
18
        $this->insertDocument(4);
19
        $this->insertDocument(3);
20
        $this->insertDocument(2);
21
        $this->insertDocument(1);
22
23
        /** @var ResponseInterface $res */
24
        $res = $this->r()
25
            ->table('tabletest')
26
            ->max('number')
27
            ->run();
28
29
        /** @var array $array */
30
        $array = $res->getData();
31
32
        $this->assertArraySubset(['description' => 'A document description.'], $array);
33
    }
34
}
35