@@ -69,73 +69,73 @@ public function testResetStateAfterIncrement(): void
6969
7070 public function testIncrementMany (): void
7171 {
72- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
72+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
7373
74- $ this ->db ->table ('task ' )
75- ->where ('name ' , 'task1 ' )
76- ->incrementMany (['description ' => 2 , 'priority ' => 3 ]);
74+ $ this ->db ->table ('job ' )
75+ ->where ('name ' , 'job1 ' )
76+ ->incrementMany (['description ' => 2 , 'created_at ' => 3 ]);
7777
78- $ this ->seeInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '8 ' , 'priority ' => ' 4 ' ]);
78+ $ this ->seeInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '8 ' , 'created_at ' => 4 ]);
7979 }
8080
8181 public function testIncrementManyWithValue (): void
8282 {
83- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
83+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
8484
85- $ this ->db ->table ('task ' )
86- ->where ('name ' , 'task1 ' )
87- ->incrementMany (['description ' , 'priority ' ], 2 );
85+ $ this ->db ->table ('job ' )
86+ ->where ('name ' , 'job1 ' )
87+ ->incrementMany (['description ' , 'created_at ' ], 2 );
8888
89- $ this ->seeInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '8 ' , 'priority ' => ' 3 ' ]);
89+ $ this ->seeInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '8 ' , 'created_at ' => 3 ]);
9090 }
9191
9292 public function testIncrementManyWithNegativeValue (): void
9393 {
94- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
94+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
9595
96- $ this ->db ->table ('task ' )
97- ->where ('name ' , 'task1 ' )
98- ->incrementMany (['description ' => 2 , 'priority ' => -1 ]);
96+ $ this ->db ->table ('job ' )
97+ ->where ('name ' , 'job1 ' )
98+ ->incrementMany (['description ' => 2 , 'created_at ' => -1 ]);
9999
100- $ this ->seeInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '8 ' , 'priority ' => ' 0 ' ]);
100+ $ this ->seeInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '8 ' , 'created_at ' => 0 ]);
101101 }
102102
103103 public function testIncrementManyWithEmptyColumns (): void
104104 {
105- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
105+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
106106
107107 $ this ->expectException (InvalidArgumentException::class);
108108 $ this ->expectExceptionMessage ('Argument #1 ($columns) cannot be empty. ' );
109109
110- $ this ->db ->table ('task ' )
110+ $ this ->db ->table ('job ' )
111111 ->where ('name ' , 'task1 ' )
112112 ->incrementMany ([]);
113113 }
114114
115115 public function testIncrementManyWithNonIntegerValues (): void
116116 {
117- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
117+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
118118
119119 $ this ->expectException (TypeError::class);
120- $ this ->expectExceptionMessage ('Argument #1 ($columns) must contain only int values, string given for "priority ". ' );
120+ $ this ->expectExceptionMessage ('Argument #1 ($columns) must contain only int values, string given for "created_at ". ' );
121121
122- $ this ->db ->table ('task ' )
123- ->where ('name ' , 'task1 ' )
124- ->incrementMany (['description ' => 2 , 'priority ' => 'wrongValue ' ]);
122+ $ this ->db ->table ('job ' )
123+ ->where ('name ' , 'job1 ' )
124+ ->incrementMany (['description ' => 2 , 'created_at ' => 'wrongValue ' ]);
125125 }
126126
127127 public function testResetStateAfterIncrementMany (): void
128128 {
129- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
130- $ this ->hasInDatabase ('task ' , ['name ' => 'task2 ' , 'description ' => '2 ' , 'priority ' => ' 4 ' ]);
129+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
130+ $ this ->hasInDatabase ('job ' , ['name ' => 'job2 ' , 'description ' => '2 ' , 'created_at ' => 4 ]);
131131
132- $ builder = $ this ->db ->table ('task ' );
132+ $ builder = $ this ->db ->table ('job ' );
133133
134- $ builder ->where ('name ' , 'task1 ' )->incrementMany (['description ' , 'priority ' ]);
135- $ builder ->where ('name ' , 'task2 ' )->incrementMany (['description ' , 'priority ' ]);
134+ $ builder ->where ('name ' , 'job1 ' )->incrementMany (['description ' , 'created_at ' ]);
135+ $ builder ->where ('name ' , 'job2 ' )->incrementMany (['description ' , 'created_at ' ]);
136136
137- $ this ->seeInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '7 ' , 'priority ' => ' 2 ' ]);
138- $ this ->seeInDatabase ('task ' , ['name ' => 'task2 ' , 'description ' => '3 ' , 'priority ' => ' 5 ' ]);
137+ $ this ->seeInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '7 ' , 'created_at ' => 2 ]);
138+ $ this ->seeInDatabase ('job ' , ['name ' => 'job2 ' , 'description ' => '3 ' , 'created_at ' => 5 ]);
139139 }
140140
141141 public function testDecrement (): void
@@ -176,72 +176,72 @@ public function testResetStateAfterDecrement(): void
176176
177177 public function testDecrementMany (): void
178178 {
179- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
179+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
180180
181- $ this ->db ->table ('task ' )
182- ->where ('name ' , 'task1 ' )
183- ->decrementMany (['description ' => 2 , 'priority ' => 3 ]);
181+ $ this ->db ->table ('job ' )
182+ ->where ('name ' , 'job1 ' )
183+ ->decrementMany (['description ' => 2 , 'created_at ' => 3 ]);
184184
185- $ this ->seeInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '4 ' , 'priority ' => ' -2 ' ]);
185+ $ this ->seeInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '4 ' , 'created_at ' => - 2 ]);
186186 }
187187
188188 public function testDecrementManyWithValue (): void
189189 {
190- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
190+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
191191
192- $ this ->db ->table ('task ' )
193- ->where ('name ' , 'task1 ' )
194- ->decrementMany (['description ' , 'priority ' ], 2 );
192+ $ this ->db ->table ('job ' )
193+ ->where ('name ' , 'job1 ' )
194+ ->decrementMany (['description ' , 'created_at ' ], 2 );
195195
196- $ this ->seeInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '4 ' , 'priority ' => ' -1 ' ]);
196+ $ this ->seeInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '4 ' , 'created_at ' => - 1 ]);
197197 }
198198
199199 public function testDecrementManyWithNegativeValues (): void
200200 {
201- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
201+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
202202
203- $ this ->db ->table ('task ' )
204- ->where ('name ' , 'task1 ' )
205- ->decrementMany (['description ' => 2 , 'priority ' => -1 ]);
203+ $ this ->db ->table ('job ' )
204+ ->where ('name ' , 'job1 ' )
205+ ->decrementMany (['description ' => 2 , 'created_at ' => -1 ]);
206206
207- $ this ->seeInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '4 ' , 'priority ' => ' 2 ' ]);
207+ $ this ->seeInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '4 ' , 'created_at ' => 2 ]);
208208 }
209209
210210 public function testDecrementManyWithEmptyColumns (): void
211211 {
212- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
212+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
213213
214214 $ this ->expectException (InvalidArgumentException::class);
215215 $ this ->expectExceptionMessage ('Argument #1 ($columns) cannot be empty. ' );
216216
217- $ this ->db ->table ('task ' )
217+ $ this ->db ->table ('job ' )
218218 ->where ('name ' , 'task1 ' )
219219 ->decrementMany ([]);
220220 }
221221
222222 public function testDecrementManyWithNonIntegerValues (): void
223223 {
224- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
224+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
225225
226226 $ this ->expectException (TypeError::class);
227- $ this ->expectExceptionMessage ('Argument #1 ($columns) must contain only int values, string given for "priority ". ' );
227+ $ this ->expectExceptionMessage ('Argument #1 ($columns) must contain only int values, string given for "created_at ". ' );
228228
229- $ this ->db ->table ('task ' )
230- ->where ('name ' , 'task1 ' )
231- ->decrementMany (['description ' => 2 , 'priority ' => 'wrongValue ' ]);
229+ $ this ->db ->table ('job ' )
230+ ->where ('name ' , 'job1 ' )
231+ ->decrementMany (['description ' => 2 , 'created_at ' => 'wrongValue ' ]);
232232 }
233233
234234 public function testResetStateAfterDecrementMany (): void
235235 {
236- $ this ->hasInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '6 ' , 'priority ' => ' 1 ' ]);
237- $ this ->hasInDatabase ('task ' , ['name ' => 'task2 ' , 'description ' => '2 ' , 'priority ' => ' 4 ' ]);
236+ $ this ->hasInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '6 ' , 'created_at ' => 1 ]);
237+ $ this ->hasInDatabase ('job ' , ['name ' => 'job2 ' , 'description ' => '2 ' , 'created_at ' => 4 ]);
238238
239- $ builder = $ this ->db ->table ('task ' );
239+ $ builder = $ this ->db ->table ('job ' );
240240
241- $ builder ->where ('name ' , 'task1 ' )->decrementMany (['description ' , 'priority ' ]);
242- $ builder ->where ('name ' , 'task2 ' )->decrementMany (['description ' , 'priority ' ]);
241+ $ builder ->where ('name ' , 'job1 ' )->decrementMany (['description ' , 'created_at ' ]);
242+ $ builder ->where ('name ' , 'job2 ' )->decrementMany (['description ' , 'created_at ' ]);
243243
244- $ this ->seeInDatabase ('task ' , ['name ' => 'task1 ' , 'description ' => '5 ' , 'priority ' => ' 0 ' ]);
245- $ this ->seeInDatabase ('task ' , ['name ' => 'task2 ' , 'description ' => '1 ' , 'priority ' => ' 3 ' ]);
244+ $ this ->seeInDatabase ('job ' , ['name ' => 'job1 ' , 'description ' => '5 ' , 'created_at ' => 0 ]);
245+ $ this ->seeInDatabase ('job ' , ['name ' => 'job2 ' , 'description ' => '1 ' , 'created_at ' => 3 ]);
246246 }
247247}
0 commit comments