Skip to content

Instantly share code, notes, and snippets.

@odinuv
Created September 27, 2018 15:11
Show Gist options
  • Save odinuv/0ac3b0cc6f6232ae4b2622b52b5a7947 to your computer and use it in GitHub Desktop.
Save odinuv/0ac3b0cc6f6232ae4b2622b52b5a7947 to your computer and use it in GitHub Desktop.
Testing the untestable: Testing connection retry fixed
<?php
testConnectionRetry()
{
$rows = 1000000;
$credentials = $this->setupTestDatabaseConnetion();
$table = $this->createLargeTable($credentials, $rows);
$configFile = $this->createConfigFile($credentials, $table);
$extractor = new Extractor($configFile);
exec('php killConnection.php 10 > /dev/null &');
$resultFile = $extractor->run();
self::assertTrue($rows, $this->getRowCunt($resultFile));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment