Skip to content

Commit 5b13a6e

Browse files
Merge pull request #13 from ARCANEDEV/update-laravel_5.8
Adding Laravel 5.8 support
2 parents 2d9b547 + 54d5c39 commit 5b13a6e

File tree

9 files changed

+47
-44
lines changed

9 files changed

+47
-44
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/Gravatar/rele
2020
### Features
2121

2222
* Framework-agnostic package.
23-
* Laravel `5.0` to `5.7` are Supported.
23+
* Laravel `5.0` to `5.8` are Supported.
2424
* Easy setup & configuration.
2525
* Well tested (100% code coverage with maximum code quality).
2626
* Made with :heart: & :coffee:.

_docs/0-Home.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/Gravatar/rele
77
### Features
88

99
* Framework-agnostic package.
10-
* Laravel `5.0` to `5.7` are Supported.
10+
* Laravel `5.0` to `5.8` are Supported.
1111
* Easy setup & configuration.
1212
* Well tested (100% code coverage with maximum code quality).
1313
* Made with :heart: & :coffee:.

_docs/1-Installation-and-Setup.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The Gravatar package has a few system requirements:
2121
| ![Gravatar v2.1.x][gravatar_2_1] | ![Laravel v5.5][laravel_5_5] |
2222
| ![Gravatar v2.2.x][gravatar_2_2] | ![Laravel v5.6][laravel_5_6] |
2323
| ![Gravatar v2.3.x][gravatar_2_3] | ![Laravel v5.7][laravel_5_7] |
24+
| ![Gravatar v2.4.x][gravatar_2_4] | ![Laravel v5.8][laravel_5_8] |
2425

2526
> **Note :** This is a framework-agnostic package, so you can use any version of this package in your PHP project.
2627
@@ -32,12 +33,14 @@ The Gravatar package has a few system requirements:
3233
[laravel_5_5]: https://img.shields.io/badge/v5.5-supported-brightgreen.svg?style=flat-square "Laravel v5.5"
3334
[laravel_5_6]: https://img.shields.io/badge/v5.6-supported-brightgreen.svg?style=flat-square "Laravel v5.6"
3435
[laravel_5_7]: https://img.shields.io/badge/v5.7-supported-brightgreen.svg?style=flat-square "Laravel v5.7"
36+
[laravel_5_8]: https://img.shields.io/badge/v5.8-supported-brightgreen.svg?style=flat-square "Laravel v5.8"
3537

3638
[gravatar_1_x]: https://img.shields.io/badge/version-1.*-blue.svg?style=flat-square "Gravatar v1.*"
3739
[gravatar_2_0]: https://img.shields.io/badge/version-2.0.*-blue.svg?style=flat-square "Gravatar v2.0.*"
3840
[gravatar_2_1]: https://img.shields.io/badge/version-2.1.*-blue.svg?style=flat-square "Gravatar v2.1.*"
3941
[gravatar_2_2]: https://img.shields.io/badge/version-2.2.*-blue.svg?style=flat-square "Gravatar v2.2.*"
4042
[gravatar_2_3]: https://img.shields.io/badge/version-2.3.*-blue.svg?style=flat-square "Gravatar v2.3.*"
43+
[gravatar_2_4]: https://img.shields.io/badge/version-2.4.*-blue.svg?style=flat-square "Gravatar v2.4.*"
4144

4245
## Composer
4346

_docs/3-Usage.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,16 @@ public function get($email, $hash = true);
224224
*/
225225
public function image($email, $alt = null, array $attributes = [], $rating = null);
226226

227+
/**
228+
* Get profile's data.
229+
*
230+
* @param string $email
231+
* @param mixed|null $default
232+
*
233+
* @return array|mixed
234+
*/
235+
public function profile($email, $default = null);
236+
227237
/**
228238
* Enable the use of the secure protocol for image URLs.
229239
*

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
"require": {
1919
"php" : ">=7.1.3",
2020
"ext-curl": "*",
21-
"arcanedev/support": "~4.4.0",
22-
"arcanedev/php-html": "~1.0"
21+
"arcanedev/support": "~4.5.0",
22+
"arcanedev/php-html": "~2.0"
2323
},
2424
"require-dev": {
25-
"orchestra/testbench": "~3.7.0",
26-
"phpunit/phpcov": "~5.0",
27-
"phpunit/phpunit": "~7.0"
25+
"orchestra/testbench": "~3.8.0",
26+
"phpunit/phpcov": "~5.0|~6.0",
27+
"phpunit/phpunit": "~7.0|~8.0"
2828
},
2929
"autoload": {
3030
"psr-4": {

tests/GravatarServiceProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ class GravatarServiceProviderTest extends TestCase
2323
| -----------------------------------------------------------------
2424
*/
2525

26-
public function setUp()
26+
public function setUp(): void
2727
{
2828
parent::setUp();
2929

3030
$this->provider = $this->app->getProvider(GravatarServiceProvider::class);
3131
}
3232

33-
public function tearDown()
33+
public function tearDown(): void
3434
{
3535
unset($this->provider);
3636

tests/GravatarTest.php

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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

tests/ProfileTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ class ProfileTest extends TestCase
2323
| -----------------------------------------------------------------
2424
*/
2525

26-
public function setUp()
26+
public function setUp(): void
2727
{
2828
parent::setUp();
2929

3030
$this->profile = new Profile;
3131
}
3232

33-
protected function tearDown()
33+
protected function tearDown(): void
3434
{
3535
unset($this->profile);
3636

@@ -82,14 +82,12 @@ public function it_can_switch_to_unsecured_url()
8282
);
8383
}
8484

85-
/**
86-
* @test
87-
*
88-
* @expectedException \Arcanedev\Gravatar\Exceptions\InvalidProfileFormatException
89-
* @expectedExceptionMessage The format [csv] is invalid, the supported formats are: json, xml, php, vcf, qr
90-
*/
85+
/** @test */
9186
public function it_must_throw_an_exception_on_invalid_format()
9287
{
88+
$this->expectException(\Arcanedev\Gravatar\Exceptions\InvalidProfileFormatException::class);
89+
$this->expectExceptionMessage('The format [csv] is invalid, the supported formats are: json, xml, php, vcf, qr');
90+
9391
$this->profile->setFormat('csv');
9492
}
9593
}

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ abstract class TestCase extends BaseTestCase
2727
| -----------------------------------------------------------------
2828
*/
2929

30-
public function setUp()
30+
public function setUp(): void
3131
{
3232
parent::setUp();
3333

0 commit comments

Comments
 (0)