Skip to content

Commit 3844784

Browse files
committed
update unit and integration tests
1 parent ae29e07 commit 3844784

File tree

9 files changed

+33
-33
lines changed

9 files changed

+33
-33
lines changed

src/Test/Integration/Api/ProjectV1ApiIntegrationTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828
class ProjectV1ApiIntegrationTest extends TestCase
2929
{
30-
const PROJECT_DESCRIPTION = 'Integration Test';
30+
const PROJECT_DESCRIPTION = 'Integration Test';
3131
const DESCRIPTION_TRANSLATED = '!em etalsnart esaelP';
32-
const DESCRIPTION = 'Please translate me!';
32+
const DESCRIPTION = 'Please translate me!';
3333

3434
/** @var ProjectV1Api */
3535
private $projectV1Api;
@@ -38,18 +38,18 @@ class ProjectV1ApiIntegrationTest extends TestCase
3838
private $projectItemV1Api;
3939

4040
private $metaData = [
41-
'item_id' => 27,
41+
'item_id' => 27,
4242
'more_meta' => 'eurotext are the best',
4343
];
4444

45-
protected function setUp()
45+
protected function setUp(): void
4646
{
4747
parent::setUp();
4848

4949
$config = new Configuration();
5050
$config->setApiKey(\constant('EUROTEXT_API_KEY'));
5151

52-
$this->projectV1Api = new ProjectV1Api($config);
52+
$this->projectV1Api = new ProjectV1Api($config);
5353
$this->projectItemV1Api = new ItemV1Api($config);
5454
}
5555

@@ -138,8 +138,8 @@ public function testItShouldTriggerTranslateInSandbox(array $data)
138138
public function testItShouldGetProjectData(array $data)
139139
{
140140
$projectId = $data['project_id'];
141-
142-
$request = new ProjectGetRequest($projectId);
141+
142+
$request = new ProjectGetRequest($projectId);
143143

144144
$projectGetResponse = $this->projectV1Api->get($request);
145145

@@ -160,9 +160,9 @@ public function testItShouldGetProjectData(array $data)
160160
public function testItShouldGetItemData(array $data)
161161
{
162162
$projectId = $data['project_id'];
163-
$itemId = $data['item_id'];
164-
$request = new ItemGetRequest($projectId, $itemId);
165-
$response = $this->projectItemV1Api->get($request);
163+
$itemId = $data['item_id'];
164+
$request = new ItemGetRequest($projectId, $itemId);
165+
$response = $this->projectItemV1Api->get($request);
166166

167167
$itemData = $response->getItemData();
168168

src/Test/Unit/Api/Info/LanguagesV1ApiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class LanguagesV1ApiTest extends TestCase
1515
/** @var Client|\PHPUnit_Framework_MockObject_MockObject */
1616
private $client;
1717

18-
protected function setUp()
18+
protected function setUp(): void
1919
{
2020
$this->client = $this->createMock(\GuzzleHttp\ClientInterface::class);
2121

src/Test/Unit/Api/Project/ItemV1ApiGetUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ItemV1ApiGetUnitTest extends TestCase
4141

4242
const BASE_URL = 'https://sandbox.api.eurotext.de/api/v1/project/%d/item/%d.json';
4343

44-
protected function setUp()
44+
protected function setUp(): void
4545
{
4646
parent::setUp();
4747

src/Test/Unit/Api/Project/ItemV1ApiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ItemV1ApiTest extends TestCase
3838
/** @var \PHPUnit_Framework_MockObject_MockObject|Configuration */
3939
private $config;
4040

41-
protected function setUp()
41+
protected function setUp(): void
4242
{
4343
parent::setUp();
4444

src/Test/Unit/Api/ProjectV1ApiTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ProjectV1ApiTest extends TestCase
3131
/** @var \GuzzleHttp\ClientInterface|\PHPUnit_Framework_MockObject_MockObject */
3232
private $client;
3333

34-
protected function setUp()
34+
protected function setUp(): void
3535
{
3636
parent::setUp();
3737

@@ -50,9 +50,9 @@ public function testItShouldSendProjectPost()
5050

5151
$request = new ProjectPostRequest('', $projectData, ProjectTypeEnum::QUOTE());
5252

53-
$responseStatus = 200;
53+
$responseStatus = 200;
5454
$responseHeaders = [];
55-
$responseBody = file_get_contents(__DIR__ . '/_files/project-post-response.json');
55+
$responseBody = file_get_contents(__DIR__ . '/_files/project-post-response.json');
5656

5757
$httpResponse = new \GuzzleHttp\Psr7\Response($responseStatus, $responseHeaders, $responseBody);
5858

@@ -70,9 +70,9 @@ public function testItShouldCaptureExceptionsDuringResponseDeserialization()
7070
{
7171
$request = new ProjectPostRequest('', new ProjectData(''));
7272

73-
$responseStatus = 200;
73+
$responseStatus = 200;
7474
$responseHeaders = [];
75-
$responseBody = file_get_contents(__DIR__ . '/_files/project-post-response.json');
75+
$responseBody = file_get_contents(__DIR__ . '/_files/project-post-response.json');
7676

7777
$httpResponse = new \GuzzleHttp\Psr7\Response($responseStatus, $responseHeaders, $responseBody);
7878

@@ -105,9 +105,9 @@ public function testItShouldInitializeEmptyResponseObject()
105105
{
106106
$request = new ProjectPostRequest('', new ProjectData(''));
107107

108-
$responseStatus = 200;
108+
$responseStatus = 200;
109109
$responseHeaders = [];
110-
$responseBody = file_get_contents(__DIR__ . '/_files/project-post-response.json');
110+
$responseBody = file_get_contents(__DIR__ . '/_files/project-post-response.json');
111111

112112
$httpResponse = new \GuzzleHttp\Psr7\Response($responseStatus, $responseHeaders, $responseBody);
113113

@@ -132,9 +132,9 @@ public function testItShouldTransitionProject()
132132

133133
$request = new ProjectTransitionRequest($projectId, ProjectStatusEnum::NEW());
134134

135-
$responseStatus = 204;
135+
$responseStatus = 204;
136136
$responseHeaders = [];
137-
$responseBody = '';
137+
$responseBody = '';
138138

139139
$httpResponse = new \GuzzleHttp\Psr7\Response($responseStatus, $responseHeaders, $responseBody);
140140

@@ -150,12 +150,12 @@ public function testItShouldTransitionProject()
150150
public function testItShouldGetProjectDetails()
151151
{
152152
$projectId = 27;
153-
154-
$projectRequest = new ProjectGetRequest($projectId);
155153

156-
$responseStatus = 200;
154+
$projectRequest = new ProjectGetRequest($projectId);
155+
156+
$responseStatus = 200;
157157
$responseHeaders = [];
158-
$responseBody = file_get_contents(__DIR__ . '/_files/project-get-response.json');
158+
$responseBody = file_get_contents(__DIR__ . '/_files/project-get-response.json');
159159

160160
$httpResponse = new \GuzzleHttp\Psr7\Response($responseStatus, $responseHeaders, $responseBody);
161161

@@ -174,9 +174,9 @@ public function testItShouldSendTranslateRequest()
174174
{
175175
$projectId = 27;
176176

177-
$responseStatus = 200;
177+
$responseStatus = 200;
178178
$responseHeaders = [];
179-
$responseBody = sprintf('{"id":%d}', $projectId);
179+
$responseBody = sprintf('{"id":%d}', $projectId);
180180

181181
$httpResponse = new \GuzzleHttp\Psr7\Response($responseStatus, $responseHeaders, $responseBody);
182182

src/Test/Unit/Http/RequestFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class RequestFactoryTest extends TestCase
1111
/** @var RequestFactory */
1212
private $factory;
1313

14-
protected function setUp()
14+
protected function setUp(): void
1515
{
1616
$this->factory = new RequestFactory();
1717
}

src/Test/Unit/ProjectStatusValidatorUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ProjectStatusValidatorUnitTest extends TestCase
2222
/** @var ProjectV1ApiInterface|\PHPUnit_Framework_MockObject_MockObject */
2323
private $projectApi;
2424

25-
protected function setUp()
25+
protected function setUp(): void
2626
{
2727
parent::setUp();
2828

@@ -71,4 +71,4 @@ public function testItShouldReturnFalseIfOneItemHasADiverentStatus()
7171

7272
$this->assertFalse($result);
7373
}
74-
}
74+
}

src/Test/Unit/Request/Converter/ItemAttributeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ItemAttributeTest extends TestCase
1010
/** @var ItemAttribute */
1111
private $converter;
1212

13-
protected function setUp()
13+
protected function setUp(): void
1414
{
1515
$this->converter = new ItemAttribute();
1616
}

src/Test/Unit/Response/Info/LanguagesGetResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class LanguagesGetResponseTest extends TestCase
1313
/** @var LanguagesGetResponse */
1414
private $response;
1515

16-
protected function setUp()
16+
protected function setUp(): void
1717
{
1818
$languages = self::LANGUAGES;
1919
$this->response = new LanguagesGetResponse($languages);

0 commit comments

Comments
 (0)