I have a class method I am trying to write a unit test for, it starts off something like this:
public function determineStatusActivity($proposal, $decisionStatusId): ?array
{
if (isset($proposal->contact_org_id)) {
$this->personId = PipedriveActivityHelper::getPersonId($proposal->contact_org_id);
}
I then have my test method which will need the response to run the check:
public function acceptedActivityTest()
{
$activity = new CreateActivityInPipedriveForProposalStatusChange();
$response = $activity->determineStatusActivity($this->proposal, 1);
//Compare the response to a defined stub..
}
This class method determineStatusActivity()
receives two pieces of data that I can create mocks for a pass to it, however I am at a loss at what to do when it gets to the static PipedriveActivityHelper class, is there a way to define the static class' behaviour in the test file method?
I believe this is what you are looking for, notice the test class decorators. TDD is always the best approach.