//This file is part of DeforaOS Web DaPortal // //This program is free software: you can redistribute it and/or modify //it under the terms of the GNU General Public License as published by //the Free Software Foundation, version 3 of the License. // //This program is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //GNU General Public License for more details. // //You should have received a copy of the GNU General Public License //along with this program. If not, see . require_once('./tests.php'); //variables $html5 = array( array('type' => 'entry', 'attributes' => array( 'name' => 'entry', 'text' => 'Entry', 'value' => 'Value' ), 'expected' => "
Entry
"), array('type' => 'page', 'attributes' => FALSE, 'expected' => " ") ); //functions function render(Engine $engine, Format $format, PageElement $page, $expected = FALSE) { ob_start(); $format->render($engine, $page); $obtained = ob_get_contents(); ob_end_clean(); if($expected === FALSE) print($page->getType().': Obtained "'.$obtained."\"\n"); else if($obtained != $expected) { print($page->getType().': Expected "'.$expected."\"\n"); print($page->getType().': Obtained "'.$obtained."\"\n"); return 2; } return 0; } $ret = 0; $config->set('format', 'backend', 'html5'); $format = Format::attachDefault($engine); foreach($html5 as $t) { $page = new PageElement($t['type'], $t['attributes']); $ret |= render($engine, $format, $page, $t['expected']); } exit($ret); ?>