My quest of starting to use namespaces in PHP keeps continuing. This time PHPUnit gives me problems. My setup() method is like this:
$test = new \MyNamespace\NonPersistentStorage(); // works
$mock = $this->getMock('\\MyNamespace\\NonPersistentStorage'); // doesn't work
The getMock() method only results in PHP looking for a NonPersistentStorage class. Not within the namespace.
Q: What do I need to change to get the getMock() method look for the class in the namespace?
Edit: The double backslash is not the problem. Also see: the manual: (quote)
'Inside a single-quoted string, the backslash escape sequence is much safer to use, but it is still recommended practice to escape backslashes in all strings as a best practice.'