function testJS() { $p = new Page(); $this->assertEmpty($p->renderJS(), 'Скрипты не заданы'); $p->addJS('test.js')->addJS('js.js'); $exp = '<!-- JS -->' . "\n" . '<script src="test.js" type="text/javascript"></script>' . "\n" . '<script src="js.js" type="text/javascript"></script>' . "\n" . '<!-- /JS -->' . "\n"; $this->assertEquals($exp, $p->renderJS(), 'Сформированный HTML'); $p->clearJS(); $this->assertEmpty($p->renderJS(), 'Скрипты удалены'); }