Skip to content

Commit

Permalink
PHPCS fix
Browse files Browse the repository at this point in the history
  • Loading branch information
faizan1191 committed Oct 3, 2023
1 parent 5e0e8b2 commit 2855a4f
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 82 deletions.
4 changes: 2 additions & 2 deletions src/CrowdinApiClient/Api/StringsExporterSettingApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ public function create(int $projectId, array $data): ?StringsExporterSetting
*
* @param int $projectId
* @param StringsExporterSetting $stringsExporterSetting
*
*
* @return StringsExporterSetting|null
*/
public function update(int $projectId, StringsExporterSetting $stringsExporterSetting): ?StringsExporterSetting
{
$path = sprintf('projects/%d/strings-exporter-settings/%d', $projectId, $stringsExporterSetting->getId());

return $this->_update($path, $stringsExporterSetting);
}

Expand Down
158 changes: 79 additions & 79 deletions tests/CrowdinApiClient/Api/StringsExporterSettingApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

class StringsExporterSettingApiTest extends AbstractTestApi
{
public function testList()
{
$this->mockRequest([
'path' => '/projects/2/strings-exporter-settings',
'method' => 'get',
'response' => '{
public function testList()
{
$this->mockRequest([
'path' => '/projects/2/strings-exporter-settings',
'method' => 'get',
'response' => '{
"data": [
{
"data": {
Expand All @@ -31,27 +31,27 @@ public function testList()
"limit": 25
}
}'
]);

$data = $this->crowdin->stringsExporterSetting->list(2);

$this->assertInstanceOf(ModelCollection::class, $data);
$this->assertCount(1, $data);
/**
* @var StringsExporterSetting $stringsExporterSetting
*/
$stringsExporterSetting = $data[0];
$this->assertInstanceOf(StringsExporterSetting::class, $stringsExporterSetting);

$this->assertEquals(2, $stringsExporterSetting->getId());
$this->assertEquals('android', $stringsExporterSetting->getFormat());
}

public function testGet()
{
$this->mockRequestGet(
'/projects/2/strings-exporter-settings/2',
'{
]);

$data = $this->crowdin->stringsExporterSetting->list(2);

$this->assertInstanceOf(ModelCollection::class, $data);
$this->assertCount(1, $data);
/**
* @var StringsExporterSetting $stringsExporterSetting
*/
$stringsExporterSetting = $data[0];
$this->assertInstanceOf(StringsExporterSetting::class, $stringsExporterSetting);

$this->assertEquals(2, $stringsExporterSetting->getId());
$this->assertEquals('android', $stringsExporterSetting->getFormat());
}

public function testGet()
{
$this->mockRequestGet(
'/projects/2/strings-exporter-settings/2',
'{
"data": {
"id": 2,
"format": "android",
Expand All @@ -62,30 +62,30 @@ public function testGet()
"updatedAt": "2019-09-19T15:10:46+00:00"
}
}'
);

$stringsExporterSetting = $this->crowdin->stringsExporterSetting->get(2, 2);

$this->assertInstanceOf(StringsExporterSetting::class, $stringsExporterSetting);

$this->assertEquals(2, $stringsExporterSetting->getId());
$this->assertEquals('android', $stringsExporterSetting->getFormat());
}

public function testCreate()
{
$params = [
'format' => 'android',
"settings" => [
"convertPlaceholders" => false
]
];

$this->mockRequest([
'path' => '/projects/2/strings-exporter-settings',
'method' => 'post',
'body' => $params,
'response' => '{
);

$stringsExporterSetting = $this->crowdin->stringsExporterSetting->get(2, 2);

$this->assertInstanceOf(StringsExporterSetting::class, $stringsExporterSetting);

$this->assertEquals(2, $stringsExporterSetting->getId());
$this->assertEquals('android', $stringsExporterSetting->getFormat());
}

public function testCreate()
{
$params = [
'format' => 'android',
"settings" => [
"convertPlaceholders" => false
]
];

$this->mockRequest([
'path' => '/projects/2/strings-exporter-settings',
'method' => 'post',
'body' => $params,
'response' => '{
"data": {
"id": 2,
"format": "android",
Expand All @@ -96,28 +96,28 @@ public function testCreate()
"updatedAt": "2019-09-19T15:10:46+00:00"
}
}'
]);
]);

$stringsExporterSetting = $this->crowdin->stringsExporterSetting->create(2, $params);
$stringsExporterSetting = $this->crowdin->stringsExporterSetting->create(2, $params);

$this->assertInstanceOf(StringsExporterSetting::class, $stringsExporterSetting);
$this->assertEquals(2, $stringsExporterSetting->getId());
$this->assertEquals('android', $stringsExporterSetting->getFormat());
}
$this->assertInstanceOf(StringsExporterSetting::class, $stringsExporterSetting);
$this->assertEquals(2, $stringsExporterSetting->getId());
$this->assertEquals('android', $stringsExporterSetting->getFormat());
}

public function testDelete()
{
$this->mockRequest([
'path' => '/projects/2/strings-exporter-settings/2',
'method' => 'delete',
]);
public function testDelete()
{
$this->mockRequest([
'path' => '/projects/2/strings-exporter-settings/2',
'method' => 'delete',
]);

$this->crowdin->stringsExporterSetting->delete(2, 2);
}
$this->crowdin->stringsExporterSetting->delete(2, 2);
}

public function testGetAndUpdate()
{
$this->mockRequestGet('/projects/2/strings-exporter-settings/2', '{
public function testGetAndUpdate()
{
$this->mockRequestGet('/projects/2/strings-exporter-settings/2', '{
"data": {
"id": 2,
"format": "android",
Expand All @@ -129,15 +129,15 @@ public function testGetAndUpdate()
}
}');

$stringsExporterSetting = $this->crowdin->stringsExporterSetting->get(2, 2);
$stringsExporterSetting = $this->crowdin->stringsExporterSetting->get(2, 2);

$this->assertInstanceOf(StringsExporterSetting::class, $stringsExporterSetting);
$this->assertEquals(2, $stringsExporterSetting->getId());
$this->assertEquals('android', $stringsExporterSetting->getFormat());
$this->assertInstanceOf(StringsExporterSetting::class, $stringsExporterSetting);
$this->assertEquals(2, $stringsExporterSetting->getId());
$this->assertEquals('android', $stringsExporterSetting->getFormat());

$stringsExporterSetting->setFormat('macosx');
$stringsExporterSetting->setFormat('macosx');

$this->mockRequestPath('/projects/2/strings-exporter-settings/2', '{
$this->mockRequestPath('/projects/2/strings-exporter-settings/2', '{
"data": {
"id": 2,
"format": "macosx",
Expand All @@ -149,9 +149,9 @@ public function testGetAndUpdate()
}
}');

$stringsExporterSetting = $this->crowdin->stringsExporterSetting->update(2, $stringsExporterSetting);
$this->assertInstanceOf(StringsExporterSetting::class, $stringsExporterSetting);
$this->assertEquals(2, $stringsExporterSetting->getId());
$this->assertEquals('macosx', $stringsExporterSetting->getFormat());
}
$stringsExporterSetting = $this->crowdin->stringsExporterSetting->update(2, $stringsExporterSetting);
$this->assertInstanceOf(StringsExporterSetting::class, $stringsExporterSetting);
$this->assertEquals(2, $stringsExporterSetting->getId());
$this->assertEquals('macosx', $stringsExporterSetting->getFormat());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class StringsExporterSettingTest extends TestCase
*/
public $data = [
"id" => 2,
"format"=> "android"
"format" => "android"
];

/**
Expand Down

0 comments on commit 2855a4f

Please sign in to comment.