@@ -130,6 +130,7 @@ private function getSchemaConfig() {
130130 return $ config ;
131131 }
132132
133+ #[\PHPUnit \Framework \Attributes \DoesNotPerformAssertions]
133134 public function testUpgrade (): void {
134135 [$ startSchema , $ endSchema ] = $ this ->getDuplicateKeySchemas ();
135136 $ migrator = $ this ->getMigrator ();
@@ -140,9 +141,9 @@ public function testUpgrade(): void {
140141 $ this ->connection ->insert ($ this ->tableName , ['id ' => 3 , 'name ' => 'qwerty ' ]);
141142
142143 $ migrator ->migrate ($ endSchema );
143- $ this ->addToAssertionCount (1 );
144144 }
145145
146+ #[\PHPUnit \Framework \Attributes \DoesNotPerformAssertions]
146147 public function testUpgradeDifferentPrefix (): void {
147148 $ oldTablePrefix = $ this ->config ->getSystemValueString ('dbtableprefix ' , 'oc_ ' );
148149
@@ -158,7 +159,6 @@ public function testUpgradeDifferentPrefix(): void {
158159 $ this ->connection ->insert ($ this ->tableName , ['id ' => 3 , 'name ' => 'qwerty ' ]);
159160
160161 $ migrator ->migrate ($ endSchema );
161- $ this ->addToAssertionCount (1 );
162162
163163 $ this ->config ->setSystemValue ('dbtableprefix ' , $ oldTablePrefix );
164164 }
@@ -172,12 +172,9 @@ public function testInsertAfterUpgrade(): void {
172172
173173 $ this ->connection ->insert ($ this ->tableName , ['id ' => 1 , 'name ' => 'foo ' ]);
174174 $ this ->connection ->insert ($ this ->tableName , ['id ' => 2 , 'name ' => 'bar ' ]);
175- try {
176- $ this ->connection ->insert ($ this ->tableName , ['id ' => 2 , 'name ' => 'qwerty ' ]);
177- $ this ->fail ('Expected duplicate key insert to fail ' );
178- } catch (Exception $ e ) {
179- $ this ->addToAssertionCount (1 );
180- }
175+
176+ $ this ->expectException (Exception::class);
177+ $ this ->connection ->insert ($ this ->tableName , ['id ' => 2 , 'name ' => 'qwerty ' ]);
181178 }
182179
183180 public function testAddingPrimaryKeyWithAutoIncrement (): void {
@@ -196,10 +193,9 @@ public function testAddingPrimaryKeyWithAutoIncrement(): void {
196193 $ migrator ->migrate ($ startSchema );
197194
198195 $ migrator ->migrate ($ endSchema );
199-
200- $ this ->addToAssertionCount (1 );
201196 }
202197
198+ #[\PHPUnit \Framework \Attributes \DoesNotPerformAssertions]
203199 public function testReservedKeywords (): void {
204200 $ startSchema = new Schema ([], [], $ this ->getSchemaConfig ());
205201 $ table = $ startSchema ->createTable ($ this ->tableName );
@@ -217,13 +213,12 @@ public function testReservedKeywords(): void {
217213 $ migrator ->migrate ($ startSchema );
218214
219215 $ migrator ->migrate ($ endSchema );
220-
221- $ this ->addToAssertionCount (1 );
222216 }
223217
224218 /**
225219 * Test for nextcloud/server#36803
226220 */
221+ #[\PHPUnit \Framework \Attributes \DoesNotPerformAssertions]
227222 public function testColumnCommentsInUpdate (): void {
228223 $ startSchema = new Schema ([], [], $ this ->getSchemaConfig ());
229224 $ table = $ startSchema ->createTable ($ this ->tableName );
@@ -241,8 +236,6 @@ public function testColumnCommentsInUpdate(): void {
241236 $ migrator ->migrate ($ startSchema );
242237
243238 $ migrator ->migrate ($ endSchema );
244-
245- $ this ->addToAssertionCount (1 );
246239 }
247240
248241 public function testAddingForeignKey (): void {
@@ -305,12 +298,10 @@ public function testNotNullEmptyValuesFailOracle(int $parameterType, $value, str
305298 $ this ->expectException (\Doctrine \DBAL \Exception \NotNullConstraintViolationException::class);
306299 }
307300
308- $ this ->connection ->insert (
301+ $ this ->assertSame ( 1 , $ this -> connection ->insert (
309302 $ this ->tableName ,
310303 ['id ' => 1 , 'will_it_blend ' => $ value ],
311304 ['id ' => ParameterType::INTEGER , 'will_it_blend ' => $ parameterType ],
312- );
313-
314- $ this ->addToAssertionCount (1 );
305+ ));
315306 }
316307}
0 commit comments