Test Failed
Pull Request — master (#69)
by Jérémy
02:57
created

HasFieldsTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testUniqueResult() 0 14 1
1
<?php
2
declare(strict_types=1);
3
4
namespace TBolier\RethinkQL\IntegrationTest\Manipulation;
5
6
use TBolier\RethinkQL\IntegrationTest\Query\AbstractTableTest;
7
use TBolier\RethinkQL\Response\Cursor;
8
9
class HasFieldsTest extends AbstractTableTest
10
{
11
    /**
12
     * @throws \Exception
13
     */
14
    public function testUniqueResult()
15
    {
16
        $this->insertDocument(1);
17
        $this->insertDocument(2);
18
        $this->insertDocumentWithNumber(3, 1);
19
20
        /** @var Cursor $cursor */
21
        $cursor = $this->r()
22
            ->table('tabletest')
23
            ->filter($this->r()->row()->hasFields('number'))
24
            ->run();
25
26
        $this->assertInstanceOf(\Iterator::class, $cursor);
27
        $this->assertEquals(1, $cursor->count());
28
    }
29
}
30