Skip to content
This repository has been archived by the owner on Apr 7, 2019. It is now read-only.

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored and StyleCIBot committed Dec 28, 2018
1 parent d1ceb83 commit bbcbff3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
17 changes: 8 additions & 9 deletions src/Exceptions/FetchException.php
Expand Up @@ -14,7 +14,6 @@
namespace AltThree\Emoji\Exceptions;

use Exception;
use PHPUnit\Framework\TestCase;

/**
* This is the emoji fetch exception class.
Expand All @@ -23,15 +22,15 @@
*/
class FetchException extends Exception implements EmojiExceptionInterface
{
/**
* Create a new emoji fetch exception instance.
*
* @param \Exception $e
*
* @return void
*/
/**
* Create a new emoji fetch exception instance.
*
* @param \Exception $e
*
* @return void
*/
public function __construct(Exception $e)
{
parent::__construct('Failed to fetch the emoji map.', 0, $e);
parent::__construct('Failed to fetch the emoji map.', 0, $e);
}
}
3 changes: 1 addition & 2 deletions tests/EmojiParserTest.php
Expand Up @@ -52,8 +52,7 @@ public function testRender($input, $output)
public function testRepoFailure()
{
$this->app->singleton(RepositoryInterface::class, function () {
return new class implements RepositoryInterface
{
return new class() implements RepositoryInterface {
public function get()
{
throw new FetchException(new Exception());
Expand Down
4 changes: 2 additions & 2 deletions tests/Repositories/CachingRepositoryTest.php
Expand Up @@ -16,13 +16,13 @@
use AltThree\Emoji\Exceptions\FetchException;
use AltThree\Emoji\Repositories\CachingRepository;
use AltThree\Emoji\Repositories\RepositoryInterface;
use GrahamCampbell\TestBenchCore\MockeryTrait;
use Exception;
use GrahamCampbell\TestBenchCore\MockeryTrait;
use Illuminate\Cache\Repository as Cache;
use Illuminate\Contracts\Cache\Repository;
use Illuminate\Contracts\Cache\Store;
use PHPUnit\Framework\TestCase;
use Mockery;
use PHPUnit\Framework\TestCase;

/**
* This is the caching repository test class.
Expand Down
11 changes: 6 additions & 5 deletions tests/Repositories/GitHubRepositoryTest.php
Expand Up @@ -13,16 +13,15 @@

namespace AltThree\Tests\Emoji\Exceptions;

use AltThree\Emoji\Exceptions\FetchException;
use AltThree\Emoji\Repositories\GitHubRepository;
use AltThree\Emoji\Repositories\RepositoryInterface;
use GrahamCampbell\TestBenchCore\MockeryTrait;
use Exception;
use GrahamCampbell\TestBenchCore\MockeryTrait;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\GuzzleException;
use Mockery;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ResponseInterface;
use Mockery;

/**
* This is the github repository test class.
Expand Down Expand Up @@ -81,7 +80,8 @@ public function testWithoutTokenFail()

$c->shouldReceive('request')->once()
->with('get', 'https://api.github.com/emojis', ['headers' => ['Accept' => 'application/vnd.github.v3+json']])
->andThrow(new class extends Exception implements GuzzleException {});
->andThrow(new class() extends Exception implements GuzzleException {
});

$r->get();
}
Expand All @@ -97,7 +97,8 @@ public function testWithTokenFail()

$c->shouldReceive('request')->once()
->with('get', 'https://api.github.com/emojis', ['headers' => ['Accept' => 'application/vnd.github.v3+json', 'Authorization' => 'token ABCDEFGH']])
->andThrow(new class extends Exception implements GuzzleException {});
->andThrow(new class() extends Exception implements GuzzleException {
});

$r->get();
}
Expand Down

0 comments on commit bbcbff3

Please sign in to comment.