Skip to content

Commit 274c426

Browse files
committed
Add fluid transaction check. Closes #922.
1 parent 184954f commit 274c426

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: RedBeanPHP/Facade.php

+1
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ public static function useISNULLConditions( $mode )
381381
*/
382382
public static function transaction( $callback )
383383
{
384+
if ( !self::$allowFluidTransactions && !self::$redbean->isFrozen() ) return FALSE;
384385
return Transaction::transaction( self::$adapter, $callback );
385386
}
386387

Diff for: testing/RedUNIT/Blackhole/Misc.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -396,13 +396,14 @@ public function testTransactionInFacade()
396396
pass();
397397
}
398398
asrt( R::count( 'bean' ), 1 );
399-
R::freeze( FALSE );
400399
try {
401400
R::transaction( 'nope' );
402401
fail();
403402
} catch (\Exception $e ) {
404403
pass();
405404
}
405+
R::freeze( FALSE );
406+
asrt(R::transaction( 'nope' ), FALSE);
406407
testpack( 'Test Camelcase 2 underscore' );
407408
$names = array(
408409
'oneACLRoute' => 'one_acl_route',

0 commit comments

Comments
 (0)