In PHPUnit it's quite possible to completely mock a class that employs a fluent interface without too much heavy lifting.

  $mock = $this->getMock('Zend_Mail');
    $mock->expects($this->any())
              ->method(new PHPUnit_Framework_Constraint_IsAnything())
              ->will($this->returnSelf());
  

This has the effect of making any method call on your mock object return a reference to itself.