title: How can I test a single void method inside a class with PHPUnit?
body: <p>I've been searching around a bit for an answer to this but I can't seem to find anything concrete.</p>
  <p>Let's assume I have a class with multiple methods and in side that class I have a single method which is only called from a Javascript request. That method has a few other method calls inside it. However, it has no return value and no parameters. I want to test a few cases for that method. Here's an example:</p>
  <pre><code>public function myMethod(): void{
      $dataArray = request()-&gt;data;
      $service = $this-&gt;doMath();
      $start = $service-&gt;getStart($paramA, $paramB);
  
      // Couple computations here to get $someData
      $end = $someData;
  
      $this-&gt;final['start'] = $start;
      $this-&gt;final['end'] = $end;
  }
  </code></pre>
  <p>So essentially, I want to write some test for <code>myMethod()</code> and give it different values for <code>$paramA</code> and <code>$paramB</code> and assert that <code>$this-&gt;final</code> has the right/wrong outputs.</p>
  <p>What would be the way to go about this?</p>