diff --git a/src/BigQuery/Dataset.php b/src/BigQuery/Dataset.php index a404353ad0ef..87d217650a1a 100644 --- a/src/BigQuery/Dataset.php +++ b/src/BigQuery/Dataset.php @@ -266,7 +266,7 @@ public function createTable($id, array $options = []) * Example: * ``` * $info = $dataset->info(); - * echo $info['friendlyName']; + * echo $info['selfLink']; * ``` * * @see https://cloud.google.com/bigquery/docs/reference/v2/datasets#resource Datasets resource documentation. @@ -290,7 +290,7 @@ public function info(array $options = []) * ``` * $dataset->reload(); * $info = $dataset->info(); - * echo $info['friendlyName']; + * echo $info['selfLink']; * ``` * * @see https://cloud.google.com/bigquery/docs/reference/v2/datasets/get Datasets get API documentation. diff --git a/src/BigQuery/Table.php b/src/BigQuery/Table.php index df43c542b502..ebb29efa9dbc 100644 --- a/src/BigQuery/Table.php +++ b/src/BigQuery/Table.php @@ -539,7 +539,7 @@ public function insertRows(array $rows, array $options = []) * Example: * ``` * $info = $table->info(); - * echo $info['friendlyName']; + * echo $info['selfLink']; * ``` * * @see https://cloud.google.com/bigquery/docs/reference/v2/tables#resource Tables resource documentation. @@ -563,7 +563,7 @@ public function info(array $options = []) * ``` * $table->reload(); * $info = $table->info(); - * echo $info['friendlyName']; + * echo $info['selfLink']; * ``` * * @see https://cloud.google.com/bigquery/docs/reference/v2/tables/get Tables get API documentation. diff --git a/tests/snippets/BigQuery/DatasetTest.php b/tests/snippets/BigQuery/DatasetTest.php index 7bcfc8b7c020..c40dd01f1feb 100644 --- a/tests/snippets/BigQuery/DatasetTest.php +++ b/tests/snippets/BigQuery/DatasetTest.php @@ -136,27 +136,27 @@ public function testCreateTable() public function testInfo() { - $friendlyName = 'Friendly.'; - $dataset = $this->getDataset($this->connection, ['friendlyName' => $friendlyName]); + $selfLink = 'https://www.googleapis.com/bigquery/v2/projects/my-project/datasets/mynewdataset'; + $dataset = $this->getDataset($this->connection, ['selfLink' => $selfLink]); $snippet = $this->snippetFromMethod(Dataset::class, 'info'); $snippet->addLocal('dataset', $dataset); $res = $snippet->invoke(); - $this->assertEquals($friendlyName, $res->output()); + $this->assertEquals($selfLink, $res->output()); } public function testReload() { - $friendlyName = 'Friendly.'; + $selfLink = 'https://www.googleapis.com/bigquery/v2/projects/my-project/datasets/mynewdataset'; $this->connection->getDataset(Argument::any()) ->shouldBeCalledTimes(1) - ->willReturn(['friendlyName' => $friendlyName]); + ->willReturn(['selfLink' => $selfLink]); $dataset = $this->getDataset($this->connection); $snippet = $this->snippetFromMethod(Dataset::class, 'reload'); $snippet->addLocal('dataset', $dataset); $res = $snippet->invoke(); - $this->assertEquals($friendlyName, $res->output()); + $this->assertEquals($selfLink, $res->output()); } public function testId() diff --git a/tests/snippets/BigQuery/TableTest.php b/tests/snippets/BigQuery/TableTest.php index 088b1e3cf2c1..324b790d9430 100644 --- a/tests/snippets/BigQuery/TableTest.php +++ b/tests/snippets/BigQuery/TableTest.php @@ -62,7 +62,8 @@ public function setUp() ] ] ], - 'friendlyName' => 'Jeffrey' + 'friendlyName' => 'Jeffrey', + 'selfLink' => 'https://www.googleapis.com/bigquery/v2/projects/my-project/datasets/mynewdataset', ]; $this->mapper = new ValueMapper(false); @@ -274,7 +275,7 @@ public function testInfo() $snippet->addLocal('table', $this->table); $res = $snippet->invoke(); - $this->assertEquals('Jeffrey', $res->output()); + $this->assertEquals('https://www.googleapis.com/bigquery/v2/projects/my-project/datasets/mynewdataset', $res->output()); } public function testReload() @@ -285,13 +286,13 @@ public function testReload() $this->connection->getTable(Argument::any()) ->shouldBeCalled() ->willReturn([ - 'friendlyName' => 'El Jefe' + 'selfLink' => 'https://www.googleapis.com/bigquery/v2/projects/my-project/datasets/myupdateddataset' ]); $this->table->___setProperty('connection', $this->connection->reveal()); $res = $snippet->invoke(); - $this->assertEquals('El Jefe', $res->output()); + $this->assertEquals('https://www.googleapis.com/bigquery/v2/projects/my-project/datasets/myupdateddataset', $res->output()); } public function testId()