public function testNamespace() { $scriptInclude = new ScriptInclude(); $this->assertNull($scriptInclude->getNamespace()); $this->assertSame($scriptInclude, $scriptInclude->setNamespace("some.namespace")); $this->assertEquals("some.namespace", $scriptInclude->getNamespace()); }
/** * Set a Script Include * * @api * @param string|ScriptInclude $file Include file or ScriptInclude * @param string $namespace Include namespace * @return static */ public function setScriptInclude($file, $namespace = null) { if ($file instanceof ScriptInclude) { $scriptInclude = $file; } else { $scriptInclude = new ScriptInclude($file, $namespace); } $this->includes[$scriptInclude->getNamespace()] = $scriptInclude; return $this; }