diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c12a6438..55d078da 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,3 +69,13 @@ Before sending your pull requests, make sure you followed the list below: - Include unit tests when you contribute new features, as they help to a) prove that your code works correctly, and b) guard against future breaking changes to lower the maintenance cost. - Bug fixes also generally require unit tests, because the presence of bugs usually indicates insufficient test coverage. + +#### Running Unit tests + +To run all tests use the following command: + +`vendor/bin/phpunit` + +To run a specific test: + +`vendor/bin/phpunit tests/CrowdinApiClient/Model/ProjectTest.php` diff --git a/composer.json b/composer.json index 73984417..8339076f 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "crowdin/crowdin-api-client", "description": "PHP client library for Crowdin API v2", - "version": "1.5.2", + "version": "1.6.0", "keywords": [ "crowdin", "sdk", diff --git a/src/CrowdinApiClient/Api/Enterprise/UserApi.php b/src/CrowdinApiClient/Api/Enterprise/UserApi.php index 06233718..85be2015 100644 --- a/src/CrowdinApiClient/Api/Enterprise/UserApi.php +++ b/src/CrowdinApiClient/Api/Enterprise/UserApi.php @@ -4,6 +4,7 @@ use CrowdinApiClient\Api\AbstractApi; use CrowdinApiClient\Model\Enterprise\ProjectTeamMemberAddedStatistics; +use CrowdinApiClient\Model\Enterprise\ProjectTeamMemberResource; use CrowdinApiClient\Model\Enterprise\User; use CrowdinApiClient\ModelCollection; @@ -14,7 +15,7 @@ class UserApi extends AbstractApi { /** - * Add Project Team Member + * Add Project Member * @link https://support.crowdin.com/enterprise/api/#operation/api.projects.members.post API Documentation * * @param int $projectId @@ -26,6 +27,59 @@ public function addProjectTeamMember(int $projectId, array $data): ProjectTeamMe return $this->_post(sprintf('projects/%d/members', $projectId), ProjectTeamMemberAddedStatistics::class, $data); } + /** + * List Project Members + * @link https://support.crowdin.com/enterprise/api/#operation/api.projects.members.getMany API Documentation + * + * @param int $projectId + * @param array $data + * @return ModelCollection + */ + public function listProjectMembers(int $projectId, array $data): ModelCollection + { + return $this->_list(sprintf('projects/%d/members', $projectId), ProjectTeamMemberResource::class, $data); + } + + /** + * Get Project Member Permissions + * @link https://support.crowdin.com/enterprise/api/#operation/api.projects.members.post API Documentation + * + * @param int $projectId + * @param int $memberId + * @return ProjectTeamMemberResource + */ + public function getProjectMemberPermissions(int $projectId, int $memberId): ProjectTeamMemberResource + { + return $this->_get(sprintf('projects/%d/members/%d', $projectId, $memberId), ProjectTeamMemberResource::class); + } + + /** + * Replace Project Member Permissions + * @link https://support.crowdin.com/enterprise/api/#operation/api.projects.members.put API Documentation + * + * @param int $projectId + * @param int $memberId + * @param array $data + * @return ProjectTeamMemberResource + */ + public function replaceProjectMemberPermissions(int $projectId, int $memberId, array $data): ProjectTeamMemberResource + { + return $this->_put(sprintf('projects/%d/members/%d', $projectId, $memberId), ProjectTeamMemberResource::class, $data); + } + + /** + * Delete Member From Project + * @link https://support.crowdin.com/enterprise/api/#operation/api.projects.members.delete API Documentation + * + * @param int $projectId + * @param int $memberId + */ + public function deleteMemberFromProject(int $projectId, int $memberId): void + { + $path = sprintf('projects/%d/members/%s', $projectId, $memberId); + $this->_delete($path); + } + /** * List Users * @link https://support.crowdin.com/enterprise/api/#operation/api.users.getMany API Documentation diff --git a/src/CrowdinApiClient/Model/Enterprise/ProjectTeamMemberResource.php b/src/CrowdinApiClient/Model/Enterprise/ProjectTeamMemberResource.php new file mode 100644 index 00000000..71ae8e27 --- /dev/null +++ b/src/CrowdinApiClient/Model/Enterprise/ProjectTeamMemberResource.php @@ -0,0 +1,171 @@ +id = (int)$this->getDataProperty('id'); + $this->username = (string)$this->getDataProperty('username'); + $this->firstName = (string)$this->getDataProperty('firstName'); + $this->lastName = (string)$this->getDataProperty('lastName'); + $this->isManager = (bool)$this->getDataProperty('isManager'); + $this->managerOfGroup = (array)$this->getDataProperty('managerOfGroup'); + $this->accessToAllWorkflowSteps = (bool)$this->getDataProperty('accessToAllWorkflowSteps'); + $this->permissions = (array)$this->getDataProperty('permissions'); + $this->givenAccessAt = (string)$this->getDataProperty('givenAccessAt'); + } + + /** + * @return int + */ + public function getId(): int + { + return $this->id; + } + + /** + * @return string + */ + public function getUsername(): string + { + return $this->username; + } + + /** + * @return string + */ + public function getFirstName(): string + { + return $this->firstName; + } + + /** + * @return string + */ + public function getLastName(): string + { + return $this->lastName; + } + + /** + * @return bool + */ + public function isManager(): bool + { + return $this->isManager; + } + + /** + * @return array + */ + public function getManagerOfGroup(): array + { + return $this->managerOfGroup; + } + + /** + * @return bool + */ + public function isAccessToAllWorkflowSteps(): bool + { + return $this->accessToAllWorkflowSteps; + } + + /** + * @param bool $accessToAllWorkflowSteps + */ + public function setAccessToAllWorkflowSteps(bool $accessToAllWorkflowSteps): void + { + $this->accessToAllWorkflowSteps = $accessToAllWorkflowSteps; + } + + /** + * @return array + */ + public function getPermissions(): array + { + return $this->permissions; + } + + /** + * @param array $permissions + */ + public function setPermissions(array $permissions): void + { + $this->permissions = $permissions; + } + + /** + * @return string + */ + public function getGivenAccessAt(): string + { + return $this->givenAccessAt; + } + + /** + * @param bool $managerAccess + */ + public function setManagerAccess(bool $managerAccess): void + { + $this->managerAccess = $managerAccess; + } +} diff --git a/src/CrowdinApiClient/Model/Project.php b/src/CrowdinApiClient/Model/Project.php index 4814fe71..82d22010 100644 --- a/src/CrowdinApiClient/Model/Project.php +++ b/src/CrowdinApiClient/Model/Project.php @@ -103,6 +103,11 @@ class Project extends BaseModel */ protected $publicDownloads; + /** + * @var bool + */ + protected $hiddenStringsProofreadersAccess; + /** * @var string */ @@ -173,6 +178,11 @@ class Project extends BaseModel */ protected $inContext; + /** + * @var bool + */ + protected $inContextProcessHiddenStrings; + /** * @var ?string */ @@ -208,6 +218,26 @@ class Project extends BaseModel */ protected $languageMapping = []; + /** + * @var bool + */ + protected $glossaryAccess; + + /** + * @var bool + */ + protected $normalizePlaceholder; + + /** + * @var bool + */ + protected $saveMetaInfoInSource; + + /** + * @var array + */ + protected $notificationSettings = []; + public function __construct(array $data = []) { parent::__construct($data); @@ -243,15 +273,21 @@ public function __construct(array $data = []) $this->exportApprovedOnly = (bool)$this->getDataProperty('exportApprovedOnly'); $this->autoTranslateDialects = (bool)$this->getDataProperty('autoTranslateDialects'); $this->publicDownloads = (bool)$this->getDataProperty('publicDownloads'); + $this->hiddenStringsProofreadersAccess = (bool)$this->getDataProperty('hiddenStringsProofreadersAccess'); $this->useGlobalTm = (bool)$this->getDataProperty('useGlobalTm'); $this->inContext = (bool)$this->getDataProperty('inContext'); + $this->inContextProcessHiddenStrings = (bool)$this->getDataProperty('inContextProcessHiddenStrings'); $this->inContextPseudoLanguageId = (string)$this->getDataProperty('inContextPseudoLanguageId'); $this->inContextPseudoLanguage = (array)$this->getDataProperty('inContextPseudoLanguage'); $this->qaCheckIsActive = (bool)$this->getDataProperty('qaCheckIsActive'); $this->qaCheckCategories = (array)$this->getDataProperty('qaCheckCategories'); $this->customQaCheckIds = (array)$this->getDataProperty('customQaCheckIds'); $this->languageMapping = (array)$this->getDataProperty('languageMapping'); + $this->glossaryAccess = (bool)$this->getDataProperty('glossaryAccess'); $this->isSuspended = (bool)$this->getDataProperty('isSuspended'); + $this->normalizePlaceholder = (bool)$this->getDataProperty('normalizePlaceholder'); + $this->saveMetaInfoInSource = (bool)$this->getDataProperty('saveMetaInfoInSource'); + $this->notificationSettings = (array)$this->getDataProperty('notificationSettings'); } /** @@ -738,6 +774,22 @@ public function setPublicDownloads(bool $publicDownloads): void $this->publicDownloads = $publicDownloads; } + /** + * @return bool + */ + public function isHiddenStringsProofreadersAccess(): bool + { + return $this->hiddenStringsProofreadersAccess; + } + + /** + * @param bool $hiddenStringsProofreadersAccess + */ + public function setHiddenStringsProofreadersAccess(bool $hiddenStringsProofreadersAccess): void + { + $this->hiddenStringsProofreadersAccess = $hiddenStringsProofreadersAccess; + } + /** * @return bool */ @@ -770,6 +822,22 @@ public function setInContext(bool $inContext): void $this->inContext = $inContext; } + /** + * @return bool + */ + public function isInContextProcessHiddenStrings(): bool + { + return $this->inContextProcessHiddenStrings; + } + + /** + * @param bool $inContextProcessHiddenStrings + */ + public function setInContextProcessHiddenStrings(bool $inContextProcessHiddenStrings): void + { + $this->inContextProcessHiddenStrings = $inContextProcessHiddenStrings; + } + /** * @return bool */ @@ -866,6 +934,22 @@ public function setLanguageMapping(array $languageMapping): void $this->languageMapping = $languageMapping; } + /** + * @return bool + */ + public function isGlossaryAccess(): bool + { + return $this->glossaryAccess; + } + + /** + * @param bool $glossaryAccess + */ + public function setGlossaryAccess(bool $glossaryAccess): void + { + $this->glossaryAccess = $glossaryAccess; + } + /** * @return bool */ @@ -881,4 +965,52 @@ public function setIsSuspended(bool $isSuspended): void { $this->isSuspended = $isSuspended; } + + /** + * @return bool + */ + public function isNormalizePlaceholder(): bool + { + return $this->normalizePlaceholder; + } + + /** + * @param bool $normalizePlaceholder + */ + public function setNormalizePlaceholder(bool $normalizePlaceholder): void + { + $this->normalizePlaceholder = $normalizePlaceholder; + } + + /** + * @return bool + */ + public function isSaveMetaInfoInSource(): bool + { + return $this->saveMetaInfoInSource; + } + + /** + * @param bool $saveMetaInfoInSource + */ + public function setSaveMetaInfoInSource(bool $saveMetaInfoInSource): void + { + $this->saveMetaInfoInSource = $saveMetaInfoInSource; + } + + /** + * @return array + */ + public function getNotificationSettings(): array + { + return $this->notificationSettings; + } + + /** + * @param array $notificationSettings + */ + public function setNotificationSettings(array $notificationSettings): void + { + $this->notificationSettings = $notificationSettings; + } } diff --git a/src/CrowdinApiClient/Model/SourceString.php b/src/CrowdinApiClient/Model/SourceString.php index da9eb48e..b7be0c4b 100644 --- a/src/CrowdinApiClient/Model/SourceString.php +++ b/src/CrowdinApiClient/Model/SourceString.php @@ -28,6 +28,11 @@ class SourceString extends BaseModel */ protected $branchId; + /** + * @var ?integer + */ + protected $directoryId; + /** * @var string */ @@ -99,6 +104,7 @@ public function __construct(array $data = []) $this->projectId = (integer)$this->getDataProperty('projectId'); $this->fileId = (integer)$this->getDataProperty('fileId'); $this->branchId = $this->getDataProperty('branchId') ? (integer)$this->getDataProperty('branchId') : null; + $this->directoryId = $this->getDataProperty('directoryId') ? (integer)$this->getDataProperty('directoryId') : null; $this->identifier = (string)$this->getDataProperty('identifier'); $this->text = (string)$this->getDataProperty('text'); $this->type = (string)$this->getDataProperty('type'); @@ -145,6 +151,14 @@ public function getBranchId(): ?int return $this->branchId; } + /** + * @return int|null + */ + public function getDirectoryId(): ?int + { + return $this->directoryId; + } + /** * @return string */ diff --git a/tests/CrowdinApiClient/Api/Enterprise/ProjectApiTest.php b/tests/CrowdinApiClient/Api/Enterprise/ProjectApiTest.php index 3ac98256..ac960dbf 100644 --- a/tests/CrowdinApiClient/Api/Enterprise/ProjectApiTest.php +++ b/tests/CrowdinApiClient/Api/Enterprise/ProjectApiTest.php @@ -23,9 +23,7 @@ public function testList() "targetLanguageIds": [ "uk" ], - "languageAccessPolicy": "moderate", "name": "Knowledge Base", - "cname": "my-custom-domain.crowdin.com", "identifier": "1f198a4e907688bc65834a6d5a6000c3", "description": "Vault of all terms and their explanation", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAGm0lEQVR4nO3cWVCVdRjH8R+HTQQR93BJo1Jz1MrRSS21JDUNRWUxMabVpvXcNuNdl100U2qNuQ+KIiCCCIqYoSPkbiippCKiuBDKvp6FLmzG8Pxf1vO858D7+1z6vA7PMN85Oud//scj0rymBUROZnL1AtQ7MSwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEiEl6sXkLThu2+Vfx6Xmom8C5fEfu7bM6Yh8p25ytmjyip8v3knqmpqxX6+O+ArlpNNmzQBy+e/pZzV1tXjx7g9vT4qgGE51fiQ0fhg6SK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+LHjNkWBk5uW2+KtlsdmxMTNV8x33Y4IGICZsvtV6vYMiwKqrbv/hQXlGF+HTt28wzXpmkeWmVDBpWR50tuIIT5/I156sWL8CgoPbfZDUihtWOhMxszVs4PPLRxrDaYbXasDExFc0aN5x55KPGsDrgQfkjJGRma8555OOIYXVQ3oVLOH3xL+WMRz6OGFYn7Nh/CA/KHylnPPJpjWF1gsVixaakNFgsVuWcRz5PMKxOunO/DMlZ2lfAeOTzGMPqgmNnLuD85ULljEc+jzGsLopLzUR5RZVyxiMfhtVljU3N2JyUpnktzOhHPgyrG4pL7yHtt+OacyMf+TCsbsrOO41Lf99Qzox85MOwnGBbygFUVtcoZ0Y98mFYTlDf0IgtyemaX8NtxCMfhuUk127dRkZOrnJmxCMfhuVEmcfzcLXolnJmtCMfhuVkW/emo7q2Tjkz0pEPw3Ky6to6bN2brvldWkY58mFYAq4W3cLhXPX3lBrlyMcj0ryGX1NHTsdXLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSMS//tClrE3peLcAAAAASUVORK5CYII=", @@ -85,9 +83,7 @@ public function testCreate() "targetLanguageIds": [ "uk" ], - "languageAccessPolicy": "moderate", "name": "Knowledge Base", - "cname": "my-custom-domain.crowdin.com", "identifier": "1f198a4e907688bc65834a6d5a6000c3", "description": "Vault of all terms and their explanation", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAGm0lEQVR4nO3cWVCVdRjH8R+HTQQR93BJo1Jz1MrRSS21JDUNRWUxMabVpvXcNuNdl100U2qNuQ+KIiCCCIqYoSPkbiippCKiuBDKvp6FLmzG8Pxf1vO858D7+1z6vA7PMN85Oud//scj0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Create() "isExternal": false, "externalType": "proofread", "workflowId": 3, + "hiddenStringsProofreadersAccess": true, + "inContextProcessHiddenStrings": false, + "glossaryAccess": true, + "normalizePlaceholder": false, + "saveMetaInfoInSource": true, + "notificationSettings": { + "translatorNewStrings": "false", + "managerNewStrings": "false", + "managerLanguageCompleted": "false" + }, "hasCrowdsourcing": false, "createdAt": "2019-09-20T11:34:40+00:00", "updatedAt": "2019-09-20T11:34:40+00:00" @@ -118,9 +124,7 @@ public function testInfoGetAndUpdate() "targetLanguageIds": [ "uk" ], - "languageAccessPolicy": "moderate", "name": "Knowledge Base", - "cname": "my-custom-domain.crowdin.com", "identifier": "1f198a4e907688bc65834a6d5a6000c3", "description": "Vault of all terms and their explanation", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAGm0lEQVR4nO3cWVCVdRjH8R+HTQQR93BJo1Jz1MrRSS21JDUNRWUxMabVpvXcNuNdl100U2qNuQ+KIiCCCIqYoSPkbiippCKiuBDKvp6FLmzG8Pxf1vO858D7+1z6vA7PMN85Oud//scj0rymBUROZnL1AtQ7MSwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEiEl6sXkLThu2+Vfx6Xmom8C5fEfu7bM6Yh8p25ytmjyip8v3knqmpqxX6+O+ArlpNNmzQBy+e/pZzV1tXjx7g9vT4qgGE51fiQ0fhg6SKYTB4Os8amZqyPT0bZwwoXbKY/huUko4KH4fP3lsPLy9NhZrXa8OuefSguveeCzVyDYTnBkIFB+Ob9KPTx9XGY2e0t2L4vA1duFOu/mAsxrG7q598X5tgVCAzwV84TDx7B2YIrOm/legyrG3x9vGGOjcaQgUHKecaxXO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OIYXVQ3oVLOH3xL+WMRz6OGFYn7Nh/CA/KHylnPPJpjWF1gsVixaakNFgsVuWcRz5PMKxOunO/DMlZ2lfAeOTzGMPqgmNnLuD85ULljEc+jzGsLopLzUR5RZVyxiMfhtVljU3N2JyUpnktzOhHPgyrG4pL7yHtt+OacyMf+TCsbsrOO41Lf99Qzox85MOwnGBbygFUVtcoZ0Y98mFYTlDf0IgtyemaX8NtxCMfhuUk127dRkZOrnJmxCMfhuVEmcfzcLXolnJmtCMfhuVkW/emo7q2Tjkz0pEPw3Ky6to6bN2brvldWkY58mFYAq4W3cLhXPX3lBrlyMcj0ryGX1NHTsdXLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSMS//tClrE3peLcAAAAASUVORK5CYII=", @@ -149,9 +153,7 @@ public function testInfoGetAndUpdate() "targetLanguageIds": [ "uk" ], - "languageAccessPolicy": "moderate", "name": "edit test", - "cname": "my-custom-domain.crowdin.com", "identifier": "1f198a4e907688bc65834a6d5a6000c3", "description": "Vault of all terms and their explanation", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAGm0lEQVR4nO3cWVCVdRjH8R+HTQQR93BJo1Jz1MrRSS21JDUNRWUxMabVpvXcNuNdl100U2qNuQ+KIiCCCIqYoSPkbiippCKiuBDKvp6FLmzG8Pxf1vO858D7+1z6vA7PMN85Oud//scj0rymBUROZnL1AtQ7MSwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0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1Johw3ra5es38cO2XdiUtB919Q3KZ/r3C8CHy97VebOey/BhncwvwPr4JFgsVlRUVSMu7aDms5PGPo9Qjc+7U2uGDutw7ilsT8lo9Y56/tVr+P3UOc2/s2zem5qfeqAnDBmW3d6CPZlHkHI4RzlPzjqKkrv3lTMvL0+sjgrXfO+LHjNkWBk5uW2+KtlsdmxMTNV8x33Y4IGICZsvtV6vYMiwKqrbv/hQXlGF+HTt28wzXpmkeWmVDBpWR50tuIIT5/I156sWL8CgoPbfZDUihtWOhMxszVs4PPLRxrDaYbXasDExFc0aN5x55KPGsDrgQfkjJGRma8555OOIYXVQ3oVLOH3xL+WMRz6OGFYn7Nh/CA/KHylnPPJpjWF1gsVixaakNFgsVuWcRz5PMKxOunO/DMlZ2lfAeOTzGMPqgmNnLuD85ULljEc+jzGsLopLzUR5RZVyxiMfhtVljU3N2JyUpnktzOhHPgyrG4pL7yHtt+OacyMf+TCsbsrOO41Lf99Qzox85MOwnGBbygFUVtcoZ0Y98mFYTlDf0IgtyemaX8NtxCMfhuUk127dRkZOrnJmxCMfhuVEmcfzcLXolnJmtCMfhuVkW/emo7q2Tjkz0pEPw3Ky6to6bN2brvldWkY58mFYAq4W3cLhXPX3lBrlyMcj0ryGX1NHTsdXLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSMS//tClrE3peLcAAAAASUVORK5CYII=", @@ -160,6 +162,16 @@ public function testInfoGetAndUpdate() "externalType": "proofread", "workflowId": 3, "hasCrowdsourcing": false, + "hiddenStringsProofreadersAccess": true, + "inContextProcessHiddenStrings": false, + "glossaryAccess": true, + "normalizePlaceholder": false, + "saveMetaInfoInSource": true, + "notificationSettings": { + "translatorNewStrings": "false", + "managerNewStrings": "false", + "managerLanguageCompleted": "false" + }, "createdAt": "2019-09-20T11:34:40+00:00", "updatedAt": "2019-09-20T11:34:40+00:00" } @@ -183,9 +195,7 @@ public function testGetAndUpdate() "targetLanguageIds": [ "uk" ], - "languageAccessPolicy": "moderate", "name": "Knowledge Base", - "cname": "my-custom-domain.crowdin.com", "identifier": "1f198a4e907688bc65834a6d5a6000c3", "description": "Vault of all terms and their explanation", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAGm0lEQVR4nO3cWVCVdRjH8R+HTQQR93BJo1Jz1MrRSS21JDUNRWUxMabVpvXcNuNdl100U2qNuQ+KIiCCCIqYoSPkbiippCKiuBDKvp6FLmzG8Pxf1vO858D7+1z6vA7PMN85Oud//scj0rymBUROZnL1AtQ7MSwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEiEl6sXkLThu2+Vfx6Xmom8C5fEfu7bM6Yh8p25ytmjyip8v3knqmpqxX6+O+ArlpNNmzQBy+e/pZzV1tXjx7g9vT4qgGE51fiQ0fhg6SKYTB4Os8amZqyPT0bZwwoXbKY/huUko4KH4fP3lsPLy9NhZrXa8OuefSguveeCzVyDYTnBkIFB+Ob9KPTx9XGY2e0t2L4vA1duFOu/mAsxrG7q598X5tgVCAzwV84TDx7B2YIrOm/legyrG3x9vGGOjcaQgUHKecaxXOScPq/zVu6BYXWRyeSBL1ZGYFTwMOX8+Nk/kX70hM5buQ+G1UUfRyzG+JDRytn5y4XYfSBL543cC8PqguiFoZg68SXlrPBmCbYk70dLi85LuRmG1UkL3piOudOnKmcld+/jl13JsNnsOm/lfhhWJ0x/eSKWzZujnJ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yHtt+OacyMf+TCsbsrOO41Lf99Qzox85MOwnGBbygFUVtcoZ0Y98mFYTlDf0IgtyemaX8NtxCMfhuUk127dRkZOrnJmxCMfhuVEmcfzcLXolnJmtCMfhuVkW/emo7q2Tjkz0pEPw3Ky6to6bN2brvldWkY58mFYAq4W3cLhXPX3lBrlyMcj0ryGX1NHTsdXLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSMS//tClrE3peLcAAAAASUVORK5CYII=", @@ -235,6 +245,16 @@ public function testGetAndUpdate() "osx_code": "ua.lproj", "osx_locale": "ua" } + }, + "hiddenStringsProofreadersAccess": true, + "inContextProcessHiddenStrings": false, + "glossaryAccess": true, + "normalizePlaceholder": false, + "saveMetaInfoInSource": true, + "notificationSettings": { + "translatorNewStrings": "false", + "managerNewStrings": "false", + "managerLanguageCompleted": "false" } } }'); @@ -254,9 +274,7 @@ public function testGetAndUpdate() "targetLanguageIds": [ "uk" ], - "languageAccessPolicy": "moderate", "name": "edit test", - "cname": "my-custom-domain.crowdin.com", "identifier": "1f198a4e907688bc65834a6d5a6000c3", "description": "Vault of all terms and their explanation", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAGm0lEQVR4nO3cWVCVdRjH8R+HTQQR93BJo1Jz1MrRSS21JDUNRWUxMabVpvXcNuNdl100U2qNuQ+KIiCCCIqYoSPkbiippCKiuBDKvp6FLmzG8Pxf1vO858D7+1z6vA7PMN85Oud//scj0rymBUROZnL1AtQ7MSwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBs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82a+pvkxZFIzZFiq/1MVl95D0e1S5fMmkwc+Wh7W5j+b1Johw3ra5es38cO2XdiUtB919Q3KZ/r3C8CHy97VebOey/BhncwvwPr4JFgsVlRUVSMu7aDms5PGPo9Qjc+7U2uGDutw7ilsT8lo9Y56/tVr+P3UOc2/s2zem5qfeqAnDBmW3d6CPZlHkHI4RzlPzjqKkrv3lTMvL0+sjgrXfO+LHjNkWBk5uW2+KtlsdmxMTNV8x33Y4IGICZsvtV6vYMiwKqrbv/hQXlGF+HTt28wzXpmkeWmVDBpWR50tuIIT5/I156sWL8CgoPbfZDUihtWOhMxszVs4PPLRxrDaYbXasDExFc0aN5x55KPGsDrgQfkjJGRma8555OOIYXVQ3oVLOH3xL+WMRz6OGFYn7Nh/CA/KHylnPPJpjWF1gsVixaakNFgsVuWcRz5PMKxOunO/DMlZ2lfAeOTzGMPqgmNnLuD85ULljEc+jzGsLopLzUR5RZVyxiMfhtVljU3N2JyUpnktzOhHPgyrG4pL7yHtt+OacyMf+TCsbsrOO41Lf99Qzox85MOwnGBbygFUVtcoZ0Y98mFYTlDf0IgtyemaX8NtxCMfhuUk127dRkZOrnJmxCMfhuVEmcfzcLXolnJmtCMfhuVkW/emo7q2Tjkz0pEPw3Ky6to6bN2brvldWkY58mFYAq4W3cLhXPX3lBrlyMcj0ryGX1NHTsdXLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSMS//tClrE3peLcAAAAASUVORK5CYII=", @@ -306,6 +324,16 @@ public function testGetAndUpdate() "osx_code": "ua.lproj", "osx_locale": "ua" } + }, + "hiddenStringsProofreadersAccess": true, + "inContextProcessHiddenStrings": false, + "glossaryAccess": true, + "normalizePlaceholder": false, + "saveMetaInfoInSource": true, + "notificationSettings": { + "translatorNewStrings": "false", + "managerNewStrings": "false", + "managerLanguageCompleted": "false" } } }'); diff --git a/tests/CrowdinApiClient/Api/Enterprise/UserApiTest.php b/tests/CrowdinApiClient/Api/Enterprise/UserApiTest.php index f016a3b4..f6e569b2 100644 --- a/tests/CrowdinApiClient/Api/Enterprise/UserApiTest.php +++ b/tests/CrowdinApiClient/Api/Enterprise/UserApiTest.php @@ -3,6 +3,7 @@ namespace CrowdinApiClient\Tests\Api\Enterprise; use CrowdinApiClient\Model\Enterprise\ProjectTeamMemberAddedStatistics; +use CrowdinApiClient\Model\Enterprise\ProjectTeamMemberResource; use CrowdinApiClient\Model\Enterprise\User; use CrowdinApiClient\ModelCollection; @@ -61,6 +62,110 @@ public function testAddProjectTeamMember() $this->assertEquals([], $projectTeamMemberAddedStatistics->getSkipped()); } + public function testListProjectMembers() + { + $this->mockRequestGet('/projects/1/members', '{ + "data": [ + { + "data": { + "id": 1, + "username": "john_smith", + "firstName": "John", + "lastName": "Smith", + "isManager": true, + "managerOfGroup": {"id": 1, "name": "Marketing materials"}, + "accessToAllWorkflowSteps": true, + "permissions": {"it": {"workflowStepIds": [313]}}, + "givenAccessAt": "2019-10-23T11:44:02+00:00" + } + } + ], + "pagination": [ + { + "offset": 0, + "limit": 0 + } + ] + }' + ); + + $members = $this->crowdin->user->listProjectMembers(1, []); + + $this->assertInstanceOf(ModelCollection::class, $members); + $this->assertCount(1, $members); + $this->assertInstanceOf(ProjectTeamMemberResource::class, $members[0]); + $this->assertEquals(1, $members[0]->getId()); + } + + public function testGetProjectMemberPermissions() + { + $this->mockRequestGet('/projects/1/members/1', '{ + "data": { + "id": 1, + "username": "john_smith", + "firstName": "John", + "lastName": "Smith", + "isManager": true, + "managerOfGroup": {"id": 1, "name": "Marketing materials"}, + "accessToAllWorkflowSteps": true, + "permissions": {"it": {"workflowStepIds": [313]}}, + "givenAccessAt": "2019-10-23T11:44:02+00:00" + } + }'); + + $member = $this->crowdin->user->getProjectMemberPermissions(1, 1); + + $this->assertInstanceOf(ProjectTeamMemberResource::class, $member); + $this->assertEquals(1, $member->getId()); + } + + public function testReplaceProjectMemberPermissions() + { + $params = [ + 'managerAccess' => true, + 'permissions' => [ + 'it' => [ + 'workflowStepIds' => [1, 2, 3], + ], + ], + ]; + + $this->mockRequest([ + 'path' => '/projects/1/members/1', + 'method' => 'put', + 'body' => $params, + 'response' => '{ + "data": { + "id": 1, + "username": "john_smith", + "firstName": "John", + "lastName": "Smith", + "isManager": true, + "managerOfGroup": {"id": 1, "name": "Marketing materials"}, + "accessToAllWorkflowSteps": true, + "permissions": {"it": {"workflowStepIds": [1,2,3]}}, + "givenAccessAt": "2019-10-23T11:44:02+00:00" + } + }' + ]); + + $member = $this->crowdin->user->replaceProjectMemberPermissions(1, 1, $params); + + $this->assertInstanceOf(ProjectTeamMemberResource::class, $member); + $this->assertEquals(['it' => ['workflowStepIds' => [1, 2, 3]]], $member->getPermissions()); + $this->assertEquals(true, $member->isManager()); + } + + public function testDelete() + { + $this->mockRequest([ + 'path' => '/projects/2/members/1', + 'method' => 'delete', + ]); + + $this->crowdin->user->deleteMemberFromProject(2, 1); + } + public function testList() { $this->mockRequest([ diff --git a/tests/CrowdinApiClient/Api/ProjectApiTest.php b/tests/CrowdinApiClient/Api/ProjectApiTest.php index 4ba979b9..8d5420b1 100644 --- a/tests/CrowdinApiClient/Api/ProjectApiTest.php +++ b/tests/CrowdinApiClient/Api/ProjectApiTest.php @@ -17,7 +17,6 @@ public function testList() { "data": { "id": 8, - "groupId": 4, "userId": 6, "sourceLanguageId": "uk", "targetLanguageIds": [ @@ -30,10 +29,6 @@ public function testList() "description": "Vault of all terms and their explanation", "visibility": "private", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAGm0lEQVR4nO3cWVCVdRjH8R+HTQQR93BJo1Jz1MrRSS21JDUNRWUxMabVpvXcNuNdl100U2qNuQ+KIiCCCIq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AsEsGwSMS//tClrE3peLcAAAAASUVORK5CYII=", - "isExternal": false, - "externalType": "proofread", - "workflowId": 3, - "hasCrowdsourcing": false, "createdAt": "2019-09-20T11:34:40+00:00", "updatedAt": "2019-09-20T11:34:40+00:00" } @@ -80,7 +75,6 @@ public function testCreate() 'response' => '{ "data": { "id": 8, - "groupId": 4, "userId": 6, "sourceLanguageId": "uk", "targetLanguageIds": [ @@ -111,10 +105,16 @@ public function testCreate() "description": "Vault of all terms and their explanation", "visibility": "private", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAGm0lEQVR4nO3cWVCVdRjH8R+HTQQR93BJo1Jz1MrRSS21JDUNRWUxMabVpvXcNuNdl100U2qNuQ+KIiCCCIqYoSPkbiippCKiuBDKvp6FLmzG8Pxf1vO858D7+1z6vA7PMN85Oud//scj0rymBUROZnL1AtQ7MSwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEiEl6sXkLThu2+Vfx6Xmom8C5fEfu7bM6Yh8p25ytmjyip8v3knqmpqxX6+O+ArlpNNmzQBy+e/pZzV1tXjx7g9vT4qgGE51fiQ0fhg6SKYTB4Os8amZqyPT0bZwwoXbKY/huUko4KH4fP3lsPLy9NhZrXa8OuefSguveeCzVyDYTnBkIFB+Ob9KPTx9XGY2e0t2L4vA1duFOu/mAsxrG7q598X5tgVCAzwV84TDx7B2YIrOm/legyrG3x9vGGOjcaQgUHKecaxXOScPq/zVu6BYXWRyeSBL1ZGYFTwMOX8+Nk/kX70hM5buQ+G1UUfRyzG+JDRytn5y4XYfSBL543cC8PqguiFoZg68SXlrPBmCbYk70dLi85LuRmG1UkL3piOudOnKm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ZVyxiMfhtVljU3N2JyUpnktzOhHPgyrG4pL7yHtt+OacyMf+TCsbsrOO41Lf99Qzox85MOwnGBbygFUVtcoZ0Y98mFYTlDf0IgtyemaX8NtxCMfhuUk127dRkZOrnJmxCMfhuVEmcfzcLXolnJmtCMfhuVkW/emo7q2Tjkz0pEPw3Ky6to6bN2brvldWkY58mFYAq4W3cLhXPX3lBrlyMcj0ryGX1NHTsdXLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSMS//tClrE3peLcAAAAASUVORK5CYII=", - "isExternal": false, - "externalType": "proofread", - "workflowId": 3, - "hasCrowdsourcing": false, + "hiddenStringsProofreadersAccess": true, + "inContextProcessHiddenStrings": false, + "glossaryAccess": true, + "normalizePlaceholder": false, + "saveMetaInfoInSource": true, + "notificationSettings": { + "translatorNewStrings": "false", + "managerNewStrings": "false", + "managerLanguageCompleted": "false" + }, "createdAt": "2019-09-20T11:34:40+00:00", "updatedAt": "2019-09-20T11:34:40+00:00" } @@ -163,7 +163,16 @@ public function testInfoGetAndUpdate() "description": "Vault of all terms and their explanation", "visibility": "private", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAGm0lEQVR4nO3cWVCVdRjH8R+HTQQR93BJo1Jz1MrRSS21JDUNRWUxMabVpvXcNuNdl100U2qNuQ+KIiCCCIqYoSPkbiippCKiuBDKvp6FLmzG8Pxf1vO858D7+1z6vA7PMN85Oud//scj0rymBUROZnL1AtQ7MSwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEM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ZFiq/1MVl95D0e1S5fMmkwc+Wh7W5j+b1Johw3ra5es38cO2XdiUtB919Q3KZ/r3C8CHy97VebOey/BhncwvwPr4JFgsVlRUVSMu7aDms5PGPo9Qjc+7U2uGDutw7ilsT8lo9Y56/tVr+P3UOc2/s2zem5qfeqAnDBmW3d6CPZlHkHI4RzlPzjqKkrv3lTMvL0+sjgrXfO+LHjNkWBk5uW2+KtlsdmxMTNV8x33Y4IGICZsvtV6vYMiwKqrbv/hQXlGF+HTt28wzXpmkeWmVDBpWR50tuIIT5/I156sWL8CgoPbfZDUihtWOhMxszVs4PPLRxrDaYbXasDExFc0aN5x55KPGsDrgQfkjJGRma8555OOIYXVQ3oVLOH3xL+WMRz6OGFYn7Nh/CA/KHylnPPJpjWF1gsVixaakNFgsVuWcRz5PMKxOunO/DMlZ2lfAeOTzGMPqgmNnLuD85ULljEc+jzGsLopLzUR5RZVyxiMfhtVljU3N2JyUpnktzOhHPgyrG4pL7yHtt+OacyMf+TCsbsrOO41Lf99Qzox85MOwnGBbygFUVtcoZ0Y98mFYTlDf0IgtyemaX8NtxCMfhuUk127dRkZOrnJmxCMfhuVEmcfzcLXolnJmtCMfhuVkW/emo7q2Tjkz0pEPw3Ky6to6bN2brvldWkY58mFYAq4W3cLhXPX3lBrlyMcj0ryGX1NHTsdXLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSMS//tClrE3peLcAAAAASUVORK5CYII=", - "workflowId": 3, + "hiddenStringsProofreadersAccess": true, + "inContextProcessHiddenStrings": false, + "glossaryAccess": true, + "normalizePlaceholder": false, + "saveMetaInfoInSource": true, + "notificationSettings": { + "translatorNewStrings": "false", + "managerNewStrings": "false", + "managerLanguageCompleted": "false" + }, "createdAt": "2019-09-20T11:34:40+00:00", "updatedAt": "2019-09-20T11:34:40+00:00" } @@ -203,12 +212,20 @@ public function testInfoGetAndUpdate() ], "languageAccessPolicy": "moderate", "name": "edit test", - "cname": "my-custom-domain.crowdin.com", "identifier": "1f198a4e907688bc65834a6d5a6000c3", "description": "Vault of all terms and their explanation", "visibility": "private", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAGm0lEQVR4nO3cWVCVdRjH8R+HTQQR93BJo1Jz1MrRSS21JDUNRWUxMabVpvXcNuNdl100U2qNuQ+KIiCCCIqYoSPkbiippCKiuBDKvp6FLmzG8Pxf1vO858D7+1z6vA7PMN85Oud//scj0rymBUROZnL1AtQ7MSwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEiEl6sXkLThu2+Vfx6Xmom8C5fEfu7bM6Yh8p25ytmjyip8v3knqmpqxX6+O+ArlpNNmzQBy+e/pZzV1tXjx7g9vT4qgGE51fiQ0fhg6SKYTB4Os8amZqyPT0bZwwoXbKY/huUko4KH4fP3lsPLy9NhZrXa8OuefSguveeCzVyDYTnBkIFB+Ob9KPTx9XGY2e0t2L4vA1duFOu/mAsxrG7q598X5tgVCAzwV84TDx7B2YIrOm/legyrG3x9vGGOjcaQgUHKecaxXOScPq/zVu6BYXWRyeSBL1ZGYFTwMOX8+Nk/kX70hM5buQ+G1UUfRyzG+JDRytn5y4XYfSBL543cC8PqguiFoZg68SXlrPBmCbYk70dLi85LuRmG1UkL3piOudOnKmcld+/jl13JsNnsOm/lfhhWJ0x/eSKWzZujnJU9rMC6nUloarbovJV7YlgdNPHFEMSGL1TOq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nGBbygFUVtcoZ0Y98mFYTlDf0IgtyemaX8NtxCMfhuUk127dRkZOrnJmxCMfhuVEmcfzcLXolnJmtCMfhuVkW/emo7q2Tjkz0pEPw3Ky6to6bN2brvldWkY58mFYAq4W3cLhXPX3lBrlyMcj0ryGX1NHTsdXLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSATDIhEMi0QwLBLBsEgEwyIRDItEMCwSwbBIBMMiEQyLRDAsEsGwSMS//tClrE3peLcAAAAASUVORK5CYII=", - "workflowId": 3, + "hiddenStringsProofreadersAccess": true, + "inContextProcessHiddenStrings": false, + "glossaryAccess": true, + "normalizePlaceholder": false, + "saveMetaInfoInSource": true, + "notificationSettings": { + "translatorNewStrings": "false", + "managerNewStrings": "false", + "managerLanguageCompleted": "false" + }, "createdAt": "2019-09-20T11:34:40+00:00", "updatedAt": "2019-09-20T11:34:40+00:00" } diff --git a/tests/CrowdinApiClient/Model/Enterprise/ProjectTeamMemberResourceTest.php b/tests/CrowdinApiClient/Model/Enterprise/ProjectTeamMemberResourceTest.php new file mode 100644 index 00000000..a5c59f36 --- /dev/null +++ b/tests/CrowdinApiClient/Model/Enterprise/ProjectTeamMemberResourceTest.php @@ -0,0 +1,66 @@ + 1, + 'username' => 'jon_doe', + 'firstName' => 'Jon', + 'lastName' => 'Doe', + 'isManager' => true, + 'managerOfGroup' => [ + 'id' => 1, + 'name' => 'KB materials', + ], + 'accessToAllWorkflowSteps' => true, + 'permissions' => [ + 'it' => [ + 'workflowStepIds' => [ + 313, + ], + ] + ], + 'givenAccessAt' => '2019-10-23T11:44:02+00:00', + ]; + + public function testLoadData() + { + $this->projectTeamMemberResource = new ProjectTeamMemberResource($this->data); + $this->checkData(); + } + + public function testSetData() + { + $this->projectTeamMemberResource = new ProjectTeamMemberResource(); + $this->projectTeamMemberResource->setAccessToAllWorkflowSteps($this->data['accessToAllWorkflowSteps']); + $this->projectTeamMemberResource->setPermissions($this->data['permissions']); + + $this->assertEquals($this->data['accessToAllWorkflowSteps'], $this->projectTeamMemberResource->isAccessToAllWorkflowSteps()); + $this->assertEquals($this->data['permissions'], $this->projectTeamMemberResource->getPermissions()); + } + + public function checkData() + { + $this->assertEquals($this->data['id'], $this->projectTeamMemberResource->getId()); + $this->assertEquals($this->data['username'], $this->projectTeamMemberResource->getUsername()); + $this->assertEquals($this->data['firstName'], $this->projectTeamMemberResource->getFirstName()); + $this->assertEquals($this->data['lastName'], $this->projectTeamMemberResource->getLastName()); + $this->assertEquals($this->data['isManager'], $this->projectTeamMemberResource->isManager()); + $this->assertEquals($this->data['managerOfGroup'], $this->projectTeamMemberResource->getManagerOfGroup()); + $this->assertEquals($this->data['accessToAllWorkflowSteps'], $this->projectTeamMemberResource->isAccessToAllWorkflowSteps()); + $this->assertEquals($this->data['permissions'], $this->projectTeamMemberResource->getPermissions()); + $this->assertEquals($this->data['givenAccessAt'], $this->projectTeamMemberResource->getGivenAccessAt()); + } +} diff --git a/tests/CrowdinApiClient/Model/ProjectTest.php b/tests/CrowdinApiClient/Model/ProjectTest.php index 5731ea20..01b13f65 100644 --- a/tests/CrowdinApiClient/Model/ProjectTest.php +++ b/tests/CrowdinApiClient/Model/ProjectTest.php @@ -54,6 +54,7 @@ class ProjectTest extends TestCase 'externalType' => 'proofread', 'workflowId' => 3, 'hasCrowdsourcing' => false, + 'hiddenStringsProofreadersAccess' => false, 'createdAt' => '2019-09-20T11:34:40+00:00', 'updatedAt' => '2019-09-20T11:34:40+00:00', 'lastActivity' => '2019-09-20T11:34:40+00:00', @@ -68,6 +69,7 @@ class ProjectTest extends TestCase 'publicDownloads' => true, 'useGlobalTm' => false, 'inContext' => true, + 'inContextProcessHiddenStrings' => true, 'inContextPseudoLanguageId' => 'uk', "isSuspended" => false, 'qaCheckIsActive' => true, @@ -115,6 +117,14 @@ class ProjectTest extends TestCase ] ], + 'glossaryAccess' => true, + 'normalizePlaceholder' => false, + 'saveMetaInfoInSource' => false, + 'notificationSettings' => [ + 'translatorNewStrings' => true, + 'managerNewStrings' => false, + 'managerLanguageCompleted' => true, + ], 'joinPolicy' => null, 'visibility' => null, ]; @@ -161,6 +171,7 @@ public function checkData() $this->assertEquals($this->data['externalType'], $this->project->getExternalType()); $this->assertEquals($this->data['workflowId'], $this->project->getWorkflowId()); $this->assertEquals($this->data['hasCrowdsourcing'], $this->project->isHasCrowdsourcing()); + $this->assertEquals($this->data['hiddenStringsProofreadersAccess'], $this->project->isHiddenStringsProofreadersAccess()); $this->assertEquals($this->data['createdAt'], $this->project->getCreatedAt()); $this->assertEquals($this->data['updatedAt'], $this->project->getUpdatedAt()); $this->assertEquals($this->data['lastActivity'], $this->project->getLastActivity()); @@ -176,11 +187,17 @@ public function checkData() $this->assertEquals($this->data['publicDownloads'], $this->project->isPublicDownloads()); $this->assertEquals($this->data['useGlobalTm'], $this->project->isUseGlobalTm()); $this->assertEquals($this->data['inContext'], $this->project->isInContext()); + $this->assertEquals($this->data['inContextProcessHiddenStrings'], $this->project->isInContextProcessHiddenStrings()); $this->assertEquals($this->data['inContextPseudoLanguageId'], $this->project->getInContextPseudoLanguageId()); $this->assertEquals($this->data['qaCheckIsActive'], $this->project->isQaCheckIsActive()); $this->assertEquals($this->data['qaCheckCategories'], $this->project->getQaCheckCategories()); $this->assertEquals($this->data['customQaCheckIds'], $this->project->getCustomQaCheckIds()); $this->assertEquals($this->data['languageMapping'], $this->project->getLanguageMapping()); $this->assertEquals($this->data['isSuspended'], $this->project->isSuspended()); + + $this->assertEquals($this->data['glossaryAccess'], $this->project->isGlossaryAccess()); + $this->assertEquals($this->data['normalizePlaceholder'], $this->project->isNormalizePlaceholder()); + $this->assertEquals($this->data['saveMetaInfoInSource'], $this->project->isSaveMetaInfoInSource()); + $this->assertEquals($this->data['notificationSettings'], $this->project->getNotificationSettings()); } } diff --git a/tests/CrowdinApiClient/Model/SourceStringTest.php b/tests/CrowdinApiClient/Model/SourceStringTest.php index f460b452..35ee20d2 100644 --- a/tests/CrowdinApiClient/Model/SourceStringTest.php +++ b/tests/CrowdinApiClient/Model/SourceStringTest.php @@ -21,6 +21,7 @@ class SourceStringTest extends TestCase 'projectId' => 2, 'fileId' => 48, 'branchId' => 4, + 'directoryId' => null, 'identifier' => '6a1821e6499ebae94de4b880fd93b985', 'text' => 'Not all videos are shown to users. See more', 'type' => 'text', @@ -62,6 +63,7 @@ public function checkData() $this->assertEquals($this->data['projectId'], $this->sourceString->getProjectId()); $this->assertEquals($this->data['fileId'], $this->sourceString->getFileId()); $this->assertEquals($this->data['branchId'], $this->sourceString->getBranchId()); + $this->assertEquals($this->data['directoryId'], $this->sourceString->getDirectoryId()); $this->assertEquals($this->data['identifier'], $this->sourceString->getIdentifier()); $this->assertEquals($this->data['text'], $this->sourceString->getText()); $this->assertEquals($this->data['type'], $this->sourceString->getType());