title: Check that mock's method is called without any parameters passed (in phpunit)
body: <p>In phpunit we can specify the method was called with particular</p>
  
  <pre><code>-&gt;with($this-&gt;equalTo('foobar'))
  </code></pre>
  
  <p>or any</p>
  
  <pre><code>-&gt;with($this-&gt;anything())
  </code></pre>
  
  <p>parameter.</p>
  
  <p>But is there a way to specify that the method has been called without parameters at all?</p>
  
  <p>This is the test I expect to fail:</p>
  
  <pre><code>public function testZ()
  {
      $a = $this-&gt;getMock('q');
  
      $a-&gt;expects($this-&gt;once())
          -&gt;method('z')
          -&gt;with(); // &lt;--- what constraint to specify here?
  
      $a-&gt;z(1);
  }
  </code></pre>
  
  <p><strong>UPD</strong>:</p>
  
  <p>The question has theoretical nature, so I have no any real life example. Some case it could be useful I can think of right now is:</p>
  
  <pre><code>public function testMe($object)
  {
      $object-&gt;foo();
  }
  </code></pre>
  
  <p>And let's assume that <code>testMe</code> should (by design and by requirements) always call the method without parameters (assuming <code>foo()</code> has default ones). Because any non-default parameter (more precise: any parameter != to default one, which we don't know yet and which probably could change independently) in this case causes fatal consequences.</p>