Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Delay execution
<?php sleep(int $seconds): int
<?php     {

        $this->connection->executeStatement('SET SESSION wait_timeout=1');



        sleep(2);



        $query = $this->connection->getDatabasePlatform()

            ->getDummySelectSQL();
<?php         self::assertTrue($this->connection->beginTransaction());



        sleep(2); // during the sleep mysql will close the connection



        try {

            self::assertFalse(@$this->connection->commit()); // we will ignore `MySQL server has gone away` warnings