title: PHPUnit check method returns type
body: <p>I have a trouble to test what type of content returns the method. On success it returns <code>string or int</code>, at fail returns <code>array</code>. So code like this</p>
  
  <pre><code>public function createAddressBook($bookName)
  {
      if (true)
      {
          return 'OK';
      }
      return ['error' =&gt; 'FAIL'];
  }
  </code></pre>
  
  <p>The real code of the method is API request for new book ID that is <code>int or string</code> and i don't know what value will returns. My test code is like so:</p>
  
  <pre><code>public function setUp()
  {
      $this-&gt;stub = $this-&gt;createMock(\My\Class::class);
  }
  
  public function tearDown()
  {
      $this-&gt;stub = null;
  }
  
  public function testCreateAddressBook()
  {
     $this-&gt;stub-&gt;method('createAddressBook')-&gt;with('TestBookName');
     $result = $this-&gt;stub-&gt;createAddressBook('TestBookName');
     //what to do now?
  }
  </code></pre>
  
  <p>My question is how to test method for returning value type?</p>