當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sfTestBrowser::info方法代碼示例

本文整理匯總了PHP中sfTestBrowser::info方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfTestBrowser::info方法的具體用法?PHP sfTestBrowser::info怎麽用?PHP sfTestBrowser::info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sfTestBrowser的用法示例。


在下文中一共展示了sfTestBrowser::info方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: dirname

<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
try {
    // first drop database
    $this->runTask('doctrine:drop-db', '--no-confirmation');
    $database_file = sfConfig::get('sf_config_dir') . DIRECTORY_SEPARATOR . 'databases.yml';
    $database_file_content = file_get_contents($database_file);
    $config_file = sfConfig::get('sf_web_dir') . DIRECTORY_SEPARATOR . 'config.php';
    $config_file_content = file_get_contents($config_file);
    $browser = new sfTestBrowser();
    $browser->setTester('doctrine', 'sfTesterDoctrine');
    $browser->info('Test the first page')->get('/')->with('request')->begin()->isParameter('module', 'static')->isParameter('action', 'step1')->end()->info('Trying to jump steps redirect to my step')->get('/step3')->with('response')->begin()->isRedirected()->end()->followRedirect()->with('request')->begin()->isParameter('module', 'static')->isParameter('action', 'step1')->end()->setField('language', 'en')->click('next')->with('response')->begin()->isRedirected()->end()->post('/step2')->followRedirect()->with('request')->begin()->isParameter('module', 'static')->isParameter('action', 'step3')->end()->click('next')->with('response')->begin()->isRedirected()->end()->followRedirect()->with('request')->begin()->isParameter('module', 'static')->isParameter('action', 'step4')->end()->setField('db[database]', 'siwapp_test')->setField('db[username]', 'siwapp')->setField('db[password]', 'wappis')->setField('db[host]', 'bbdd')->click('next')->with('response')->begin()->isRedirected()->end()->followRedirect()->with('request')->begin()->isParameter('module', 'static')->isParameter('action', 'step5')->end()->setField('config[admin_email]', 'e@test.org')->setField('config[admin_username]', 'test')->setField('config[admin_password', 'test')->setField('config[admin_password_bis]', 'test')->setField('config[preload]', true)->click('next')->with('response')->begin()->isRedirected()->end()->followRedirect()->with('request')->begin()->isParameter('module', 'static')->isParameter('action', 'step6')->end()->with('response')->begin()->info('Testing there were no sql errors')->checkElement('ul.error_list li:first-child', false)->end();
    $browser->info('Test the data inserted')->with('doctrine')->begin()->check('sfGuardUser', array('username' => 'test', 'is_super_admin' => 1))->check('Profile', array('email' => 'e@test.org', 'language' => 'en'))->end();
    // this is to revert always the files modified, because
    // with errors there is no 'Finish' button
    $browser->info('Test the redirection to the application')->click('Finish')->with('response')->begin()->isRedirected()->end();
} catch (Exception $e) {
    echo $e->getMessage() . PHP_EOL;
}
$browser->info('Reverting modified files');
@file_put_contents($database_file, $database_file_content);
@file_put_contents($config_file, $config_file_content);
$browser->info('Reverting cache and database');
$this->runTask('cc');
$this->runTask('siwapp:test-data-load', '--env=test');
開發者ID:solutema,項目名稱:siwapp-sf1,代碼行數:26,代碼來源:staticActionsTest.php


注:本文中的sfTestBrowser::info方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。