title: How to test a method that's using a static factory?
body: <p>Now that..I'm using IoC container and DI with all my projects, I would like to learn how I should have tested my codes when I was using a static factory (I didn't do any unit testing back then). Let's say I have the following code snippet.</p>
  
  <pre><code>class TestFactory {
  
      public static function create($something) {
          switch($something) {
              case 1:
                  return Dummy;
                  break;
          }
      }
  
  }
  
  class Client {
  
      public function __construct() {
  
          $this-&gt;aClass = TestFactory::create(1);
  
      }
  
  }
  </code></pre>
  
  <p>If I want to unit test <strong>Client</strong> class, how do I do that without using DI or IoC container?</p>