title: Test method call with different arguments in PHPUnit
body: <p>I have the following abstract class:</p>
  
  <pre><code>abstract class Voter
  {
      public function vote()
      {
          $this-&gt;something();
          $this-&gt;something();
  
          $this-&gt;voteFoo();
          $this-&gt;voteBar();
      }
  
      public function __call($method, $args)
      {
          //...
      }
  
      abstract public function something();
  }
  </code></pre>
  
  <p><code>voteFoo</code> and <code>voteBar</code> are handled by <code>__call</code>.</p>
  
  <p>I want to assert that <code>vote()</code> calls both <code>voteFoo()</code> and <code>voteBar()</code>, how can I do that?</p>
  
  <p>I tried using <code>$this-&gt;at(..)</code> but it gives me an error:</p>
  
  <pre><code>$voter = $this-&gt;getMockForAbstractClass('Voter', array(), '', true, true, true, array('__call'));
  
  $voter-&gt;expects($this-&gt;any())
        -&gt;method('something')
        -&gt;will($this-&gt;returnValue(true));
  
  $voter-&gt;expects($this-&gt;at(0))
        -&gt;method('__call')
        -&gt;with($this-&gt;equalTo('voteFoo'));
  
  $voter-&gt;expects($this-&gt;at(1))
        -&gt;method('__call')
        -&gt;with($this-&gt;equalTo('voteBar'));
  
  $voter-&gt;vote();
  
  *********** ERROR *************
  Expectation failed for method name is equal to &lt;string:__call&gt; when invoked at
  sequence index 0.
  Mocked method does not exist.
  </code></pre>
  
  <p><strong>Edit</strong>:</p>
  
  <p>If I change the values in <code>$this-&gt;at()</code> to <strong>2</strong> and <strong>3</strong> the test passes, which means that for some reason <code>$this-&gt;something()</code> also triggers the <code>__call</code> method.</p>
  
  <p>This <em>Voter</em> class is not my real <em>Voter</em> class, it's a simple version for the question. In my real class I can't tell how many times <code>__call</code> will be called..</p>