Skip to content

Commit 66bc4e2

Browse files
tswastbshaffer
authored andcommitted
BQ-DTS: test for actual API output (GoogleCloudPlatform#597)
1 parent 2a7e8a7 commit 66bc4e2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

bigquerydatatransfer/quickstart.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,3 @@
4242
$bqdtsClient->close();
4343
}
4444
# [END bigquerydatatransfer_quickstart]
45-
return true;

bigquerydatatransfer/test/quickstartTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ public function testQuickstart()
3434
);
3535
file_put_contents($file, $contents);
3636

37-
// Invoke quickstart.php
38-
$this->result = include $file;
37+
// Invoke quickstart.php and capture output
38+
ob_start();
39+
include $file;
40+
$result = ob_get_clean();
3941

4042
// Make sure it looks correct
41-
$this->assertTrue($this->result);
43+
$this->assertContains('ID: youtube_channel', $result);
4244
}
4345
}

0 commit comments

Comments
 (0)