Failed Conditions
Pull Request — master (#32)
by Timon
03:20
created

LimitTest::testLimit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
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\Cursor;
8
9
class LimitTest extends AbstractTableTest
10
{
11
    /**
12
     * @return void
13
     * @throws \Exception
14
     */
15
    public function testLimit(): void
16
    {
17
        $this->insertDocument(1);
18
        $this->insertDocument(2);
19
        $this->insertDocument(3);
20
        $this->insertDocument(4);
21
        $this->insertDocument(5);
22
23
        /** @var Cursor $cursor */
24
        $cursor = $this->r()
25
            ->table('tabletest')
26
            ->limit(2)
27
            ->run();
0 ignored issues
show
Bug introduced by
The method run() does not exist on TBolier\RethinkQL\Query\...on\AggregationInterface. It seems like you code against a sub-type of said class. However, the method does not exist in TBolier\RethinkQL\Query\...tion\OperationInterface or TBolier\RethinkQL\Query\TableInterface. Are you sure you never get one of those? ( Ignorable by Annotation )

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

27
            ->/** @scrutinizer ignore-call */ run();
Loading history...
28
29
        $this->assertCount(2, $cursor);
30
    }
31
32
//    /**
33
//     * @return void
34
//     * @throws \Exception
35
//     */
36
//    public function testFilterAndLimit(): void
37
//    {
38
//        $this->insertDocument(1);
39
//        $this->insertDocument(2);
40
//        $this->insertDocument(3);
41
//        $this->insertDocument(4);
42
//        $this->insertDocument(5);
43
//
44
//        /** @var Cursor $cursor */
45
//        $cursor = $this->r()
46
//            ->table('tabletest')
47
//            ->filter(['description' => 'A document description.'])
48
//            ->limit(2)
49
//            ->run();
50
//
51
//        $this->assertCount(2, $cursor);
52
//    }
53
}
54