@@ -288,30 +288,33 @@ public function test_cast_defaults()
288
288
public function test_transaction_committed ()
289
289
{
290
290
$ original = Author::count ();
291
- Author::transaction (function () { Author::create (array ("name " => "blah " )); });
291
+ $ ret = Author::transaction (function () { Author::create (array ("name " => "blah " )); });
292
292
$ this ->assert_equals ($ original +1 ,Author::count ());
293
+ $ this ->assert_true ($ ret );
293
294
}
294
-
295
+
295
296
public function test_transaction_committed_when_returning_true ()
296
297
{
297
298
$ original = Author::count ();
298
- Author::transaction (function () { Author::create (array ("name " => "blah " )); return true ; });
299
+ $ ret = Author::transaction (function () { Author::create (array ("name " => "blah " )); return true ; });
299
300
$ this ->assert_equals ($ original +1 ,Author::count ());
301
+ $ this ->assert_true ($ ret );
300
302
}
301
-
303
+
302
304
public function test_transaction_rolledback_by_returning_false ()
303
305
{
304
306
$ original = Author::count ();
305
-
306
- Author::transaction (function ()
307
+
308
+ $ ret = Author::transaction (function ()
307
309
{
308
310
Author::create (array ("name " => "blah " ));
309
311
return false ;
310
312
});
311
-
313
+
312
314
$ this ->assert_equals ($ original ,Author::count ());
315
+ $ this ->assert_false ($ ret );
313
316
}
314
-
317
+
315
318
public function test_transaction_rolledback_by_throwing_exception ()
316
319
{
317
320
$ original = Author::count ();
@@ -461,4 +464,4 @@ public function test_get_real_attribute_name()
461
464
$ this ->assert_equals (null , $ venue ->get_real_attribute_name ('invalid_field ' ));
462
465
}
463
466
};
464
- ?>
467
+ ?>
0 commit comments