When using TDD, is it bad practice to pass a newly written test with code that could also pass another test? For example, take the following test (in PHP)
public function WhenSomethingIsNull_ThrowsException()
{
$input = null;
$this->module->someMethod($input);
}
This could be made to pass with the following code
public function someMethod($input)
{
if(!$input)
throw new Exception()
}
This would also pass the test WhenSomethingIsZero_ThrowsException
. In these cases, should I fix what I know is wrong with this test in the refactoring step? Or only write code which passes this and only this test?