Passed
Pull Request — master (#31)
by Marc
03:48
created

OrderByTest::testLimit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\IntegrationTest\Query;
5
6
use TBolier\RethinkQL\Response\ResponseInterface;
7
8
class OrderByTest extends AbstractTableTest
9
{
10
    /**
11
     * @return void
12
     * @throws \Exception
13
     */
14
    public function testLimit(): void
15
    {
16
        $this->insertDocument(5);
17
        $this->insertDocument(4);
18
        $this->insertDocument(3);
19
        $this->insertDocument(2);
20
        $this->insertDocument(1);
21
22
        /** @var ResponseInterface $res */
23
        $res = $this->r()
24
            ->table('tabletest')
25
            ->orderBy('id')
0 ignored issues
show
Bug introduced by
The method orderBy() does not exist on TBolier\RethinkQL\Query\TableInterface. Since it exists in all sub-types, consider adding an abstract or default implementation to TBolier\RethinkQL\Query\TableInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
            ->/** @scrutinizer ignore-call */ orderBy('id')
Loading history...
26
            ->run();
27
28
        /** @var array $array */
29
        $array = $res->getData();
30
31
        $this->assertArraySubset(['id' => 1], $array[0]);
32
    }
33
}
34