CountTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 19
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCount() 0 14 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\IntegrationTest\Aggregation;
5
6
use TBolier\RethinkQL\IntegrationTest\Operation\AbstractTableTest;
7
use TBolier\RethinkQL\Response\ResponseInterface;
8
9
class CountTest extends AbstractTableTest
10
{
11
    /**
12
     * @throws \Exception
13
     */
14
    public function testCount()
15
    {
16
        $this->insertDocumentWithNumber(5, 5);
17
        $this->insertDocumentWithNumber(4, 10);
18
        $this->insertDocumentWithNumber(3, 15);
19
        $this->insertDocumentWithNumber(2, 20);
20
        $this->insertDocumentWithNumber(1, 25);
21
22
        $res = $this->r()
23
            ->table('tabletest')
24
            ->count()
25
            ->run();
26
27
        $this->assertEquals(5, $res->getData());
0 ignored issues
show
Bug introduced by
The method getData() does not exist on TBolier\RethinkQL\Response\Cursor. ( Ignorable by Annotation )

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

27
        $this->assertEquals(5, $res->/** @scrutinizer ignore-call */ getData());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
    }
29
}
30