File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ class TasksQuery
22
22
*/
23
23
private ?array $ canceledBy = null ;
24
24
25
+
26
+ /**
27
+ * @var int|null
28
+ */
29
+ private ?int $ batchUid = null ;
30
+
25
31
/**
26
32
* @return $this
27
33
*/
@@ -54,6 +60,16 @@ public function setLimit(int $limit): self
54
60
return $ this ;
55
61
}
56
62
63
+ /**
64
+ * @return $this
65
+ */
66
+ public function setBatchUid (int $ batchUid ): self
67
+ {
68
+ $ this ->batchUid = $ batchUid ;
69
+
70
+ return $ this ;
71
+ }
72
+
57
73
public function toArray (): array
58
74
{
59
75
return array_filter (
@@ -63,8 +79,12 @@ public function toArray(): array
63
79
'from ' => $ this ->from ,
64
80
'limit ' => $ this ->limit ,
65
81
'canceledBy ' => $ this ->formatArray ($ this ->canceledBy ),
82
+ 'batchUid ' => $ this ->batchUid ,
66
83
]
67
- ), static function ($ item ) { return null !== $ item ; }
84
+ ),
85
+ static function ($ item ) {
86
+ return null !== $ item ;
87
+ }
68
88
);
69
89
}
70
90
}
Original file line number Diff line number Diff line change @@ -126,6 +126,20 @@ public function testGetAllTasksByIndexWithFilter(): void
126
126
self ::assertGreaterThan (0 , $ response ->getTotal ());
127
127
}
128
128
129
+ public function getAllTasksByBatchFilter (): void
130
+ {
131
+ [$ promise , $ response ] = $ this ->seedIndex ();
132
+
133
+ self ::assertIsArray ($ promise );
134
+ $ task = $ this ->client ->getTask ($ promise ['taskUid ' ]);
135
+
136
+ $ response = $ this ->client ->getTasks ((new TasksQuery ())
137
+ ->setBatchUid ($ task ['uid ' ])
138
+ );
139
+
140
+ self ::assertIsArray ($ response ->getResults ());
141
+ }
142
+
129
143
public function testCancelTasksWithFilter (): void
130
144
{
131
145
$ date = new \DateTime ('yesterday ' );
@@ -135,7 +149,7 @@ public function testCancelTasksWithFilter(): void
135
149
self ::assertSame ('taskCancelation ' , $ promise ['type ' ]);
136
150
$ response = $ this ->client ->waitForTask ($ promise ['taskUid ' ]);
137
151
138
- self ::assertSame ('? ' . $ query , $ response ['details ' ]['originalFilter ' ]);
152
+ self ::assertSame ('? ' . $ query , $ response ['details ' ]['originalFilter ' ]);
139
153
self ::assertSame ('taskCancelation ' , $ response ['type ' ]);
140
154
self ::assertSame ('succeeded ' , $ response ['status ' ]);
141
155
}
You can’t perform that action at this time.
0 commit comments