Ignore:
Timestamp:
2012/02/11 05:48:00 (15 years ago)
Author:
Seasoft
Message:

#1613 (ソース整形・ソースコメントの改善)

  • Zend Framework PHP 標準コーディング規約への準拠を高めた
File:
1 edited

Legend:

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

    r20764 r21481  
    8484    function testGetAll() { 
    8585        $result = $this->createTestTable(); 
    86         $result = $this->setTestData(1, "2", "f"); 
    87  
    88         $this->expected =  array(array("id" => "1", 
    89                                        "column1" => "1", 
    90                                        "column2" => "2", 
    91                                        "column3" => "f")); 
     86        $result = $this->setTestData(1, '2', 'f'); 
     87 
     88        $this->expected =  array(array('id' => '1', 
     89                                       'column1' => '1', 
     90                                       'column2' => '2', 
     91                                       'column3' => 'f')); 
    9292        $this->actual = $this->objQuery->getAll("SELECT * FROM test_table WHERE id = ?", array(1)); 
    9393 
     
    100100    function testSelect() { 
    101101        $this->createTestTable(); 
    102         $result = $this->setTestData(1, "2", "f"); 
    103  
    104         $this->expected =  array(array("id" => "1", 
    105                                        "column1" => "1", 
    106                                        "column2" => "2", 
    107                                        "column3" => "f")); 
     102        $result = $this->setTestData(1, '2', 'f'); 
     103 
     104        $this->expected =  array(array('id' => '1', 
     105                                       'column1' => '1', 
     106                                       'column2' => '2', 
     107                                       'column3' => 'f')); 
    108108 
    109109        $this->actual = $this->objQuery->setWhere("id = ?") 
    110                                        ->setOrder("id") 
    111                                        ->select("*", "test_table", "", array(1)); 
     110                                       ->setOrder('id') 
     111                                       ->select("*", 'test_table', "", array(1)); 
    112112 
    113113        $this->verify(); 
     
    120120    function testGetOne() { 
    121121        $this->createTestTable(); 
    122         $this->setTestData(1, "2", "f"); 
    123         $this->setTestData(1, "2", "f"); 
    124         $this->setTestData(1, "2", "f"); 
     122        $this->setTestData(1, '2', 'f'); 
     123        $this->setTestData(1, '2', 'f'); 
     124        $this->setTestData(1, '2', 'f'); 
    125125 
    126126        $this->expected = 3; 
     
    135135    function testGetRow() { 
    136136        $this->createTestTable(); 
    137         $this->setTestData(1, "1", "f"); 
    138         $this->setTestData(2, "2", "f"); 
    139         $this->setTestData(3, "3", "f"); 
    140  
    141         $this->expected = array("column1" => 1, "column2" => 1); 
    142         $this->actual = $this->objQuery->getRow("column1, column2", "test_table", "id = ?", array(1)); 
     137        $this->setTestData(1, '1', 'f'); 
     138        $this->setTestData(2, '2', 'f'); 
     139        $this->setTestData(3, '3', 'f'); 
     140 
     141        $this->expected = array('column1' => 1, 'column2' => 1); 
     142        $this->actual = $this->objQuery->getRow("column1, column2", 'test_table', "id = ?", array(1)); 
    143143        $this->verify(); 
    144144    } 
     
    149149    function testGetCol() { 
    150150        $this->createTestTable(); 
    151         $this->setTestData(1, "1", "f"); 
    152         $this->setTestData(2, "2", "f"); 
    153         $this->setTestData(3, "3", "f"); 
     151        $this->setTestData(1, '1', 'f'); 
     152        $this->setTestData(2, '2', 'f'); 
     153        $this->setTestData(3, '3', 'f'); 
    154154 
    155155        $this->expected = array(1, 2); 
    156         $this->actual = $this->objQuery->getCol("column1", "test_table", "id < ?",  array(3)); 
     156        $this->actual = $this->objQuery->getCol('column1', 'test_table', "id < ?",  array(3)); 
    157157 
    158158        $this->verify(); 
     
    166166        $this->createTestTable(); 
    167167        $sql = "INSERT INTO test_table VALUES (?, ?, ?, ?)"; 
    168         $data = array("1", "1", "1", "f"); 
     168        $data = array('1', '1', '1', 'f'); 
    169169 
    170170        $this->objQuery->query($sql, $data); 
    171171 
    172         $this->expected =  array(array("id" => "1", 
    173                                        "column1" => "1", 
    174                                        "column2" => "1", 
    175                                        "column3" => "f")); 
     172        $this->expected =  array(array('id' => '1', 
     173                                       'column1' => '1', 
     174                                       'column2' => '1', 
     175                                       'column3' => 'f')); 
    176176 
    177177        $this->actual = $this->objQuery->getAll("SELECT * FROM test_table"); 
     
    183183        $this->createTestTable(); 
    184184 
    185         $this->objQuery->insert("test_table", 
    186                                 array("id" => "1", 
    187                                       "column1" => "1", 
    188                                       "column2" => "1", 
    189                                       "column3" => "f")); 
    190  
    191         $this->expected =  array(array("id" => "1", 
    192                                        "column1" => "1", 
    193                                        "column2" => "1", 
    194                                        "column3" => "f")); 
     185        $this->objQuery->insert('test_table', 
     186                                array('id' => '1', 
     187                                      'column1' => '1', 
     188                                      'column2' => '1', 
     189                                      'column3' => 'f')); 
     190 
     191        $this->expected =  array(array('id' => '1', 
     192                                       'column1' => '1', 
     193                                       'column2' => '1', 
     194                                       'column3' => 'f')); 
    195195 
    196196        $this->actual = $this->objQuery->getAll("SELECT * FROM test_table"); 
     
    204204    function testQuery2() { 
    205205        $this->createTestTable(); 
    206         $this->setTestData(1, "2", "f"); 
     206        $this->setTestData(1, '2', 'f'); 
    207207 
    208208        $sql = "UPDATE test_table SET column1 = ?, column2 = ? WHERE id = ?"; 
    209         $data = array("2", "2", "1"); 
     209        $data = array('2', '2', '1'); 
    210210 
    211211        $this->objQuery->query($sql, $data); 
    212212 
    213         $this->expected =  array(array("id" => "1", 
    214                                        "column1" => "2", 
    215                                        "column2" => "2", 
    216                                        "column3" => "f")); 
     213        $this->expected =  array(array('id' => '1', 
     214                                       'column1' => '2', 
     215                                       'column2' => '2', 
     216                                       'column3' => 'f')); 
    217217 
    218218        $this->actual = $this->objQuery->getAll("SELECT * FROM test_table"); 
     
    223223    function testUpdate() { 
    224224        $this->createTestTable(); 
    225         $this->setTestData(1, "2", "f"); 
    226  
    227         $this->objQuery->update("test_table", 
    228                                 array("id" => "1", 
    229                                       "column1" => "2", 
    230                                       "column2" => "2", 
    231                                       "column3" => "f"), 
     225        $this->setTestData(1, '2', 'f'); 
     226 
     227        $this->objQuery->update('test_table', 
     228                                array('id' => '1', 
     229                                      'column1' => '2', 
     230                                      'column2' => '2', 
     231                                      'column3' => 'f'), 
    232232                                "id = ?", array(1)); 
    233         $this->expected =  array(array("id" => "1", 
    234                                        "column1" => "2", 
    235                                        "column2" => "2", 
    236                                        "column3" => "f")); 
     233        $this->expected =  array(array('id' => '1', 
     234                                       'column1' => '2', 
     235                                       'column2' => '2', 
     236                                       'column3' => 'f')); 
    237237 
    238238        $this->actual = $this->objQuery->getAll("SELECT * FROM test_table"); 
     
    243243    function testListTables() { 
    244244        $tables = $this->objQuery->listTables(); 
    245         $this->assertTrue(in_array("mtb_zip", $tables)); 
     245        $this->assertTrue(in_array('mtb_zip', $tables)); 
    246246    } 
    247247 
    248248    function testListSequences() { 
    249249        $sequences = $this->objQuery->listSequences(); 
    250         $this->assertTrue(in_array("dtb_products_product_id", $sequences)); 
     250        $this->assertTrue(in_array('dtb_products_product_id', $sequences)); 
    251251    } 
    252252 
    253253    function testListTableFields() { 
    254         $this->expected = array("id", "name", "rank", "remarks"); 
    255         $this->actual = $this->objQuery->listTableFields("mtb_constants"); 
     254        $this->expected = array('id', 'name', 'rank', 'remarks'); 
     255        $this->actual = $this->objQuery->listTableFields('mtb_constants'); 
    256256        $this->verify(); 
    257257    } 
    258258 
    259259    function testListTableIndexes() { 
    260         $indexes = $this->objQuery->listTableIndexes("dtb_mobile_kara_mail"); 
    261         $this->assertTrue(in_array("dtb_mobile_kara_mail_create_date_key", $indexes)); 
     260        $indexes = $this->objQuery->listTableIndexes('dtb_mobile_kara_mail'); 
     261        $this->assertTrue(in_array('dtb_mobile_kara_mail_create_date_key', $indexes)); 
    262262    } 
    263263 
     
    274274    function dropTestTable() { 
    275275        $tables = $this->objQuery->listTables(); 
    276         if (in_array("test_table", $tables)) { 
     276        if (in_array('test_table', $tables)) { 
    277277            $this->objQuery->query("DROP TABLE test_table"); 
    278278        } 
Note: See TracChangeset for help on using the changeset viewer.