示例#1
0
 public function setUp()
 {
     $view = new Zend_View();
     $base = str_replace('/', DIRECTORY_SEPARATOR, '/../_templates');
     $view->setScriptPath(dirname(__FILE__) . $base);
     $view->strictVars(true);
     $this->view = $view;
 }
示例#2
0
 public function testStrictVars()
 {
     $view = new Zend_View();
     $view->setScriptPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . '_templates');
     $view->strictVars(true);
     set_error_handler(array($this, 'handleNotices'), E_USER_NOTICE);
     $content = $view->render('testStrictVars.phtml');
     restore_error_handler();
     foreach (array('foo', 'bar') as $key) {
         $this->assertContains('Key "' . $key . '" does not exist', $this->notices);
     }
 }
示例#3
0
            $s .= 'The private policy can be found at <a href="' . $policy . '">' . $policy . '</a>.<br>';
        }
    }
    return $s;
}
$session = new Zend_Session_Namespace("opeinid.server");
Zend_Session::start();
$ret = false;
if ($_SERVER["REQUEST_METHOD"] == "GET") {
    if (!isset($_GET['openid_action']) && isset($_GET['openid_mode'])) {
        $ret = $server->handle($_GET, new Zend_OpenId_Extension_Sreg());
    } else {
        require_once 'Zend/View.php';
        $view = new Zend_View();
        $view->setScriptPath(__DIR__ . '/templates');
        $view->strictVars(true);
        if (isset($session->id)) {
            $view->id = $session->id;
        }
        if (isset($session->error)) {
            $view->error = $session->error;
            unset($session->error);
        }
        if (isset($_GET['openid_action'])) {
            if ($_GET['openid_action'] == 'register') {
                $ret = $view->render('register.phtml');
            } else {
                if ($_GET['openid_action'] == 'registration_complete' && isset($_GET['openid_name'])) {
                    $view->name = $_GET['openid_name'];
                    $view->url = Zend_OpenId::selfURL() . '?openid=' . $view->name;
                    if ($server->hasUser($view->url)) {
示例#4
0
 public function testStrictVars()
 {
     $view = new Zend_View();
     $view->setScriptPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . '_templates');
     $view->strictVars(true);
     $content = $view->render('testStrictVars.phtml');
     $this->assertContains('Key "foo" does not exist', $content, $content);
     $this->assertContains('Key "bar" does not exist', $content);
 }