At the beginning of the function I am trying to test, there is a check to see that the required inputs are set. If they are not an exception is thrown:
public function save(array $input) {
if (!isset($input['var1']) || !isset($input['var2'])) {
throw new BadRequestException('Invalid parameters for ' . $this->class . ':save');
} .........rest of function
Do I need to separate this out into another function to test the exception? I know I want to test this if var1 is set and var2 is not set, as well as if var2 is set and var1 is not set. Do I test in the testSave function, or should I separate it out into another testing function? If I do test in the same function, how do I do this?