blob: 4886511299b97cad2b47ee993ab01397d7c3e16d [file] [log] [blame]
<?php
/**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @version //autogentag//
* @filesource
* @package UserInput
* @subpackage Tests
*/
?>
<html>
<head><title>Test 2</title></head>
<body>
<?php
require_once '../../../Base/src/base.php';
function __autoload( $className )
{
ezcBase::autoload( $className );
}
if ( count( $_POST ) )
{
?>
<table border="1" align="center">
<tr><th>Expected</th><th>Result</th></tr>
<tr>
<td>
<pre>
<?php
try
{
throw new ezcInputFormVariableMissingException( 'test' );
}
catch ( ezcInputFormException $e )
{
echo $e->getCode(), ': ', $e->getMessage();
}
?>
</td>
<td>
<pre>
<?php
$def = array( 'test' => new ezcInputFormDefinitionElement( ezcInputFormDefinitionElement::REQUIRED, 'float' ) );
try
{
$form = new ezcInputForm( INPUT_POST, $def );
}
catch ( ezcInputFormException $e )
{
echo $e->getCode(), ': ', $e->getMessage();
}
?>
</td>
</tr>
</table>
</body>
</html>
<?php
}
else
{
?>
<form method="post" align="center">
<input type="submit" name="submit" value="Go!"/>
</form>
</body>
</html>
<?php
}
?>