diff --git a/app/V1Module/presenters/ExercisesConfigPresenter.php b/app/V1Module/presenters/ExercisesConfigPresenter.php index 6e5aee27..00dfe2a6 100644 --- a/app/V1Module/presenters/ExercisesConfigPresenter.php +++ b/app/V1Module/presenters/ExercisesConfigPresenter.php @@ -745,8 +745,6 @@ public function checkGetTests(string $id) public function actionGetTests(string $id) { $exercise = $this->exercises->findOrThrow($id); - - // Get to da responsa! $this->sendSuccessResponse($exercise->getExerciseTests()->getValues()); } @@ -782,6 +780,7 @@ public function actionSetTests(string $id) */ $newTests = []; + /** @var array */ $namesToOldIds = []; // new test name => old test ID $testsModified = false; @@ -810,11 +809,6 @@ public function actionSetTests(string $id) if ($testEntity === null) { // new exercise test was requested to be created $testsModified = true; - - if ($exercise->getExerciseTestByName($name)) { - throw new InvalidApiArgumentException('tests', "given test name '$name' is already taken"); - } - $testEntity = new ExerciseTest($name, $description, $this->getCurrentUser()); $this->exerciseTests->persist($testEntity); } elseif ($testEntity->getName() !== $name || $testEntity->getDescription() !== $description) {