Changeset 22145


Ignore:
Timestamp:
2012/12/17 16:12:05 (11 years ago)
Author:
shift_hiroko.tamagawa
Message:

#1978 テスト用ユーティリティを追加

Location:
branches/version-2_12-dev/tests/class/test/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/tests/class/test/util/Test_Utils.php

    r22139 r22145  
    4949  } 
    5050 
     51  /** 
     52   * 配列の各要素(連想配列)から特定のキーだけを抜き出した配列を返します. 
     53   * 入力の連想配列には変更を加えません. 
     54   *  
     55   * @static 
     56   * @param input_array 入力の配列 
     57   * @param key 抽出対象のキー 
     58   * @return 指定のキーだけを抜き出した配列 
     59   */ 
     60  public static function mapCols($input_array, $key) { 
     61    $output_array = array(); 
     62    foreach ($input_array as $data) { 
     63      $output_array[] = $data[$key]; 
     64    } 
     65     
     66    return $output_array; 
     67  } 
    5168} 
    5269 
  • branches/version-2_12-dev/tests/class/test/util/User_Utils.php

    r22128 r22145  
    2929      return; 
    3030    } 
    31     if ($customer == null) { 
    32       $customer = self::getDefaultCustomer(); 
    33     } 
     31    $customer = array_merge(self::getDefaultCustomer(), $customer); 
    3432    $_SESSION['customer']['customer_id'] = $customer['customer_id']; 
    3533    $_SESSION['customer']['email'] = $customer['email']; 
Note: See TracChangeset for help on using the changeset viewer.