Skip to content

Commit

Permalink
update friendsofphp/php-cs-fixer (v3.4.0 => v3.21.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
WengerK committed Jul 12, 2023
1 parent 497bd90 commit 205630f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"require-dev": {
"phpunit/phpunit": "^9",
"symfony/dotenv": "^5.4",
"friendsofphp/php-cs-fixer": "^3.0",
"friendsofphp/php-cs-fixer": "^3.21",
"phpmd/phpmd": "^2.6",
"sebastian/phpcpd": "^6.0",
"php-coveralls/php-coveralls": "^2.1",
Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/AbstractResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Antistatique\Pricehubble\Pricehubble;
use Antistatique\Pricehubble\Resource\AbstractResource;
use PHPUnit\Framework\TestCase;
use ReflectionClass;

/**
* @coversDefaultClass \Antistatique\Pricehubble\Resource\AbstractResource
Expand Down Expand Up @@ -44,7 +43,7 @@ public function testConstructor(): void
->with($pricehubble);

// Now call the constructor
$reflectedClass = new ReflectionClass(AbstractResource::class);
$reflectedClass = new \ReflectionClass(AbstractResource::class);
$constructor = $reflectedClass->getConstructor();
$constructor->invoke($mock, $pricehubble);
}
Expand Down
22 changes: 10 additions & 12 deletions tests/Unit/PricehubbleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
use Antistatique\Pricehubble\Pricehubble;
use Antistatique\Pricehubble\Resource\AbstractResource;
use Antistatique\Pricehubble\Tests\Traits\TestPrivateTrait;
use BadMethodCallException;
use Exception;
use phpmock\phpunit\PHPMock;
use PHPUnit\Framework\TestCase;

Expand Down Expand Up @@ -103,7 +101,7 @@ public function testMagicCallReturnsExpected(): void
*/
public function testMagicCallReturnsException(): void
{
$this->expectException(BadMethodCallException::class);
$this->expectException(\BadMethodCallException::class);
$this->expectExceptionMessage('Undefined method foo');
$this->pricehubble->foo();
}
Expand Down Expand Up @@ -209,7 +207,7 @@ public function testSetResponseStateError()
$curl_error_mock->expects($this->once())
->willReturn('Something went wrong.');

$this->expectException(Exception::class);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Something went wrong.');
$this->callPrivateMethod($this->pricehubble, 'setResponseState', [
[], false, null,
Expand Down Expand Up @@ -366,7 +364,7 @@ public function testDetermineSuccessErrorMessage()
->method('findHttpStatus')
->willReturn(400);

$this->expectException(Exception::class);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('400 Unsupported country code.');
$this->callPrivateMethod($pricehubble_mock, 'determineSuccess', [
[], ['message' => 'Unsupported country code.'], 0,
Expand All @@ -388,7 +386,7 @@ public function testDetermineSuccessErrorMessageDescription()
->method('findHttpStatus')
->willReturn(401);

$this->expectException(Exception::class);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('401 invalid_token: The access token is invalid or has expired');
$this->callPrivateMethod($pricehubble_mock, 'determineSuccess', [
[], ['error_description' => 'The access token is invalid or has expired', 'error' => 'invalid_token'], 0,
Expand All @@ -410,7 +408,7 @@ public function testDetermineSuccessTimeout()
->method('findHttpStatus')
->willReturn(100);

$this->expectException(Exception::class);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Request timed out after 20.000000 seconds.');
$this->callPrivateMethod($pricehubble_mock, 'determineSuccess', [
['headers' => ['total_time' => 20]], null, 5,
Expand All @@ -430,7 +428,7 @@ public function testDetermineSuccessUnknown()
->method('findHttpStatus')
->willReturn(100);

$this->expectException(Exception::class);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Unknown error, call getLastResponse() to find out what happened.');
$this->callPrivateMethod($pricehubble_mock, 'determineSuccess', [
['headers' => ['total_time' => 20]], null, 35,
Expand All @@ -448,7 +446,7 @@ public function testDetermineSuccess401MissingToken()

$pricehubble_mock = new Pricehubble();

$this->expectException(Exception::class);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('401 invalid_request: The access token is missing');
$this->callPrivateMethod($pricehubble_mock, 'determineSuccess', [
$response, [
Expand All @@ -467,7 +465,7 @@ public function testDetermineSuccess403MissingProperty()

$pricehubble_mock = new Pricehubble();

$this->expectException(Exception::class);
$this->expectException(\Exception::class);
$this->expectExceptionMessage("403 'dossierId', 'simulationId' or 'buildingId' is a required property");
$this->callPrivateMethod($pricehubble_mock, 'determineSuccess', [
$response, [
Expand All @@ -485,7 +483,7 @@ public function testDetermineSuccess403Forbidden()

$pricehubble_mock = new Pricehubble();

$this->expectException(Exception::class);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('403 Forbidden');
$this->callPrivateMethod($pricehubble_mock, 'determineSuccess', [
$response, ['message' => 'Forbidden'], 0,
Expand All @@ -503,7 +501,7 @@ public function testDetermineSuccess403ForbiddenNested()

$pricehubble_mock = new Pricehubble();

$this->expectException(Exception::class);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('403 Forbidden');
$this->callPrivateMethod($pricehubble_mock, 'determineSuccess', [
$response, ['message' => ['message' => 'Forbidden']], 0,
Expand Down

0 comments on commit 205630f

Please sign in to comment.