/** * Constructor * * @param string $title form title * @param integer $modid module id * @param string $permname permission name * @param string $permdesc permission description * @param string $url redirect url * @param boolean $anonymous true to include anonymous group */ public function __construct($title, $modid, $permname, $permdesc, $url = '', $anonymous = true) { parent::__construct($title, 'groupperm_form', XOOPS_URL . '/modules/system/admin/groupperm.php', 'post'); $this->modid = (int) $modid; $this->permName = $permname; $this->permDesc = $permdesc; $this->addElement(new Hidden('modid', $this->modid)); $this->addElement(new Token($permname)); if ($url != "") { $this->addElement(new Hidden('redirect_url', $url)); } $this->showAnonymous = $anonymous; }
/** * @covers Xoops\Form\Form::renderValidationJS */ public function testRenderValidationJS() { $value = $this->object->renderValidationJS(); $this->assertTrue(is_string($value)); $this->assertTrue(false !== strpos($value, 'Start Form Validation JavaScript')); }