@@ -51,6 +51,28 @@ public function testIncrementWithValue(): void
5151 $ this ->seeInDatabase ('job ' , ['name ' => 'incremental ' , 'description ' => '8 ' ]);
5252 }
5353
54+ public function testIncrementWithNumericColumns (): void
55+ {
56+ $ this ->hasInDatabase ('job ' , ['name ' => 'incremental ' , 'created_at ' => 6 ]);
57+
58+ $ this ->db ->table ('job ' )
59+ ->where ('name ' , 'incremental ' )
60+ ->increment ('created_at ' );
61+
62+ $ this ->seeInDatabase ('job ' , ['name ' => 'incremental ' , 'created_at ' => 7 ]);
63+ }
64+
65+ public function testIncrementWithNumericColumnsAndValue (): void
66+ {
67+ $ this ->hasInDatabase ('job ' , ['name ' => 'incremental ' , 'created_at ' => 6 ]);
68+
69+ $ this ->db ->table ('job ' )
70+ ->where ('name ' , 'incremental ' )
71+ ->increment ('created_at ' , 2 );
72+
73+ $ this ->seeInDatabase ('job ' , ['name ' => 'incremental ' , 'created_at ' => 8 ]);
74+ }
75+
5476 public function testResetStateAfterIncrement (): void
5577 {
5678 $ this ->hasInDatabase ('job ' , ['name ' => 'account1 ' , 'description ' => '10 ' ]);
@@ -87,6 +109,28 @@ public function testDecrementWithValue(): void
87109 $ this ->seeInDatabase ('job ' , ['name ' => 'incremental ' , 'description ' => '4 ' ]);
88110 }
89111
112+ public function testDecrementWithNumericColumns (): void
113+ {
114+ $ this ->hasInDatabase ('job ' , ['name ' => 'incremental ' , 'created_at ' => 6 ]);
115+
116+ $ this ->db ->table ('job ' )
117+ ->where ('name ' , 'incremental ' )
118+ ->decrement ('created_at ' );
119+
120+ $ this ->seeInDatabase ('job ' , ['name ' => 'incremental ' , 'created_at ' => 5 ]);
121+ }
122+
123+ public function testDecrementWithNumericColumnsAndValue (): void
124+ {
125+ $ this ->hasInDatabase ('job ' , ['name ' => 'incremental ' , 'created_at ' => 6 ]);
126+
127+ $ this ->db ->table ('job ' )
128+ ->where ('name ' , 'incremental ' )
129+ ->decrement ('created_at ' , 2 );
130+
131+ $ this ->seeInDatabase ('job ' , ['name ' => 'incremental ' , 'created_at ' => 4 ]);
132+ }
133+
90134 public function testResetStateAfterDecrement (): void
91135 {
92136 $ this ->hasInDatabase ('job ' , ['name ' => 'account1 ' , 'description ' => '10 ' ]);
0 commit comments