 <p>As I see it, you ned to verify two things for that builder:</p> <ul> <li>the correct instance is returned</li> <li>values, that are injected are the right ones.</li> </ul> <p>Checking instance is the easy part. Verifying values needs a bit of trickery.</p> <blockquote> <p><strike>The simples way to do this would be altering the autoloader. You need to make sure that when <code>MyClass</code> is requested for autoloader to fetch, instead of <code>/src/app/myclass.php</code> file it loads <code>/test/app/myclass.php</code>, which actually contains a "transparent" mock (where you with simple getters can verify the values).</strike></p> <p><kbd>bad idea</kbd></p> </blockquote> <p><strong>Update:</strong></p> <p>Also, if you do not want to mess with autoloader, you can just at th top of your <code>myBuilderTest.php</code> file include the mock class file, which contains definition for <code>MyClass</code>.</p> <p>... this actually seems like a cleaner way.</p> <pre><code>namespace Foo\Bar; use PHPUnit_Framework_TestCase; require TEST_ROOT . '/mocks/myclass.php' class MyBuilderTest extends PHPUnit_Framework_TestCase { public function MyBuilder_verify_injected_params_test() { $target = new MyBuilder; $instance = $target-&gt;build('a', 'b'); $this-&gt;assertEquals('a', $instance-&gt;getFirstConstructorParam(); } } </code></pre>