Skip to content

Commit 2ea6ffb

Browse files
Update tests
1 parent 3aa1500 commit 2ea6ffb

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

Tests/CommandTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testWrongConvertDirs($path, $expectedMessage, $expectedException
3434
$exception = $e->getMessage();
3535
$exceptionClass = \get_class($e);
3636
}
37-
static::assertContains($expectedMessage, $exception);
37+
static::assertStringContainsString($expectedMessage, $exception);
3838
static::assertEquals($expectedException, $exceptionClass);
3939
}
4040

@@ -236,7 +236,7 @@ public function testConvertIdentifyImage($imageToIdentify, $expectedFormat, $exp
236236

237237
$content = $response->getOutput();
238238

239-
static::assertContains(\sprintf(
239+
static::assertStringContainsString(\sprintf(
240240
'%s %s %s %s %s',
241241
$imageToIdentify,
242242
$expectedFormat,
@@ -321,11 +321,10 @@ public function provideTestCommandString(): ?\Generator
321321
yield [$this->resourcesDir.'/moon_180.jpg', $this->resourcesDir.'/outputs/moon_geometry.jpg', '30x30+20+20', 50];
322322
}
323323

324-
/**
325-
* @expectedException \InvalidArgumentException
326-
*/
327324
public function testWrongExecutable(): void
328325
{
326+
$this->expectException(\InvalidArgumentException::class);
327+
329328
$command = new Command(IMAGEMAGICK_DIR);
330329
$command->getExecutable('this_executable_might_not_exist');
331330
}
@@ -341,6 +340,6 @@ public function testInexistingFiles(): void
341340
} catch (\Exception $e) {
342341
$exception = $e->getMessage();
343342
}
344-
static::assertContains(\sprintf('The file "%s" is not found.', $file), $exception);
343+
static::assertStringContainsString(\sprintf('The file "%s" is not found.', $file), $exception);
345344
}
346345
}

Tests/References/ColorsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testIncorrectColors($color): void
8181
} catch (\InvalidArgumentException $e) {
8282
$msg = $e->getMessage();
8383
}
84-
static::assertContains(
84+
static::assertStringContainsString(
8585
\sprintf('The specified color (%s) is invalid', $color),
8686
$msg
8787
);

Tests/References/ColorspaceValuesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testInvalidColorspaceValues($colorspaceValue): void
6666
} catch (\InvalidArgumentException $e) {
6767
$msg = $e->getMessage();
6868
}
69-
static::assertContains(
69+
static::assertStringContainsString(
7070
\sprintf('The specified colorspace value (%s) is invalid', \trim($colorspaceValue)),
7171
$msg
7272
);

Tests/References/InterlaceTypesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testInvalidInterlaceTypes($interlaceType): void
7070
} catch (\InvalidArgumentException $e) {
7171
$msg = $e->getMessage();
7272
}
73-
static::assertContains(
73+
static::assertStringContainsString(
7474
\sprintf('The specified interlace type (%s) is invalid', \mb_strtolower(\trim($interlaceType))),
7575
$msg
7676
);

0 commit comments

Comments
 (0)