Przestrzenie nazw, "use", "namespace" widywałem i używałem naturalnie, nie wnikając za bardzo w temat.
i zgłupiałem gdy zobaczyłem taki przykładowy kod
namespace SebastianBergmann\Money; class CurrencyTest extends \PHPUnit_Framework_TestCase { /** * @covers \SebastianBergmann\Money\Currency::__construct * @expectedException \SebastianBergmann\Money\InvalidArgumentException */ public function testExceptionIsRaisedForInvalidConstructorArgument() { new Currency(null); } /** * @covers \SebastianBergmann\Money\Currency::__construct */ public function testCanBeConstructedFromUppercaseString() { $c = new Currency('EUR'); $this->assertInstanceOf('SebastianBergmann\\Money\\Currency', $c); return $c; } ...
Jak to jest że poniższe działa bez wcześniejszego "use":
- extends \PHPUnit_Framework_TestCase
- new Currency(null);