当前位置: 首页>>代码示例>>PHP>>正文


PHP sfTestBrowser::initialize方法代码示例

本文整理汇总了PHP中sfTestBrowser::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP sfTestBrowser::initialize方法的具体用法?PHP sfTestBrowser::initialize怎么用?PHP sfTestBrowser::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sfTestBrowser的用法示例。


在下文中一共展示了sfTestBrowser::initialize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_login_success

 public function test_login_success()
 {
     $b = new sfTestBrowser();
     $b->initialize();
     $b->get('/')->click('Sign In', array('login' => 'isern', 'password' => 'testpassword'))->isRedirected()->followRedirect()->checkResponseElement('body', '/Researchers/');
     $b->get('/organization/list')->checkResponseElement('body', '/Organizations/')->checkResponseElement('body', '/Name/');
     $b->get('/collaboration/list')->checkResponseElement('body', '/Collaborations/')->checkResponseElement('body', '/Name/');
 }
开发者ID:TheProjecter,项目名称:myisern-lime,代码行数:8,代码来源:LoginSuccessTest.php

示例2: dirname

<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
// create a new test browser
$browser = new sfTestBrowser();
$browser->initialize();
$browser->get('/messages/index')->isStatusCode(200)->isRequestParameter('module', 'messages')->isRequestParameter('action', 'index')->checkResponseElement('body', '!/This is a temporary page/');
开发者ID:sgrove,项目名称:cothinker,代码行数:7,代码来源:messagesActionsTest.php

示例3: sfTestBrowser

<?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$app = 'frontend';
if (!(include dirname(__FILE__) . '/../bootstrap/functional.php')) {
    return;
}
$b = new sfTestBrowser();
$b->initialize();
// default main page
$b->get('/')->isStatusCode(200)->isRequestParameter('module', 'default')->isRequestParameter('action', 'index')->checkResponseElement('body', '/congratulations/i')->checkResponseElement('link[href="/sf/sf_default/css/screen.css"]');
// default 404
$b->get('/nonexistant')->isStatusCode(404)->isForwardedTo('default', 'error404')->checkResponseElement('body', '!/congratulations/i')->checkResponseElement('link[href="/sf/sf_default/css/screen.css"]');
// unexistant action
$b->get('/default/nonexistantaction')->isStatusCode(404)->isForwardedTo('default', 'error404')->checkResponseElement('link[href="/sf/sf_default/css/screen.css"]');
// available
sfConfig::set('sf_available', false);
$b->get('/')->isStatusCode(200)->isForwardedTo('default', 'unavailable')->checkResponseElement('body', '/unavailable/i')->checkResponseElement('body', '!/congratulations/i')->checkResponseElement('link[href="/sf/sf_default/css/screen.css"]');
sfConfig::set('sf_available', true);
// module.yml: enabled
$b->get('/configModuleDisabled')->isStatusCode(200)->isForwardedTo('default', 'disabled')->checkResponseElement('body', '/module is unavailable/i')->checkResponseElement('body', '!/congratulations/i')->checkResponseElement('link[href="/sf/sf_default/css/screen.css"]');
// view.yml: has_layout
$b->get('/configViewHasLayout/withoutLayout')->isStatusCode(200)->checkResponseElement('body', '/no layout/i')->checkResponseElement('head title', false);
// security.yml: is_secure
$b->get('/configSecurityIsSecure')->isStatusCode(200)->isForwardedTo('default', 'login')->checkResponseElement('body', '/Login Required/i')->checkResponseElement('body', 1)->checkResponseElement('link[href="/sf/sf_default/css/screen.css"]');
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:genericTest.php

示例4: test_login_does_not_exist

 public function test_login_does_not_exist()
 {
     $b = new sfTestBrowser();
     $b->initialize();
     $b->get('/')->click('Sign In', array('login' => 'isern', 'password' => 'isern2008xxx'))->checkResponseElement('body', '/This account does not exist/');
 }
开发者ID:TheProjecter,项目名称:myisern-lime,代码行数:6,代码来源:LoginDoesNotExistTest.php

示例5: test_login_require_for_organizations

 public function test_login_require_for_organizations()
 {
     $b = new sfTestBrowser();
     $b->initialize();
     $b->get('/organization/list')->checkResponseElement('body', '/Login/')->checkResponseElement('body', '/Please login/');
 }
开发者ID:TheProjecter,项目名称:myisern-lime,代码行数:6,代码来源:LoginRequiredForOrganizationsTest.php


注:本文中的sfTestBrowser::initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。