Created
September 27, 2018 15:27
-
-
Save odinuv/01fb5a1d64aa6dfa83c579679d2fad1d to your computer and use it in GitHub Desktop.
Testing the untestable: Test network kill during fetch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function testNetworkKillerFetch(): void | |
{ | |
$this->setupLargeTable(); | |
ErrorHandler::register(null, true); | |
$stmt = $this->taintedPdo->query('SELECT * FROM largeTable LIMIT 100000'); | |
$stmt->execute(); | |
self::expectException(\ErrorException::class); | |
self::expectExceptionMessage('Warning: Empty row packet body'); | |
$this->killerEnabled = 'fetch'; | |
while ($row = $stmt->fetch()) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment