Google\Cloud\Tests\System\Datastore\RunQueryTest::testQueryWithProjection PHP 메소드

testQueryWithProjection() 공개 메소드

    public function testQueryWithProjection()
    {
        $query = self::$client->query()->kind(self::$kind)->projection('knownDances');
        $results = $this->runQueryAndSortResults($query);
        $data = self::$data;
        foreach ($data as &$d) {
            unset($d['middleName']);
            unset($d['lastName']);
        }
        $this->assertEquals($data[0], $results[0]->get());
        $this->assertEquals($data[1], $results[1]->get());
        $this->assertEquals($data[2], $results[2]->get());
        $this->assertEquals($data[3], $results[3]->get());
        $this->assertEquals(4, count($results));
    }