Test Failed
Pull Request — master (#32)
by Marc
03:18
created

OrderByTest::testLimit()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 8.9713
c 0
b 0
f 0
cc 1
eloc 15
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($this->r()->ordening('id'))
0 ignored issues
show
Bug introduced by
$this->r()->ordening('id') of type TBolier\RethinkQL\Query\OrdeningInterface is incompatible with the type string expected by parameter $value of TBolier\RethinkQL\Query\TableInterface::orderby(). ( Ignorable by Annotation )

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

25
            ->orderby(/** @scrutinizer ignore-type */ $this->r()->ordening('id'))
Loading history...
26
            ->run();
27
28
29
        $this->assertArraySubset(['id' => 5], $res->getData()[0]);
30
31
        /** @var ResponseInterface $res */
32
        $res = $this->r()
33
            ->table('tabletest')
34
            ->orderby('id')
35
            ->run();
36
37
        $this->assertArraySubset(['id' => 1], $res->getData()[0]);
38
    }
39
}
40