'rollback' =>
[static fn (Connection
$conn) =>
$conn->
rollBack(), '"ROLLBACK"'
],
];
} /**
* @dataProvider provideEndTransactionMethod
*/
public function testTransaction(callable
$endTransactionMethod, string
$expectedEndTransactionDebug) { $this->
init();
$this->conn->
setNestTransactionsWithSavepoints(true
);
$this->conn->
beginTransaction();
$this->conn->
beginTransaction();
$this->conn->
executeStatement('INSERT INTO products(name, price, stock) VALUES ("product1", 12.5, 5)'
);
$endTransactionMethod($this->conn
);
$endTransactionMethod($this->conn
);
$this->conn->
beginTransaction();
$this->conn->
executeStatement('INSERT INTO products(name, price, stock) VALUES ("product2", 15.5, 12)'
);
$endTransactionMethod($this->conn
);
$debug =
$this->debugDataHolder->
getData()['default'
] ??
[];
$this->
assertCount(9,
$debug);