load('
Hey bro, click here
:)
Hey bro, click here
:)
Hey bro, click here
:)
Hey bro, click here
Hey bro, click here
Hey bro, click here
Hey bro, click here
Hey bro, click here
Hey bro, click here
Hey bro, click here
', $dom->find('div', 0)->innerHtml); } public function testLoadClosingTagAddSelfClosingTag() { $dom = new Dom; $dom->addSelfClosingTag('mytag'); $dom->load('Hey bro, click here
Hey bro, click here
', $dom->find('div', 0)->innerHtml); } public function testLoadClosingTagAddSelfClosingTagArray() { $dom = new Dom; $dom->addSelfClosingTag([ 'mytag', 'othertag' ]); $dom->load('Hey bro, click here
Hey bro, click here
Hey bro, click here
Hey bro, click here
', $dom->find('div', 0)->innerHtml); } public function testLoadClosingTagClearSelfClosingTag() { $dom = new Dom; $dom->clearSelfClosingTags(); $dom->load('Hey bro, click here
Hey bro, click here
', $dom->find('div', 0)->innerHtml); } public function testLoadNoValueAttribute() { $dom = new Dom; $dom->load('hEY BRO, CLICK HERE
hEY BRO, CLICK HERE
', $dom->find('div', 0)->innerHtml); } public function testLoadWithFile() { $dom = new Dom; $dom->loadFromFile('tests/files/small.html'); $this->assertEquals('VonBurgermeister', $dom->find('.post-user font', 0)->text); } public function testLoadFromFile() { $dom = new Dom; $dom->loadFromFile('tests/files/small.html'); $this->assertEquals('VonBurgermeister', $dom->find('.post-user font', 0)->text); } public function testLoadFromFileFind() { $dom = new Dom; $dom->loadFromFile('tests/files/small.html'); $this->assertEquals('VonBurgermeister', $dom->find('.post-row div .post-user font', 0)->text); } public function testLoadUtf8() { $dom = new Dom; $dom->load('Dzień
'); $this->assertEquals('Dzień', $dom->find('p', 0)->text); } public function testLoadFileBig() { $dom = new Dom; $dom->loadFromFile('tests/files/big.html'); $this->assertEquals(10, count($dom->find('.content-border'))); } public function testLoadFileBigTwice() { $dom = new Dom; $dom->loadFromFile('tests/files/big.html'); $post = $dom->find('.post-row', 0); $this->assertEquals('Журчанье воды
Черно-белые тени
Вновь на фонтане
Журчанье воды
Черно-белые тени
Вновь на фонтане
Hey bro, click here
:)
Hey bro, click here
:)
Hey bro, click here
:)
Hey bro, click here
:)
Hey bro, click here
Hey bro, click here
Hey bro, click here
Hey bro, click here
Hey bro, click here
Hey bro, click here
', $dom->getElementsByTag('p')[0]->outerHtml); } public function testGetElementsByClass() { $dom = new Dom; $dom->load('Hey bro, click here
Hey bro, click here
', $dom->getElementsByClass('all')[0]->innerHtml); } public function testEnforceEncoding() { $dom = new Dom; $dom->load('tests/files/horrible.html', [ 'enforceEncoding' => 'UTF-8', ]); $this->assertNotEquals('', $dom->find('table input', 1)->outerHtml); } public function testScriptCleanerScriptTag() { $dom = new Dom; $dom->load('.....
....
'); $this->assertEquals('....', $dom->getElementsByTag('p')[1]->innerHtml); } public function testMultipleDoubleQuotes() { $dom = new Dom; $dom->load('Hello'); $this->assertEquals('This is a "test" of double quotes', $dom->getElementsByTag('a')[0]->title); } public function testMultipleSingleQuotes() { $dom = new Dom; $dom->load("Hello"); $this->assertEquals("Ain't this the best", $dom->getElementsByTag('a')[0]->title); } public function testBeforeClosingTag() { $dom = new Dom; $dom->load("$foo = "bar";');
$this->assertEquals('hello$foo = "bar";', (string) $dom);
}
public function testDeleteNode()
{
$dom = new Dom;
$dom->load('Hey bro, click here
:)
Hey bro,
:)