@@ -14,7 +14,7 @@ Nette\Database\Helpers::loadFromFile($connection, __DIR__ . "/../files/{$driverN
1414
1515test (function () use ($ context ) {
1616 Assert::same (3 , $ context ->table ('author ' )->count ());
17- $ context ->table ('author ' )->insert ([
17+ $ insert = $ context ->table ('author ' )->insert ([
1818 [
1919 'name ' => 'Catelyn Stark ' ,
2020 'web ' => 'http://example.com ' ,
@@ -26,15 +26,17 @@ test(function () use ($context) {
2626 'born ' => new DateTime ('2021-11-11 ' ),
2727 ],
2828 ]); // INSERT INTO `author` (`name`, `web`, `born`) VALUES ('Catelyn Stark', 'http://example.com', '2011-11-11 00:00:00'), ('Sansa Stark', 'http://example.com', '2021-11-11 00:00:00')
29+ Assert::same (2 , $ insert );
2930 Assert::same (5 , $ context ->table ('author ' )->count ());
3031
3132 $ context ->table ('book_tag ' )->where ('book_id ' , 1 )->delete (); // DELETE FROM `book_tag` WHERE (`book_id` = ?)
3233
3334 Assert::same (4 , $ context ->table ('book_tag ' )->count ());
34- $ context ->table ('book ' )->get (1 )->related ('book_tag ' )->insert ([ // SELECT * FROM `book` WHERE (`id` = ?)
35+ $ insert = $ context ->table ('book ' )->get (1 )->related ('book_tag ' )->insert ([ // SELECT * FROM `book` WHERE (`id` = ?)
3536 ['tag_id ' => 21 ],
3637 ['tag_id ' => 22 ],
3738 ['tag_id ' => 23 ],
3839 ]); // INSERT INTO `book_tag` (`tag_id`, `book_id`) VALUES (21, 1), (22, 1), (23, 1)
40+ Assert::same (3 , $ insert );
3941 Assert::same (7 , $ context ->table ('book_tag ' )->count ());
4042});
0 commit comments