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

HasFieldsTest::testUniqueResult()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 14
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
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