ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 10889


Ignore:
Timestamp:
Feb 26, 2009, 10:38:09 PM (11 years ago)
Author:
ebihara
Message:

#3648:chenged the designActions functional test for my refactoring

Location:
OpenPNE3/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_backend/modules/design/templates/gadgetSuccess.php

    r10800 r10889  
    3636<?php endforeach; ?>
    3737<?php endif; ?>
     38<?php endforeach; ?>
    3839<?php echo $sortForm->renderHiddenFields(); ?>
    3940<?php echo $addForm->renderHiddenFields(); ?>
    40 <?php endforeach; ?>
    4141<input type="submit" value="<?php echo __('設定変更') ?>" />
    4242</form>
  • OpenPNE3/trunk/test/bootstrap/functional.php

    r10608 r10889  
    2323sfContext::createInstance($configuration);
    2424
    25 $loader = new sfPropelData();
    26 $loader->setDeleteCurrentData(true);
    27 $loader->loadData(dirname(__FILE__).'/../fixtures');
     25if (!isset($executeLoader) || $executeLoader)
     26{
     27  $loader = new sfPropelData();
     28  $loader->setDeleteCurrentData(true);
     29  $loader->loadData(dirname(__FILE__).'/../fixtures');
     30}
    2831
    2932// remove all cache
  • OpenPNE3/trunk/test/functional/pc_backend/designActionsTest.php

    r9499 r10889  
    11<?php
    22
     3$executeLoader = false;
     4include(dirname(__FILE__).'/../../bootstrap/database.php');
    35include(dirname(__FILE__).'/../../bootstrap/functional.php');
    46
    5 $browser = new sfTestFunctional(new sfBrowser());
     7$browser = new sfTestFunctional(new sfBrowser(), new lime_test(null, new lime_output_color()));
     8$params = array('admin_user' => array(
     9));
     10$browser->setTester('propel', 'sfTesterPropel');
     11$browser
     12  ->info('0. Login')
     13  ->get('/default/login')
     14  ->click('ログイン', array('admin_user' => array(
     15    'username' => 'admin',
     16    'password' => 'password',
     17  )))
     18  ->isStatusCode(302)
    619
    7 $browser->
    8   get('/design/index')->
     20//---
     21  ->info('1. You can add and sort home gadget')
     22  ->get('/design/gadget/type/home')
     23  ->info('Add gadgets to all areas')
     24  ->click('設定変更', array('new' => array(
     25    'top' => array('memberImageBox'),
     26    'sideMenu' => array('memberImageBox'),
     27    'contents' => array('memberImageBox'),
     28    'bottom' => array('memberImageBox'),
     29  )))
     30  ->with('propel')->begin()
     31    ->check('Gadget', array('type' => 'top'), 3)
     32    ->check('Gadget', array('type' => 'sideMenu'), 4)
     33    ->check('Gadget', array('type' => 'contents'), 1)
     34    ->check('Gadget', array('type' => 'bottom'), 1)
     35  ->end()
     36  ->get('/design/gadget/type/home')
     37  ->info('Sort some gadgets')
     38  ->click('設定変更', array('gadget' => array(
     39    'top' => array(8, 2, 1),
     40    'sideMenu' => array(9, 4, 5, 3),
     41  )))
     42  ->with('propel')->begin()
     43    ->check('Gadget', array('id' => '8', 'sort_order' => 10), true)
     44    ->check('Gadget', array('id' => '2', 'sort_order' => 20), true)
     45    ->check('Gadget', array('id' => '1', 'sort_order' => 30), true)
     46    ->check('Gadget', array('id' => '9', 'sort_order' => 10), true)
     47    ->check('Gadget', array('id' => '4', 'sort_order' => 20), true)
     48    ->check('Gadget', array('id' => '5', 'sort_order' => 30), true)
     49    ->check('Gadget', array('id' => '3', 'sort_order' => 40), true)
     50  ->end()
    951
    10   with('request')->begin()->
    11     isParameter('module', 'design')->
    12     isParameter('action', 'index')->
    13   end()->
     52//---
     53  ->info('2. You can add login gadget')
     54  ->get('/design/gadget/type/login')
     55  ->info('Add gadgets to all areas')
     56  ->click('設定変更', array('new' => array(
     57    'loginTop' => array('loginForm'),
     58    'loginSideMenu' => array('loginForm'),
     59    'loginContents' => array('loginForm'),
     60    'loginBottom' => array('loginForm'),
     61  )))
     62  ->with('propel')->begin()
     63    ->check('Gadget', array('type' => 'loginTop'), 1)
     64    ->check('Gadget', array('type' => 'loginSideMenu'), 1)
     65    ->check('Gadget', array('type' => 'loginContents'), 1)
     66    ->check('Gadget', array('type' => 'loginBottom'), 1)
     67  ->end()
    1468
    15   with('response')->begin()->
    16     isStatusCode(200)->
    17     checkElement('body', '!/This is a temporary page/')->
    18   end()
     69//---
     70  ->info('3. You can add and sort side banner gadget')
     71  ->get('/design/gadget/type/sideBanner')
     72  ->info('Add gadgets to all areas')
     73  ->click('設定変更', array('new' => array(
     74    'sideBannerContents' => array('languageSelecterBox'),
     75  )))
     76  ->with('propel')->begin()
     77    ->check('Gadget', array('type' => 'sideBannerContents'), 2)
     78  ->end()
     79  ->get('/design/gadget/type/sideBanner')
     80  ->info('Sort some gadgets')
     81  ->click('設定変更', array('gadget' => array(
     82    'sideBannerContents' => array(16, 6),
     83  )))
     84  ->with('propel')->begin()
     85    ->check('Gadget', array('id' => '16', 'sort_order' => 10), true)
     86    ->check('Gadget', array('id' => '6', 'sort_order' => 20), true)
     87  ->end()
     88
     89//---
     90  ->info('4. You can add and sort mobile home gadget')
     91  ->get('/design/gadget/type/mobileHome')
     92  ->info('Add gadgets to all areas')
     93  ->click('設定変更', array('new' => array(
     94    'mobileTop' => array('informationBox'),
     95    'mobileContents' => array('informationBox'),
     96    'mobileBottom' => array('informationBox'),
     97  )))
     98  ->with('propel')->begin()
     99    ->check('Gadget', array('type' => 'mobileTop'), 2)
     100    ->check('Gadget', array('type' => 'mobileContents'), 1)
     101    ->check('Gadget', array('type' => 'mobileBottom'), 1)
     102  ->end()
     103  ->get('/design/gadget/type/mobileHome')
     104  ->info('Sort some gadgets')
     105  ->click('設定変更', array('gadget' => array(
     106    'mobileTop' => array(17, 7),
     107  )))
     108  ->with('propel')->begin()
     109    ->check('Gadget', array('id' => '17', 'sort_order' => 10), true)
     110    ->check('Gadget', array('id' => '7', 'sort_order' => 20), true)
     111  ->end()
     112
    19113;
Note: See TracChangeset for help on using the changeset viewer.