title: Simple PHPUnit one about getting a generic mocked object
body: <p>Test method:</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>public function convert(AbstractMessage $message)
  {
      $data = array();
  
      // Text conversion
      $text = $message-&gt;getText();
  
      if(null !== $text) {
          if(!is_string($text) &amp;&amp; (is_object($text)
              &amp;&amp; !method_exists($text, '__toString'))) {
              throw new UnexpectedTypeException(gettype($text), 'string');
          }
  
          $data['text'] = (string) $text;
      }
  }
  </code></pre>
  
  <p>How can I mock a generic object (no matter the class) that has a <code>__toString</code> method?</p>