當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。