Skip to content

Commit 529631a

Browse files
committed
Use expectNotToPerformAssertions()
1 parent 76b0dc7 commit 529631a

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

‎tests/Io/FileSystemTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ public function testCreateDirectoriesShouldThrowIOException(): void
113113

114114
public function testCreateDirectoriesTwice(): void
115115
{
116+
$this->expectNotToPerformAssertions();
117+
116118
FileSystem::createDirectories('temp_directory');
117119
FileSystem::createDirectories('temp_directory');
118-
119-
self::addToAssertionCount(1);
120120
}
121121

122122
public function testCreateLinkWithInvalidFileLink(): void

‎tests/Json/JsonDecoderTest.php‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,11 @@ public function testMaxDepth(string $json, int $maxDepth, bool $expectException)
133133

134134
if ($expectException) {
135135
$this->expectException(JsonException::class);
136+
} else {
137+
$this->expectNotToPerformAssertions();
136138
}
137139

138140
$decoder->decode($json);
139-
140-
if (! $expectException) {
141-
$this->addToAssertionCount(1); // no assertion here
142-
}
143141
}
144142

145143
public static function providerMaxDepth(): array

‎tests/Json/JsonEncoderTest.php‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,11 @@ public function testMaxDepth(mixed $value, int $maxDepth, bool $expectException)
270270

271271
if ($expectException) {
272272
$this->expectException(JsonException::class);
273+
} else {
274+
$this->expectNotToPerformAssertions();
273275
}
274276

275277
$encoder->encode($value);
276-
277-
if (! $expectException) {
278-
$this->addToAssertionCount(1); // no assertion here
279-
}
280278
}
281279

282280
public static function providerMaxDepth(): array

0 commit comments

Comments
 (0)