public function testLoadsDataToTable($data)
{
$job = self::$table->load($data, ['jobConfig' => ['sourceFormat' => 'CSV']]);
$backoff = new ExponentialBackoff(8);
$backoff->execute(function () use($job) {
$job->reload();
if (!$job->isComplete()) {
throw new \Exception();
}
});
if (!$job->isComplete()) {
$this->fail('Job failed to complete within the allotted time.');
}
self::$expectedRows += count(file(__DIR__ . '/../data/table-data.csv'));
$actualRows = count(iterator_to_array(self::$table->rows()));
$this->assertEquals(self::$expectedRows, $actualRows);
}