1<?php23declare(strict_types=1);45namespaceTests\Fake;67useZtdQuery\Sql\TransactionTarget;89/**10 * A transaction target that records what it was asked for.11 *12 * Nothing here keeps transaction state, so a test can check that a statement13 * asked for the one thing it stands for and handed over the name it carried.14 */15finalclassRecordingTransactionTargetimplementsTransactionTarget16{17/**18 * @var list<string> What this target was asked for, in order19 */20publicarray$asked = [];2122/**23 * Records that a transaction was opened.24 */25publicfunctionbegin(): void26 {27$this->asked[] = 'begin';28 }2930/**31 * Records that the transaction was kept.32 */33publicfunctioncommit(): void34 {35$this->asked[] = 'commit';36 }3738/**39 * Records that the transaction was undone.40 */41publicfunctionrollBack(): void42 {43$this->asked[] = 'rollBack';44 }4546/**47 * Records that a point was marked.48 *49 * @param string $name Name the point is marked with50 */51publicfunctionsavepoint(string$name): void52 {53$this->asked[] = "savepoint {$name}";54 }5556/**57 * Records that the transaction was brought back to a point.58 *59 * @param string $name Name the point was marked with60 */61publicfunctionrollBackTo(string$name): void62 {63$this->asked[] = "rollBackTo {$name}";64 }6566/**67 * Records that a point was forgotten.68 *69 * @param string $name Name the point was marked with70 */71publicfunctionrelease(string$name): void72 {73$this->asked[] = "release {$name}";74 }75}76