diff --git a/RedBeanPHP/Facade.php b/RedBeanPHP/Facade.php index 0054ebdf..00fd36e1 100644 --- a/RedBeanPHP/Facade.php +++ b/RedBeanPHP/Facade.php @@ -381,6 +381,7 @@ public static function useISNULLConditions( $mode ) */ public static function transaction( $callback ) { + if ( !self::$allowFluidTransactions && !self::$redbean->isFrozen() ) return FALSE; return Transaction::transaction( self::$adapter, $callback ); } diff --git a/testing/RedUNIT/Blackhole/Misc.php b/testing/RedUNIT/Blackhole/Misc.php index 8330481f..1c00bf54 100644 --- a/testing/RedUNIT/Blackhole/Misc.php +++ b/testing/RedUNIT/Blackhole/Misc.php @@ -396,13 +396,14 @@ public function testTransactionInFacade() pass(); } asrt( R::count( 'bean' ), 1 ); - R::freeze( FALSE ); try { R::transaction( 'nope' ); fail(); } catch (\Exception $e ) { pass(); } + R::freeze( FALSE ); + asrt(R::transaction( 'nope' ), FALSE); testpack( 'Test Camelcase 2 underscore' ); $names = array( 'oneACLRoute' => 'one_acl_route',