Changeset 13746
- Timestamp:
- Nov 10, 2010, 11:03:46 PM (12 years ago)
- Location:
- OpenPNE3/plugins/opCommunityTopicPlugin/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/plugins/opCommunityTopicPlugin/trunk/lib/acl/opCommunityTopicAclBuilder.class.php
r12431 r13746 15 15 * @subpackage acl 16 16 * @author Kousuke Ebihara <ebihara@tejimaya.com> 17 * @author Eitarow Fukamachi <e.arrows@gmail.com> 17 18 */ 18 19 class opCommunityTopicAclBuilder extends opAclBuilder … … 21 22 $collection = array(), 22 23 $resource = array(); 24 25 static public function clearCache() 26 { 27 self::$collection = array(); 28 self::$resource = array(); 29 } 23 30 24 31 static public function getAcl() -
OpenPNE3/plugins/opCommunityTopicPlugin/trunk/test/bootstrap/database.php
r12485 r13746 9 9 */ 10 10 11 // guess current application 12 if (!isset($app)) 13 { 14 $traces = debug_backtrace(); 15 $caller = $traces[0]; 11 $_app = 'pc_frontend'; 12 $_env = 'test'; 16 13 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); 22 15 new sfDatabaseManager($configuration); 23 16 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 19 19 } 20 20 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 22 chdir(dirname(__FILE__).'/../../../..'); 23 24 require_once 'config/ProjectConfiguration.class.php'; 25 $configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', false); 23 26 sfContext::createInstance($configuration); 24 27 25 28 // remove all cache 26 29 sfToolkit::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 11 11 $_test_dir = realpath(dirname(__FILE__).'/..'); 12 12 13 require_once(dirname(__FILE__).'/../../../../config/ProjectConfiguration.class.php'); 13 // chdir to the symfony(OpenPNE) project directory 14 chdir(dirname(__FILE__).'/../../../..'); 15 16 require_once 'config/ProjectConfiguration.class.php'; 14 17 $configuration = new ProjectConfiguration(realpath($_test_dir.'/../../../')); 15 include ($configuration->getSymfonyLibDir().'/vendor/lime/lime.php');18 include $configuration->getSymfonyLibDir().'/vendor/lime/lime.php'; -
OpenPNE3/plugins/opCommunityTopicPlugin/trunk/test/fixtures/999_test_data.yml
r12485 r13746 127 127 Community: community_a 128 128 Member: member_1 129 position: "admin"130 129 community_member_i_1: 131 130 Community: community_i 132 131 Member: member_1 133 position: "admin"134 132 community_member_u_1: 135 133 Community: community_u 136 134 Member: member_1 137 position: "admin"138 135 community_member_e_1: 139 136 Community: community_e 140 137 Member: member_1 141 position: "admin"142 138 community_member_a_2: 143 139 Community: community_a … … 176 172 Community: community_e 177 173 Member: member_5 174 175 CommunityMemberPosition: 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" 178 199 179 200 CommunityTopic: -
OpenPNE3/plugins/opCommunityTopicPlugin/trunk/test/functional/pc_frontend/communityTopicActionsTest.php
r12434 r13746 1 1 <?php 2 3 ini_set('memory_limit', '256M');4 2 5 3 function init() … … 8 6 include(dirname(__FILE__).'/../../bootstrap/database.php'); 9 7 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(); 10 17 } 11 18 … … 23 30 24 31 include(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())); 26 34 27 35 // create a test user: Mr_OpenPNE (community admin) … … 123 131 ->end() 124 132 ->info('6a. Mr. OpenPNE can delete the community topic comment') 125 ->click('削除 ')133 ->click('削除する') 126 134 ->isStatusCode(302) 127 135 ->with('request')->begin() … … 137 145 ->end() 138 146 ->info('7a. Mr. OpenPNE can delete the community topic') 139 ->click('削除 ')147 ->click('削除する') 140 148 ->isStatusCode(302) 141 149 ->with('request')->begin() … … 238 246 ->end() 239 247 ->info('6a. Mr. OpenPNE can delete the community topic comment') 240 ->click('削除 ')248 ->click('削除する') 241 249 ->isStatusCode(302) 242 250 ->with('request')->begin() … … 252 260 ->end() 253 261 ->info('7a. Mr. OpenPNE can delete the community topic') 254 ->click('削除 ')262 ->click('削除する') 255 263 ->isStatusCode(302) 256 264 ->with('request')->begin() … … 353 361 ->end() 354 362 ->info('6a. Mr. OpenPNE can delete the community topic comment') 355 ->click('削除 ')363 ->click('削除する') 356 364 ->isStatusCode(302) 357 365 ->with('request')->begin() … … 367 375 ->end() 368 376 ->info('7a. Mr. OpenPNE can delete the community topic') 369 ->click('削除 ')377 ->click('削除する') 370 378 ->isStatusCode(302) 371 379 ->with('request')->begin() … … 468 476 ->end() 469 477 ->info('6a. Mr. OpenPNE can delete the community topic comment') 470 ->click('削除 ')478 ->click('削除する') 471 479 ->isStatusCode(302) 472 480 ->with('request')->begin() … … 482 490 ->end() 483 491 ->info('7a. Mr. OpenPNE can delete the community topic') 484 ->click('削除 ')492 ->click('削除する') 485 493 ->isStatusCode(302) 486 494 ->with('request')->begin() … … 577 585 ->end() 578 586 ->info('6a. Tanaka can delete the community topic comment') 579 ->click('削除 ')587 ->click('削除する') 580 588 ->isStatusCode(302) 581 589 ->with('request')->begin() … … 591 599 ->end() 592 600 ->info('7a. Tanaka can delete the community topic') 593 ->click('削除 ')601 ->click('削除する') 594 602 ->isStatusCode(302) 595 603 ->with('request')->begin() … … 682 690 ->end() 683 691 ->info('6a. Tanaka can delete the community topic comment') 684 ->click('削除 ')692 ->click('削除する') 685 693 ->isStatusCode(302) 686 694 ->with('request')->begin() … … 696 704 ->end() 697 705 ->info('7a. Tanaka can delete the community topic') 698 ->click('削除 ')706 ->click('削除する') 699 707 ->isStatusCode(302) 700 708 ->with('request')->begin() … … 797 805 ->end() 798 806 ->info('6a. Tanaka can delete the community topic comment') 799 ->click('削除 ')807 ->click('削除する') 800 808 ->isStatusCode(302) 801 809 ->with('request')->begin() … … 811 819 ->end() 812 820 ->info('7a. Tanaka can delete the community topic') 813 ->click('削除 ')821 ->click('削除する') 814 822 ->isStatusCode(302) 815 823 ->with('request')->begin() … … 912 920 ->end() 913 921 ->info('6a. Tanaka can delete the community topic comment') 914 ->click('削除 ')922 ->click('削除する') 915 923 ->isStatusCode(302) 916 924 ->with('request')->begin() … … 926 934 ->end() 927 935 ->info('7a. Tanaka can delete the community topic') 928 ->click('削除 ')936 ->click('削除する') 929 937 ->isStatusCode(302) 930 938 ->with('request')->begin()
Note: See TracChangeset
for help on using the changeset viewer.