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

Changeset 7982


Ignore:
Timestamp:
Aug 13, 2008, 12:40:28 AM (14 years ago)
Author:
ogawa
Message:

#2911:ProfilePeerのテストを追加

Location:
OpenPNE3/trunk/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/test/bootstrap/database.php

    r7948 r7982  
    22
    33$app_configuration = ProjectConfiguration::getApplicationConfiguration('pc_frontend', 'test', true);
     4sfContext::createInstance($app_configuration);
    45$databaseManager = new sfDatabaseManager($app_configuration);
    56$databaseManager->loadConfiguration();
  • OpenPNE3/trunk/test/fixtures/test_data.yml

    r7980 r7982  
    2121    is_disp_regist: 1
    2222    is_disp_config: 1
    23     is_disp_search: 1
     23    is_disp_search: 0
    2424    sort_order: 110
    2525
     
    3939    form_type: "textarea"
    4040    value_type: "string"
    41     is_disp_regist: 1
    42     is_disp_config: 1
     41    is_disp_regist: 0
     42    is_disp_config: 0
    4343    is_disp_search: 1
    4444    sort_order: 130
  • OpenPNE3/trunk/test/unit/model/ProfilePeerTest.php

    r7947 r7982  
    99
    1010$t->diag('ProfilePeer::retrieveByIsDispRegist()');
     11$profiles = ProfilePeer::retrieveByIsDispRegist();
     12$t->isa_ok($profiles, 'array', 'retrieveByIsDispRegist() returns an array');
     13foreach ($profiles as $profile)
     14{
     15  $t->isa_ok($profile, 'Profile', 'each profile is a Profile');
     16  $t->cmp_ok($profile->getIsDispRegist(), '===', true, 'Profile::getIsDispRegist() returns true');
     17}
    1118
    1219//------------------------------------------------------------
    1320
    1421$t->diag('ProfilePeer::retrieveByIsDispConfig()');
     22$profiles = ProfilePeer::retrieveByIsDispConfig();
     23$t->isa_ok($profiles, 'array', 'retrieveByIsDispConfig() returns an array');
     24foreach ($profiles as $profile)
     25{
     26  $t->isa_ok($profile, 'Profile', 'each profile is a Profile');
     27  $t->cmp_ok($profile->getIsDispConfig(), '===', true, 'Profile::getIsDispConfig() returns true');
     28}
    1529
    1630//------------------------------------------------------------
    1731
    1832$t->diag('ProfilePeer::retrieveByIsDispSearch()');
     33$profiles = ProfilePeer::retrieveByIsDispSearch();
     34$t->isa_ok($profiles, 'array', 'retrieveByIsDispSearch() returns an array');
     35foreach ($profiles as $profile)
     36{
     37  $t->isa_ok($profile, 'Profile', 'each profile is a Profile');
     38  $t->cmp_ok($profile->getIsDispSearch(), '===', true, 'Profile::getIsDispSearch() returns true');
     39}
    1940
    2041//------------------------------------------------------------
    2142
    2243$t->diag('ProfilePeer::retrieveByName()');
     44$profile = ProfilePeer::retrieveByName('self_intro');
     45$t->isa_ok($profile, 'Profile', 'retrieveByName() returns a Profile');
     46$t->cmp_ok($profile->getName(), '===', 'self_intro', 'Profile::getName() returns a name');
     47
     48$t->cmp_ok(ProfilePeer::retrieveByName('unknown'), '===', NULL, 'retrieveByName() returns NULL if name does not exist');
Note: See TracChangeset for help on using the changeset viewer.