title: PHPUnit signals a warning when mocking a namespace-ed class
body: <p>My composer project consists of the <code>src</code> and <code>tests</code> folders.
  The code inside <code>src</code> is auto-loaded using composers psr4 autoloader like so</p>
  
  <pre><code>    "autoload": {
      "psr-4": {
          "christmas\\":"src/"
      }
  }
  </code></pre>
  
  <p>The class to be tested looks like so</p>
  
  <pre><code>namespace christmas;
  class Hello
  {   //constructor &amp; dependency injection included in real class
  
  public function sayHello()
  {
      return "HELLO";
  }
  }
  </code></pre>
  
  <p>And Finally my test class looks like so</p>
  
  <pre><code>&lt;?php
      use PHPUnit\Framework\TestCase;
      require_once('../vendor/autoload.php');
      use christmas\Hello;
  
  
      class TestHello extends TestCase
      {
          public function testSayHelloMethod()
          {
              $hello = $this-&gt;getMockBuilder('Hello')
                  -&gt;getMock();
              $hello-&gt;expects($this-&gt;once())
                  -&gt;method('sayHello')
                  -&gt;will($this-&gt;returnValue('HELLO'));
  
              $this-&gt;assertEquals(
                  "HELLO",
                  $hello-&gt;sayHello()
              );
  
  
          }
      }
  </code></pre>
  
  <p>And here is how my i run phpunit</p>
  
  <pre><code>phpunit tests/TestHello
  </code></pre>
  
  <p>phpunit echoes back the following output</p>
  
  <pre><code>Time: 45 ms, Memory: 4.00 MB
  
      There was 1 warning:
  
      1) tests\Hello::testSayHelloMethod()
      Trying to configure method "sayHello" which cannot be configured because it does not exist, has not been specified, is final, or is static
  
      /usr/share/php/PHPUnit/TextUI/TestRunner.php:641
      /usr/share/php/PHPUnit/TextUI/Command.php:206
      /usr/share/php/PHPUnit/TextUI/Command.php:162
  
      WARNINGS!
      Tests: 1, Assertions: 0, Warnings: 1.
  </code></pre>
  
  <p>Below is a view of how my code is organized,</p>
  
  <pre><code>    ├── composer.json
      ├── src
      │   └── Hello.php
      ├── tests
      │   └── TestHello.php
      └── vendor
  </code></pre>
  
  <p>What am i missing ? I need to have a passing test with no single warning.</p>