Ignore:
Timestamp:
2013/05/02 18:11:36 (14 years ago)
Author:
h_yoshimoto
Message:

#2236 2.12.3リリース以降の2.12-devへのコミット差し戻し

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/test/class/SC_Query_Test.php

    r22567 r22796  
    3333 * @version $Id$ 
    3434 */ 
    35 class SC_Query_Test extends PHPUnit_Framework_TestCase  
    36 { 
     35class SC_Query_Test extends PHPUnit_Framework_TestCase { 
    3736 
    3837    /** SC_Query インスタンス */ 
    … …  
    4241    var $actual; 
    4342 
    44     function setUp() 
    45     { 
     43    function setUp() { 
    4644        $this->objQuery = new SC_Query(); 
    4745        $this->objQuery->begin(); 
    4846    } 
    4947 
    50     function tearDown() 
    51     { 
     48    function tearDown() { 
    5249        // MySQL では CREATE TABLE がロールバックされないので DROP TABLE を行う 
    5350        $this->dropTestTable(); 
    … …  
    5653    } 
    5754 
    58     function verify() 
    59     { 
     55    function verify() { 
    6056        $this->assertEquals($this->expected, $this->actual); 
    6157    } 
    … …  
    6460     * インスタンスを取得するテストケース. 
    6561     */ 
    66     function testGetInstance() 
    67     { 
     62    function testGetInstance() { 
    6863        $this->expected = true; 
    6964        $this->actual = is_object($this->objQuery); 
    … …  
    7570     * SC_Query::query() を使用して, CREATE TABLE を実行するテストケース. 
    7671     */ 
    77     function testCreateTable() 
    78     { 
     72    function testCreateTable() { 
    7973        $result = $this->createTestTable(); 
    8074 
    … …  
    8882     * SC_Query::getAll() のテストケース. 
    8983     */ 
    90     function testGetAll() 
    91     { 
     84    function testGetAll() { 
    9285        $result = $this->createTestTable(); 
    9386        $result = $this->setTestData(1, '2', 'f'); 
    … …  
    10598     * SC_Query::select() のテストケース. 
    10699     */ 
    107     function testSelect() 
    108     { 
     100    function testSelect() { 
    109101        $this->createTestTable(); 
    110102        $result = $this->setTestData(1, '2', 'f'); 
    … …  
    126118     * SC_Query::getOne() のテストケース. 
    127119     */ 
    128     function testGetOne() 
    129     { 
     120    function testGetOne() { 
    130121        $this->createTestTable(); 
    131122        $this->setTestData(1, '2', 'f'); 
    … …  
    142133     * SC_Query::getRow() のテストケース. 
    143134     */ 
    144     function testGetRow() 
    145     { 
     135    function testGetRow() { 
    146136        $this->createTestTable(); 
    147137        $this->setTestData(1, '1', 'f'); 
    … …  
    157147     * SC_Query::getCol() のテストケース. 
    158148     */ 
    159     function testGetCol() 
    160     { 
     149    function testGetCol() { 
    161150        $this->createTestTable(); 
    162151        $this->setTestData(1, '1', 'f'); 
    … …  
    174163     * SC_Query::query() で INSERT を実行するテストケース. 
    175164     */ 
    176     function testQuery1() 
    177     { 
     165    function testQuery1() { 
    178166        $this->createTestTable(); 
    179167        $sql = "INSERT INTO test_table VALUES (?, ?, ?, ?)"; 
    … …  
    192180    } 
    193181 
    194     function testInsert() 
    195     { 
     182    function testInsert() { 
    196183        $this->createTestTable(); 
    197184 
    … …  
    215202     * SC_Query::query() で UPDATE を実行するテストケース. 
    216203     */ 
    217     function testQuery2() 
    218     { 
     204    function testQuery2() { 
    219205        $this->createTestTable(); 
    220206        $this->setTestData(1, '2', 'f'); 
    … …  
    235221    } 
    236222 
    237     function testUpdate() 
    238     { 
     223    function testUpdate() { 
    239224        $this->createTestTable(); 
    240225        $this->setTestData(1, '2', 'f'); 
    … …  
    256241    } 
    257242 
    258     function testListTables() 
    259     { 
     243    function testListTables() { 
    260244        $tables = $this->objQuery->listTables(); 
    261245        $this->assertTrue(in_array('mtb_zip', $tables)); 
    262246    } 
    263247 
    264     function testListSequences() 
    265     { 
     248    function testListSequences() { 
    266249        $sequences = $this->objQuery->listSequences(); 
    267250        $this->assertTrue(in_array('dtb_products_product_id', $sequences)); 
    268251    } 
    269252 
    270     function testListTableFields() 
    271     { 
     253    function testListTableFields() { 
    272254        $this->expected = array('id', 'name', 'rank', 'remarks'); 
    273255        $this->actual = $this->objQuery->listTableFields('mtb_constants'); 
    … …  
    275257    } 
    276258 
    277     function testListTableIndexes() 
    278     { 
     259    function testListTableIndexes() { 
    279260        $indexes = $this->objQuery->listTableIndexes('dtb_mobile_kara_mail'); 
    280261        $this->assertTrue(in_array('dtb_mobile_kara_mail_create_date_key', $indexes)); 
    281262    } 
    282263 
    283     function createTestTable() 
    284     { 
     264    function createTestTable() { 
    285265        $sql = "CREATE TABLE test_table (" 
    286266            . "id SERIAL PRIMARY KEY," 
    … …  
    292272    } 
    293273 
    294     function dropTestTable() 
    295     { 
     274    function dropTestTable() { 
    296275        $tables = $this->objQuery->listTables(); 
    297276        if (in_array('test_table', $tables)) { 
    … …  
    301280    } 
    302281 
    303     function setTestData($column1, $column2, $column3) 
    304     { 
     282    function setTestData($column1, $column2, $column3) { 
    305283        $fields_values = array($column1, $column2, $column3); 
    306284        $sql = "INSERT INTO test_table (column1, column2, column3) VALUES (?, ?, ?)"; 
Note: See TracChangeset for help on using the changeset viewer.