@@ -14,7 +14,7 @@ Nette\Database\Helpers::loadFromFile($connection, __DIR__ . "/../files/{$driverN
14
14
15
15
test (function () use ($ context ) {
16
16
Assert::same (3 , $ context ->table ('author ' )->count ());
17
- $ context ->table ('author ' )->insert ([
17
+ $ insert = $ context ->table ('author ' )->insert ([
18
18
[
19
19
'name ' => 'Catelyn Stark ' ,
20
20
'web ' => 'http://example.com ' ,
@@ -26,15 +26,17 @@ test(function () use ($context) {
26
26
'born ' => new DateTime ('2021-11-11 ' ),
27
27
],
28
28
]); // 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 );
29
30
Assert::same (5 , $ context ->table ('author ' )->count ());
30
31
31
32
$ context ->table ('book_tag ' )->where ('book_id ' , 1 )->delete (); // DELETE FROM `book_tag` WHERE (`book_id` = ?)
32
33
33
34
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` = ?)
35
36
['tag_id ' => 21 ],
36
37
['tag_id ' => 22 ],
37
38
['tag_id ' => 23 ],
38
39
]); // INSERT INTO `book_tag` (`tag_id`, `book_id`) VALUES (21, 1), (22, 1), (23, 1)
40
+ Assert::same (3 , $ insert );
39
41
Assert::same (7 , $ context ->table ('book_tag ' )->count ());
40
42
});
0 commit comments