Passed
Pull Request — master (#9)
by Quang
02:11
created

ArrayConnectionTest::testArrayLength()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Digia\Lumen\GraphQL\Tests;
4
5
use Digia\Lumen\GraphQL\ArrayConnection;
6
7
/**
8
 * Class ArrayConnectionTest
9
 * @package Digia\Lumen\GraphQL\Tests
10
 */
11
class ArrayConnectionTest extends TestCase
12
{
13
14
    /**
15
     * Tests that the array length is included in results
16
     */
17
    public function testArrayLength()
18
    {
19
        $data   = ['foo' => 1, 'bar' => 2];
20
        $result = ArrayConnection::connectionFromArraySlice($data, [], 0, count($data));
21
22
        $this->assertEquals(2, $result['total']);
23
    }
24
25
}
26