File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace Yiisoft \Db \Mssql \Tests ;
6
6
7
+ use Yiisoft \Db \Mssql \BatchQueryResult ;
7
8
use Yiisoft \Db \Mssql \Tests \Support \TestTrait ;
9
+ use Yiisoft \Db \Query \Query ;
8
10
use Yiisoft \Db \Tests \Common \CommonBatchQueryResultTest ;
9
11
10
12
/**
13
15
final class BatchQueryResultTest extends CommonBatchQueryResultTest
14
16
{
15
17
use TestTrait;
18
+
19
+ public function testBatchQueryResultWithoutPopulate (): void
20
+ {
21
+ $ db = $ this ->getConnection (true );
22
+
23
+ $ query = new Query ($ db );
24
+ $ query ->from ('customer ' )->orderBy ('id ' )->limit (3 )->indexBy ('id ' );
25
+
26
+ $ batchQueryResult = new BatchQueryResult ($ query );
27
+
28
+ $ customers = $ this ->getAllRowsFromBatch ($ batchQueryResult );
29
+
30
+ $ this ->assertCount (3 , $ customers );
31
+ $ this ->assertEquals ('user1 ' , $ customers [0 ]['name ' ]);
32
+ $ this ->assertEquals ('user2 ' , $ customers [1 ]['name ' ]);
33
+ $ this ->assertEquals ('user3 ' , $ customers [2 ]['name ' ]);
34
+ }
16
35
}
You can’t perform that action at this time.
0 commit comments