/** * @depends testDefaultJsBodyInlineScriptTag * @return null */ public function testAddJsBodyInlineContent() { $script = $this->htmlDoc->getJsBodyInlineScriptTag(); $content1 = 'alert("i am content 1");'; $this->assertSame($this->htmlDoc, $this->htmlDoc->addJsBodyInlineContent($content1)); $expected = array($content1); $this->assertEquals($expected, $script->getContent()); $this->assertEquals($content1, $this->htmlDoc->getJsBodyInlineContent()); /* when the isArray parameter is true it will return the * content as an array of items that were entered */ $this->assertEquals($expected, $this->htmlDoc->getJsBodyInlineContent(true)); $content2 = 'alert("i am content 2");'; $this->assertSame($this->htmlDoc, $this->htmlDoc->addJsBodyInlineContent($content2)); $expected = array($content1, $content2); $this->assertEquals($expected, $script->getContent()); $this->assertEquals($script->buildContent(), $this->htmlDoc->getJsBodyInlineContent()); $this->assertEquals($expected, $this->htmlDoc->getJsBodyInlineContent(true)); }
/** * @expectedException InvalidArgumentException * @dataProvider provideNoCastableStrings * @depends testDefaultGetFinalBodyContentTag * @return null */ public function testAddFinalBodyContentNoStringable($content) { $this->htmlDoc->addFinalBodyContent($content); }