public function testAppendRollback() { fFilesystem::begin(); $file = new fFile('output/fFile/one.txt'); $file->append('+one=two'); $this->assertEquals('one+one=two', file_get_contents('output/fFile/one.txt')); fFilesystem::rollback(); $this->assertEquals('one', file_get_contents('output/fFile/one.txt')); }
/** * Begins a transaction, or increases the level * * @internal * * @return void */ public static function begin() { // If the transaction was started by something else, don't even track it if (self::$transaction_level == 0 && fFilesystem::isInsideTransaction()) { return; } self::$transaction_level++; if (!fFilesystem::isInsideTransaction()) { fFilesystem::begin(); } }