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;
 }
<?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()
;
<?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();
示例#4
0
<?php

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

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

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

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

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
示例#5
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/role_principal/index')->with('request')->begin()->isParameter('module', 'role_principal')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
示例#6
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/##MODULE_NAME##/index')->with('request')->begin()->isParameter('module', '##MODULE_NAME##')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?php

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

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

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

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

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/leerlijn_sleutelinzicht/index')->with('request')->begin()->isParameter('module', 'leerlijn_sleutelinzicht')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
示例#9
0
<?php

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

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

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

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

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
<?php

/*
 * Kimkëlen - School Management Software
 * Copyright (C) 2013 CeSPI - UNLP <*****@*****.**>
 *
 * 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();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/especialextemporanea/index')->with('request')->begin()->isParameter('module', 'especialextemporanea')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/adultoshumanisticaeliminar/index')->with('request')->begin()->isParameter('module', 'adultoshumanisticaeliminar')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?php

/*
 * Kimkëlen - School Management Software
 * Copyright (C) 2013 CeSPI - UNLP <*****@*****.**>
 *
 * 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('/final_examination_subject/index')->with('request')->begin()->isParameter('module', 'final_examination_subject')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/bib_classe_archi/index')->with('request')->begin()->isParameter('module', 'bib_classe_archi')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?php

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

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

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

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

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/infojob_signalement_type/index')->with('request')->begin()->isParameter('module', 'infojob_signalement_type')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/electcrical_transformers/index')->with('request')->begin()->isParameter('module', 'electrical_transformers')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?php

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

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

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

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

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
示例#19
0
<?php

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

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

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

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

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
示例#20
0
<?php

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

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

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

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

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
<?php

/*
 * Kimkëlen - School Management Software
 * Copyright (C) 2013 CeSPI - UNLP <*****@*****.**>
 *
 * 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('/student_career_school_year_conduct/index')->with('request')->begin()->isParameter('module', 'student_career_school_year_conduct')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?php

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

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

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

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

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
示例#23
0
<?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();
示例#24
0
<?php

/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <*****@*****.**>
 * 
 * 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');
示例#25
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/ticketsGroups/index')->with('request')->begin()->isParameter('module', 'ticketsGroups')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?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 ?
示例#27
0
/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <*****@*****.**>
 *
 * 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');
示例#28
0
<?php

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

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

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

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

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/shipping_transaction/index')->with('request')->begin()->isParameter('module', 'shipping_transaction')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new sfTestFunctional(new sfBrowser());
$browser->get('/subjectpriorityhistory/index')->with('request')->begin()->isParameter('module', 'subjectpriorityhistory')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();