All pastes #2046056 Raw Edit

Stuff

public html v1 · immutable
#2046056 ·published 2011-04-13 16:33 UTC
rendered paste body
<?phpdefine('FILE_UNDER_TEST', 'public_html/templates/register_account.php');class Register_Account_Test extends PHPUnit_Framework_TestCase{	/**	 * Verify template populates default values properly.	 */	public function test_default_values() {		include(FILE_UNDER_TEST);		$this->assertEquals($first_name, '');		$this->assertEquals($last_name, '');		$this->assertEquals($email, '');		$this->assertEquals($password, '');		$this->assertEquals($is_error, FALSE);		$this->assertNull($error_msg, NULL);	}}#########################<!DOCTYPE html><?php$first_name = isset($options['first_name']) ? $options['first_name'] : '';$last_name = isset($options['last_name']) ? $options['last_name'] : '';$email = isset($options['email']) ? $options['email'] : '';$password = isset($options['password']) ? $options['password'] : '';$is_error = (isset($options['error']) && $options['error'] == TRUE) ? TRUE : FALSE;$error_msg = ($is_error && isset($options['error_msg'])) ? $options['error_msg'] : NULL;?><html>	<head>		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">		<title>Register New Account</title>				<style>			label {				width: 8em;				float: left;				text-align: right;				margin-right: 0.5em;				display: block;			}						input { margin-left: 20; }			input#submit { margin-top:2em; margin-left: 5em; }			#error {				color:red;				border:1px solid red;				margin-bottom:20px;				width:600px;				padding:0.5em;			}		</style>	</head>	<body>			<?php if($is_error && !is_null($error_msg)) { ?>		<div name="error" id="error"><?php echo $error_msg ?></div>		<?php } ?>			<form method="post">			<div>				<label>First Name:</label>				<input type="text" name="first_name" id="first_name" value="<?php echo $first_name; ?>" />			</div>			<div>				<label>Last Name:</label>				<input type="text" name="last_name" id="last_name" value="<?php echo $last_name; ?>" />			</div>			<div>				<label>E-mail:</label>				<input type="text" name="email" id="email" size="30" value="<?php echo $email; ?>" />			</div>			<div>				<label>Password:</label>				<input type="password" name="password" id="password" value="<?php echo $password; ?>" />			</div>			<div>				<label>Confirm Password:</label>				<input type="password" name="password2" id="password2">			</div>			<input name="submit" id="submit" value="Submit" type="submit" />		</form>		</body></html>