Conditions | 2 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | public function testCommitFalse() : void |
||
32 | { |
||
33 | $this->connection->query('SET SESSION wait_timeout=1'); |
||
34 | |||
35 | $table = new Table('foo'); |
||
36 | $table->addColumn('id', 'integer'); |
||
37 | $table->setPrimaryKey(['id']); |
||
38 | |||
39 | $this->connection->getSchemaManager()->createTable($table); |
||
40 | |||
41 | self::assertEquals('foo', $table->getName()); |
||
42 | try { |
||
43 | $this->assertTrue($this->connection->beginTransaction()); |
||
44 | $this->connection->executeUpdate('INSERT INTO foo (id) VALUES(1)'); |
||
45 | |||
46 | sleep(2); // during the sleep mysql will close the connection |
||
47 | |||
48 | $this->assertFalse(@$this->connection->commit()); // we will ignore `MySQL server has gone away` warnings |
||
49 | } catch (Throwable $exception) { |
||
50 | $this->fail('Is the PHP/PDO bug https://bugs.php.net/bug.php?id=66528 fixed? Normally no exception is thrown.'); |
||
51 | } |
||
54 |