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

Changeset 13746


Ignore:
Timestamp:
Nov 10, 2010, 11:03:46 PM (12 years ago)
Author:
ebihara
Message:

[opCommunityTopicPlugin] fixed functional test that doesn't work with OpenPNE 3.6beta7-dev

Location:
OpenPNE3/plugins/opCommunityTopicPlugin/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/lib/acl/opCommunityTopicAclBuilder.class.php

    r12431 r13746  
    1515 * @subpackage acl
    1616 * @author     Kousuke Ebihara <ebihara@tejimaya.com>
     17 * @author     Eitarow Fukamachi <e.arrows@gmail.com>
    1718 */
    1819class opCommunityTopicAclBuilder extends opAclBuilder
     
    2122    $collection = array(),
    2223    $resource = array();
     24
     25  static public function clearCache()
     26  {
     27    self::$collection = array();
     28    self::$resource = array();
     29  }
    2330
    2431  static public function getAcl()
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/test/bootstrap/database.php

    r12485 r13746  
    99 */
    1010
    11 // guess current application
    12 if (!isset($app))
    13 {
    14   $traces = debug_backtrace();
    15   $caller = $traces[0];
     11$_app = 'pc_frontend';
     12$_env = 'test';
    1613
    17   $dirPieces = explode(DIRECTORY_SEPARATOR, dirname($caller['file']));
    18   $app = array_pop($dirPieces);
    19 }
    20 
    21 $configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', true);
     14$configuration = ProjectConfiguration::getApplicationConfiguration($_app, $_env, true);
    2215new sfDatabaseManager($configuration);
    2316
    24 $task = new sfDoctrineBuildAllReloadTask($configuration->getEventDispatcher(), new sfFormatter());
    25 $task->run(array('--no-confirmation', '--dir='.dirname(__FILE__).'/../fixtures', '--skip-forms'));
     17$task = new sfDoctrineBuildTask($configuration->getEventDispatcher(), new sfFormatter());
     18$task->setConfiguration($configuration);
     19$task->run(array(), array(
     20  'no-confirmation' => true,
     21  'db'              => true,
     22  'and-load'        => true,
     23  'application'     => $_app,
     24  'env'             => $_env,
     25));
     26
     27$task = new sfDoctrineDataLoadTask($configuration->getEventDispatcher(), new sfFormatter());
     28$task->setConfiguration($configuration);
     29$task->run(dirname(__FILE__).'/../fixtures');
     30
     31$conn = Doctrine_Manager::getInstance()->getCurrentConnection();
     32$conn->clear();
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/test/bootstrap/functional.php

    r12485 r13746  
    1919}
    2020
    21 require_once(dirname(__FILE__).'/../../../../config/ProjectConfiguration.class.php');
    22 $configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true);
     21// chdir to the symfony(OpenPNE) project directory
     22chdir(dirname(__FILE__).'/../../../..');
     23
     24require_once 'config/ProjectConfiguration.class.php';
     25$configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', false);
    2326sfContext::createInstance($configuration);
    2427
    2528// remove all cache
    2629sfToolkit::clearDirectory(sfConfig::get('sf_app_cache_dir'));
     30
     31$conn = Doctrine_Manager::getInstance()->getCurrentConnection();
     32$conn->clear();
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/test/bootstrap/unit.php

    r12428 r13746  
    1111$_test_dir = realpath(dirname(__FILE__).'/..');
    1212
    13 require_once(dirname(__FILE__).'/../../../../config/ProjectConfiguration.class.php');
     13// chdir to the symfony(OpenPNE) project directory
     14chdir(dirname(__FILE__).'/../../../..');
     15
     16require_once 'config/ProjectConfiguration.class.php';
    1417$configuration = new ProjectConfiguration(realpath($_test_dir.'/../../../'));
    15 include($configuration->getSymfonyLibDir().'/vendor/lime/lime.php');
     18include $configuration->getSymfonyLibDir().'/vendor/lime/lime.php';
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/test/fixtures/999_test_data.yml

    r12485 r13746  
    127127    Community: community_a
    128128    Member: member_1
    129     position: "admin"
    130129  community_member_i_1:
    131130    Community: community_i
    132131    Member: member_1
    133     position: "admin"
    134132  community_member_u_1:
    135133    Community: community_u
    136134    Member: member_1
    137     position: "admin"
    138135  community_member_e_1:
    139136    Community: community_e
    140137    Member: member_1
    141     position: "admin"
    142138  community_member_a_2:
    143139    Community: community_a
     
    176172    Community: community_e
    177173    Member: member_5
     174
     175CommunityMemberPosition:
     176  community_a_1_admin:
     177    Community: community_a
     178    Member: member_1
     179    CommunityMember: community_member_a_1
     180    name: "admin"
     181
     182  community_i_1_admin:
     183    Community: community_i
     184    Member: member_1
     185    CommunityMember: community_member_i_1
     186    name: "admin"
     187
     188  community_u_1_admin:
     189    Community: community_u
     190    Member: member_1
     191    CommunityMember: community_member_u_1
     192    name: "admin"
     193
     194  community_e_1_admin:
     195    Community: community_e
     196    Member: member_1
     197    CommunityMember: community_member_e_1
     198    name: "admin"
    178199
    179200CommunityTopic:
  • OpenPNE3/plugins/opCommunityTopicPlugin/trunk/test/functional/pc_frontend/communityTopicActionsTest.php

    r12434 r13746  
    11<?php
    2 
    3 ini_set('memory_limit', '256M');
    42
    53function init()
     
    86  include(dirname(__FILE__).'/../../bootstrap/database.php');
    97  include(dirname(__FILE__).'/../../bootstrap/functional.php');
     8
     9  $conn = Doctrine_Manager::getInstance()->getCurrentConnection();
     10  $listener = $conn->getListener();
     11  if ($listener['symfony_profiler'])
     12  {
     13    $listener['symfony_profiler']->setOption('logging', false);
     14  }
     15
     16  opCommunityTopicAclBuilder::clearCache();
    1017}
    1118
     
    2330
    2431include(dirname(__FILE__).'/../../bootstrap/functional.php');
    25 $user = new sfTestFunctional(new sfBrowser(), new lime_test(612, new lime_output_color()));
     32
     33$user = new opTestFunctional(new opBrowser(), new lime_test(612, new lime_output_color()));
    2634
    2735// create a test user: Mr_OpenPNE (community admin)
     
    123131  ->end()
    124132  ->info('6a. Mr. OpenPNE can delete the community topic comment')
    125   ->click('削除')
     133  ->click('削除する')
    126134  ->isStatusCode(302)
    127135  ->with('request')->begin()
     
    137145  ->end()
    138146  ->info('7a. Mr. OpenPNE can delete the community topic')
    139   ->click('削除')
     147  ->click('削除する')
    140148  ->isStatusCode(302)
    141149  ->with('request')->begin()
     
    238246  ->end()
    239247  ->info('6a. Mr. OpenPNE can delete the community topic comment')
    240   ->click('削除')
     248  ->click('削除する')
    241249  ->isStatusCode(302)
    242250  ->with('request')->begin()
     
    252260  ->end()
    253261  ->info('7a. Mr. OpenPNE can delete the community topic')
    254   ->click('削除')
     262  ->click('削除する')
    255263  ->isStatusCode(302)
    256264  ->with('request')->begin()
     
    353361  ->end()
    354362  ->info('6a. Mr. OpenPNE can delete the community topic comment')
    355   ->click('削除')
     363  ->click('削除する')
    356364  ->isStatusCode(302)
    357365  ->with('request')->begin()
     
    367375  ->end()
    368376  ->info('7a. Mr. OpenPNE can delete the community topic')
    369   ->click('削除')
     377  ->click('削除する')
    370378  ->isStatusCode(302)
    371379  ->with('request')->begin()
     
    468476  ->end()
    469477  ->info('6a. Mr. OpenPNE can delete the community topic comment')
    470   ->click('削除')
     478  ->click('削除する')
    471479  ->isStatusCode(302)
    472480  ->with('request')->begin()
     
    482490  ->end()
    483491  ->info('7a. Mr. OpenPNE can delete the community topic')
    484   ->click('削除')
     492  ->click('削除する')
    485493  ->isStatusCode(302)
    486494  ->with('request')->begin()
     
    577585  ->end()
    578586  ->info('6a. Tanaka can delete the community topic comment')
    579   ->click('削除')
     587  ->click('削除する')
    580588  ->isStatusCode(302)
    581589  ->with('request')->begin()
     
    591599  ->end()
    592600  ->info('7a. Tanaka can delete the community topic')
    593   ->click('削除')
     601  ->click('削除する')
    594602  ->isStatusCode(302)
    595603  ->with('request')->begin()
     
    682690  ->end()
    683691  ->info('6a. Tanaka can delete the community topic comment')
    684   ->click('削除')
     692  ->click('削除する')
    685693  ->isStatusCode(302)
    686694  ->with('request')->begin()
     
    696704  ->end()
    697705  ->info('7a. Tanaka can delete the community topic')
    698   ->click('削除')
     706  ->click('削除する')
    699707  ->isStatusCode(302)
    700708  ->with('request')->begin()
     
    797805  ->end()
    798806  ->info('6a. Tanaka can delete the community topic comment')
    799   ->click('削除')
     807  ->click('削除する')
    800808  ->isStatusCode(302)
    801809  ->with('request')->begin()
     
    811819  ->end()
    812820  ->info('7a. Tanaka can delete the community topic')
    813   ->click('削除')
     821  ->click('削除する')
    814822  ->isStatusCode(302)
    815823  ->with('request')->begin()
     
    912920  ->end()
    913921  ->info('6a. Tanaka can delete the community topic comment')
    914   ->click('削除')
     922  ->click('削除する')
    915923  ->isStatusCode(302)
    916924  ->with('request')->begin()
     
    926934  ->end()
    927935  ->info('7a. Tanaka can delete the community topic')
    928   ->click('削除')
     936  ->click('削除する')
    929937  ->isStatusCode(302)
    930938  ->with('request')->begin()
Note: See TracChangeset for help on using the changeset viewer.