diff --git a/Tests/Fixtures/Project/src/Worldia/Bundle/ProductTestBundle/Service/ProjectApi.php b/Tests/Fixtures/Project/src/Worldia/Bundle/ProductTestBundle/Service/ProjectApi.php index af7b10e..73f562f 100644 --- a/Tests/Fixtures/Project/src/Worldia/Bundle/ProductTestBundle/Service/ProjectApi.php +++ b/Tests/Fixtures/Project/src/Worldia/Bundle/ProductTestBundle/Service/ProjectApi.php @@ -56,6 +56,13 @@ public function updateProject(array $params) $this->projects[$params['id']] = array_merge($this->projects[$params['id']], $params); } + public function update($id, array $params) + { + $this->projects[$id] = array_merge($this->projects[$id], $params); + + return $this->projects[$id]; + } + public function authors($projectId) { return new ProjectAuthors($this->client, $projectId); diff --git a/Tests/Units/Translation/TranslationManagerTest.php b/Tests/Units/Translation/TranslationManagerTest.php index b77e9ed..4eb1733 100644 --- a/Tests/Units/Translation/TranslationManagerTest.php +++ b/Tests/Units/Translation/TranslationManagerTest.php @@ -54,7 +54,7 @@ public function shouldCreateProject() $projectMock->expects($this->once()) ->method('setTextmasters') ->willReturn($projectMock); - $projectMock->expects($this->once()) + $projectMock->expects($this->exactly(2)) ->method('save') ->willReturn($projectMock); $projectMock->expects($this->once()) @@ -126,7 +126,7 @@ public function shouldCreateProjectWithTranslationMemory() $projectMock->expects($this->once()) ->method('setWorkTemplate') ->willReturn($projectMock); - $projectMock->expects($this->exactly(2)) + $projectMock->expects($this->exactly(3)) ->method('save') ->willReturn($projectMock); $projectMock->expects($this->once()) diff --git a/Translation/TranslationManager.php b/Translation/TranslationManager.php index d2c614a..46ac354 100644 --- a/Translation/TranslationManager.php +++ b/Translation/TranslationManager.php @@ -94,6 +94,7 @@ public function create( }, $authors); $project->setTextmasters($ids); + $project->save(); } $project->addDocuments($this->generateDocuments($project, $translatable));