@@ -23,14 +23,14 @@ class GravatarTest extends TestCase
2323 | -----------------------------------------------------------------
2424 */
2525
26- public function setUp ()
26+ public function setUp (): void
2727 {
2828 parent ::setUp ();
2929
3030 $ this ->gravatar = $ this ->app ->make (\Arcanedev \Gravatar \Contracts \Gravatar::class);
3131 }
3232
33- public function tearDown ()
33+ public function tearDown (): void
3434 {
3535 unset($ this ->gravatar );
3636
@@ -69,47 +69,39 @@ public function it_can_set_and_get_image_size()
6969 }
7070 }
7171
72- /**
73- * @test
74- *
75- * @expectedException \Arcanedev\Gravatar\Exceptions\InvalidImageSizeException
76- * @expectedExceptionMessage Avatar size specified must be an integer.
77- */
72+ /** @test */
7873 public function it_must_throw_an_invalid_image_size_exception_on_type ()
7974 {
75+ $ this ->expectException (\Arcanedev \Gravatar \Exceptions \InvalidImageSizeException::class);
76+ $ this ->expectExceptionMessage ('Avatar size specified must be an integer. ' );
77+
8078 $ this ->gravatar ->setSize ('xl ' );
8179 }
8280
83- /**
84- * @test
85- *
86- * @expectedException \Arcanedev\Gravatar\Exceptions\InvalidImageSizeException
87- * @expectedExceptionMessage Avatar size must be within 0 pixels and 512 pixels.
88- */
81+ /** @test */
8982 public function it_must_throw_an_invalid_image_size_exception_on_min_and_max ()
9083 {
84+ $ this ->expectException (\Arcanedev \Gravatar \Exceptions \InvalidImageSizeException::class);
85+ $ this ->expectExceptionMessage ('Avatar size must be within 0 pixels and 512 pixels. ' );
86+
9187 $ this ->gravatar ->setSize (513 );
9288 }
9389
94- /**
95- * @test
96- *
97- * @expectedException \Arcanedev\Gravatar\Exceptions\InvalidImageRatingException
98- * @expectedExceptionMessage Invalid rating 'mature' specified, only 'g', 'pg', 'r' or 'x' are supported.
99- */
90+ /** @test */
10091 public function it_must_throw_an_invalid_rating_exception ()
10192 {
93+ $ this ->expectException (\Arcanedev \Gravatar \Exceptions \InvalidImageRatingException::class);
94+ $ this ->expectExceptionMessage ("Invalid rating 'mature' specified, only 'g', 'pg', 'r' or 'x' are supported. " );
95+
10296 $ this ->gravatar ->setRating ('mature ' );
10397 }
10498
105- /**
106- * @test
107- *
108- * @expectedException \Arcanedev\Gravatar\Exceptions\InvalidImageUrlException
109- * @expectedExceptionMessage The default image specified is not a recognized gravatar "default" and is not a valid URL
110- */
99+ /** @test */
111100 public function it_must_throw_invalid_image_url_on_setting_default_image ()
112101 {
102+ $ this ->expectException (\Arcanedev \Gravatar \Exceptions \InvalidImageUrlException::class);
103+ $ this ->expectExceptionMessage ('The default image specified is not a recognized gravatar "default" and is not a valid URL ' );
104+
113105 new Gravatar ('hello.com/img.png ' );
114106 }
115107
0 commit comments