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


PHP sfTestFunctional::get方法代码示例

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


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

示例1: get

 public function get($uri, $parameters = array(), $changeStack = true)
 {
     try {
         return parent::get($uri, $parameters, $changeStack);
     } catch (Exception $e) {
         //If the URI cannot be found, the page is a 404 and should be removed
     }
     return false;
 }
开发者ID:bshaffer,项目名称:Symplist,代码行数:9,代码来源:SeoTestFunctional.class.php

示例2: sfTestFunctional

<?php

include(dirname(__FILE__).'/../../bootstrap/functional.php');

$browser = new sfTestFunctional(new sfBrowser());

$browser->
  get('/dance/index')->

  with('request')->begin()->
    isParameter('module', 'dance')->
    isParameter('action', 'index')->
  end()->

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
开发者ID:romankallweit,项目名称:swingmachine,代码行数:19,代码来源:danceActionsTest.php

示例3: dirname

<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/copisim_filiere/index')->with('request')->begin()->isParameter('module', 'copisim_filiere')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
开发者ID:googlecode-mirror,项目名称:copisim,代码行数:5,代码来源:copisim_filiereActionsTest.php

示例4: dirname

<?php

/*
 * Kimkëlen - School Management Software
 * Copyright (C) 2013 CeSPI - UNLP <desarrollo@cespi.unlp.edu.ar>
 *
 * This file is part of Kimkëlen.
 *
 * Kimkëlen is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License v2.0 as published by
 * the Free Software Foundation.
 *
 * Kimkëlen is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Kimkëlen.  If not, see <http://www.gnu.org/licenses/gpl-2.0.html>.
 */
include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/optional_school_year/index')->with('request')->begin()->isParameter('module', 'optional_school_year')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
开发者ID:nvidela,项目名称:kimkelen,代码行数:23,代码来源:optional_school_yearActionsTest.php

示例5: dirname

<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$test = $browser->test();
$conn = Doctrine::getConnectionByTableName('location');
$conn->beginTransaction();
$browser->get('/')->info('1 - homepage')->with('request')->begin()->isParameter('module', 'collector')->isParameter('action', 'locations')->end()->with('response')->begin()->isStatusCode(200)->end();
$browser->get('/data')->info('1.1 - locations data')->with('request')->begin()->isParameter('module', 'collector')->isParameter('action', 'data')->end()->with('response')->begin()->isStatusCode(200)->end();
$browser->info('2 - main links')->get('/')->info('2.1 - profits')->click("Отчёты")->with('request')->begin()->isParameter('module', 'profit')->isParameter('action', 'list')->end()->with('response')->begin()->isStatusCode(200)->end();
$browser->info('2 - main linkчёs')->get('/')->info('2.2 - talks')->click("Обсуждения")->with('request')->begin()->isParameter('module', 'talk')->isParameter('action', 'list')->end()->with('response')->begin()->isStatusCode(200)->end();
$browser->info('2 - main links')->get('/')->info('2.3 - events')->click("События")->with('request')->begin()->isParameter('module', 'event')->isParameter('action', 'list')->end()->with('response')->begin()->isStatusCode(200)->end();
//@todo: make submit check
//$browser->
//        info('2 - main links')->
//        get('/')->
//        info('2.4 - search')->
//        click("Поиск")->
//        with('request')->begin()->
//        isParameter('module', 'location')->
//        isParameter('action', 'search')->
//        end()->
//        with('response')->begin()->
//        isStatusCode(200)->
//        end()
//;
$browser->info('2 - main links')->get('/')->info('2.5 - signin')->click("Вход")->with('request')->begin()->isParameter('module', 'sfGuardAuth')->isParameter('action', 'signin')->end()->with('response')->begin()->isStatusCode(401)->end();
$browser->info('2 - main links')->get('/')->info('2.6 - signup')->click("Регистрация")->with('request')->begin()->isParameter('module', 'sfApply')->isParameter('action', 'apply')->end()->with('response')->begin()->isStatusCode(200)->end();
$browser->info('3 -footer links')->get('/')->info('3.1- Top')->click("По рейтингу")->with('request')->begin()->isParameter('module', 'collector')->isParameter('action', 'top')->end()->with('response')->begin()->isStatusCode(200)->end();
$browser->info('3 -footer links')->get('/')->info('3.2- Regions')->click("По регионам")->with('request')->begin()->isParameter('module', 'collector')->isParameter('action', 'regions')->end()->with('response')->begin()->isStatusCode(200)->end();
$browser->info('3 -footer links')->get('/')->info('3.3 - Free')->click("Бесплатная рыбалка")->with('request')->begin()->isParameter('module', 'collector')->isParameter('action', 'listFree')->end()->with('response')->begin()->isStatusCode(200)->end();
开发者ID:limitium,项目名称:uberlov,代码行数:31,代码来源:mainTest.php

示例6: dirname

<?php

/*
 * This file is part of the symfony package.
 * (c) 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';
require_once dirname(__FILE__) . '/../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser(), null, array('doctrine' => 'sfTesterDoctrine'));
$browser->get('/attachment/index')->setField('attachment[file_path]', sfConfig::get('sf_config_dir') . '/databases.yml')->click('submit')->with('response')->begin()->checkElement('h1:contains("ok")')->end()->with('doctrine')->check('Attachment', array('file_path' => AttachmentForm::TEST_GENERATED_FILENAME), 1);
$browser->test()->is(file_exists(sfConfig::get('sf_cache_dir') . '/' . AttachmentForm::TEST_GENERATED_FILENAME), true, 'uploaded file is named correctly');
$browser->get('/attachment/editable?id=1')->setField('attachment[file_path_delete]', 1)->click('submit')->with('response')->begin()->checkElement('h1', 'ok')->end()->with('doctrine')->check('Attachment', array('file_path' => AttachmentForm::TEST_GENERATED_FILENAME), false);
$browser->test()->is(file_exists(sfConfig::get('sf_cache_dir') . '/' . AttachmentForm::TEST_GENERATED_FILENAME), false, 'uploaded file is removed');
开发者ID:seven07ve,项目名称:vendorepuestos,代码行数:16,代码来源:UploadTest.php

示例7: dirname

<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
/**
 * This is an example class of sfTestFunctional
 * It may require some attention to work with the default values (line 40).
 */
$browser = new sfBrowser();
$test_browser = new sfTestFunctional($browser);
$test_browser->setTester('json.response', 'sfTesterJsonResponse');
$test_browser->get('/subredditdeadline')->with('request')->begin()->isParameter('module', 'subredditdeadline')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->end()->with('json.response')->begin()->isJson()->end();
/**
 * Test the creation
 */
$entity = new Deadline();
$entity_array = $entity->exportTo('array');
$identifier = $entity->getTable()->getIdentifier();
/**
 * Please build a valid $entity_array here
 */
unset($entity_array[$identifier]);
//$entity_array['name'] = "pony";
//$entity_array['created_at'] = date('Y-m-d H:i:s');
//$entity_array['updated_at'] = date('Y-m-d H:i:s');
$test_browser->call('/subredditdeadline', 'post', array('content' => json_encode($entity_array)))->with('request')->begin()->isParameter('module', 'subredditdeadline')->isParameter('action', 'create')->end()->with('response')->begin()->isStatusCode(200)->end();
/**
 * If the new entity has been created
 */
$location = $browser->getResponse()->getHttpHeader('Location');
if ($location) {
    // Get ?
开发者ID:nocoolnametom,项目名称:OpenMicNight,代码行数:31,代码来源:subredditdeadlineActionsTest.php

示例8: dirname

/*
 * This file is part of the symfony package.
 * (c) 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';
require_once dirname(__FILE__).'/../bootstrap/functional.php';

$browser = new sfTestFunctional(new sfBrowser(), null, array(
  'doctrine' => 'sfTesterDoctrine',
));

$browser
  ->get('/attachment/index')

  ->setField('attachment[file_path]', sfConfig::get('sf_config_dir').'/databases.yml')
  ->click('submit')

  ->with('response')->begin()
    ->checkElement('h1:contains("ok")')
  ->end()

  ->with('doctrine')->check('Attachment', array(
    'file_path' => AttachmentForm::TEST_GENERATED_FILENAME,
  ), 1)
;

$browser->test()->is(file_exists(sfConfig::get('sf_cache_dir').'/'.AttachmentForm::TEST_GENERATED_FILENAME), true, 'uploaded file is named correctly');
开发者ID:nationalfield,项目名称:symfony,代码行数:31,代码来源:UploadTest.php


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