public function testRemoveExistingNumberWillRemoveItFromRepository() { $number = $this->createExampleNumber(); $this->repositoryMock->expects($this->once())->method('findById')->with(100)->will($this->returnValue($number)); $this->repositoryMock->expects($this->once())->method('remove')->with($number); $this->useCase->removeNumber($number); }
public function testRemoveNumberActionWillDelegateRemovalToUseCase() { $number = new PhoneNumber(); $this->useCaseMock->expects($this->once())->method('removeNumber')->with($number); $this->controller->removeNumberAction($number); }
/** * Removes phone number object * * @ApiDoc( * section="Number management", * description="Removes phone number object", * statusCodes={ * 204="Returned when successful", * 404={ * "User not found", * "Number not found", * "Number not belonging to user" * } * } * ) * * @ParamConverter( * "phoneNumber", * class="ArkonPhoneBookBundle:PhoneNumber", * options={"mapping": {"id": "owner", "numberId": "id"}} * ) * @View(statusCode=204) * @param PhoneNumber $number */ public function removeNumberAction(PhoneNumber $number) { $this->useCase->removeNumber($number); }