예제 #1
0
 public function testGetFormats()
 {
     $formats = EasyRdf_Format::getFormats();
     $this->assertType('array', $formats);
     $this->assertGreaterThan(0, count($formats));
     foreach ($formats as $format) {
         $this->assertEquals('EasyRdf_Format', get_class($format));
     }
 }
 * supported input and output formats. These options are then
 * displayed on the HTML form.
 *
 * The input data is loaded or parsed into an EasyRdf_Graph.
 * That graph is than outputted again in the desired output format.
 *
 * @package    EasyRdf
 * @copyright  Copyright (c) 2009-2011 Nicholas J Humfrey
 * @license    http://unlicense.org/
 */
set_include_path(get_include_path() . PATH_SEPARATOR . '../lib/');
require_once "EasyRdf.php";
require_once "html_tag_helpers.php";
$input_format_options = array('Guess' => 'guess');
$output_format_options = array();
foreach (EasyRdf_Format::getFormats() as $format) {
    if ($format->getSerialiserClass()) {
        $output_format_options[$format->getLabel()] = $format->getName();
    }
    if ($format->getParserClass()) {
        $input_format_options[$format->getLabel()] = $format->getName();
    }
}
?>
<html>
<head><title>EasyRdf Converter</title></head>
<body>
<h1>EasyRdf Converter</h1>

<div style="margin: 10px">
  <?php