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_DbConn_Test.php

    r21480 r21481  
    8181    function testGetAll() { 
    8282        $this->createTestTable(); 
    83         $result = $this->setTestData(1, "2", "f"); 
    84  
    85         $this->expected =  array(array("id" => "1", 
    86                                        "column1" => "1", 
    87                                        "column2" => "2", 
    88                                        "column3" => "f")); 
     83        $result = $this->setTestData(1, '2', 'f'); 
     84 
     85        $this->expected =  array(array('id' => '1', 
     86                                       'column1' => '1', 
     87                                       'column2' => '2', 
     88                                       'column3' => 'f')); 
    8989        $this->actual = $this->objDbConn->getAll("SELECT * FROM test_table WHERE id = ?", array(1)); 
    9090 
    … …  
    113113    function testGetOne() { 
    114114        $this->createTestTable(); 
    115         $this->setTestData(1, "2", "f"); 
    116         $this->setTestData(1, "2", "f"); 
    117         $this->setTestData(1, "2", "f"); 
     115        $this->setTestData(1, '2', 'f'); 
     116        $this->setTestData(1, '2', 'f'); 
     117        $this->setTestData(1, '2', 'f'); 
    118118 
    119119        $this->expected = 3; 
    … …  
    129129    function testGetOneIsError() { 
    130130        $this->createTestTable(); 
    131         $this->setTestData(1, "2", "f"); 
    132         $this->setTestData(1, "2", "f"); 
    133         $this->setTestData(1, "2", "f"); 
     131        $this->setTestData(1, '2', 'f'); 
     132        $this->setTestData(1, '2', 'f'); 
     133        $this->setTestData(1, '2', 'f'); 
    134134 
    135135        //$this->expected = new PEAR_Error(); 
    … …  
    145145    function testGetRow() { 
    146146        $this->createTestTable(); 
    147         $this->setTestData(1, "1", "f"); 
    148         $this->setTestData(2, "2", "f"); 
    149         $this->setTestData(3, "3", "f"); 
    150  
    151         $this->expected = array("column1" => 1, "column2" => 1); 
     147        $this->setTestData(1, '1', 'f'); 
     148        $this->setTestData(2, '2', 'f'); 
     149        $this->setTestData(3, '3', 'f'); 
     150 
     151        $this->expected = array('column1' => 1, 'column2' => 1); 
    152152        $this->actual = $this->objDbConn->getRow("SELECT column1, column2 FROM test_table WHERE id = ?", array(1)); 
    153153        $this->verify(); 
    … …  
    159159    function testGetCol() { 
    160160        $this->createTestTable(); 
    161         $this->setTestData(1, "1", "f"); 
    162         $this->setTestData(2, "2", "f"); 
    163         $this->setTestData(3, "3", "f"); 
     161        $this->setTestData(1, '1', 'f'); 
     162        $this->setTestData(2, '2', 'f'); 
     163        $this->setTestData(3, '3', 'f'); 
    164164 
    165165        $this->expected = array(1, 2); 
    166         $this->actual = $this->objDbConn->getCol("SELECT column1, column2 FROM test_table WHERE id < ?", "column1", array(3)); 
     166        $this->actual = $this->objDbConn->getCol("SELECT column1, column2 FROM test_table WHERE id < ?", 'column1', array(3)); 
    167167 
    168168        $this->verify(); 
    … …  
    176176    function testAutoExecuteOfInsert() { 
    177177        $this->createTestTable(); 
    178         $result = $this->setTestData(1, "2", "f"); 
    179  
    180         $this->expected =  array(array("id" => "1", 
    181                                        "column1" => "1", 
    182                                        "column2" => "2", 
    183                                        "column3" => "f")); 
     178        $result = $this->setTestData(1, '2', 'f'); 
     179 
     180        $this->expected =  array(array('id' => '1', 
     181                                       'column1' => '1', 
     182                                       'column2' => '2', 
     183                                       'column3' => 'f')); 
    184184        $this->actual = $this->objDbConn->getAll("SELECT * FROM test_table"); 
    185185 
    … …  
    194194    function testAutoExecuteOfUpdate() { 
    195195        $this->createTestTable(); 
    196         $this->setTestData(1, "2", "f"); 
    197  
    198         $data = array("id" => "1", 
    199                       "column1" => "2", 
    200                       "column2" => "3", 
    201                       "column3" => "t"); 
    202  
    203         $result = $this->objDbConn->autoExecute("test_table", $data, "id = 1"); 
     196        $this->setTestData(1, '2', 'f'); 
     197 
     198        $data = array('id' => '1', 
     199                      'column1' => '2', 
     200                      'column2' => '3', 
     201                      'column3' => 't'); 
     202 
     203        $result = $this->objDbConn->autoExecute('test_table', $data, "id = 1"); 
    204204 
    205205        $this->expected =  array($data); 
    … …  
    217217        $this->createTestTable(); 
    218218        $sql = "INSERT INTO test_table VALUES (?, ?, ?, ?)"; 
    219         $data = array("1", "1", "1", "f"); 
     219        $data = array('1', '1', '1', 'f'); 
    220220 
    221221        $this->objDbConn->query($sql, $data); 
    222222 
    223         $this->expected =  array(array("id" => "1", 
    224                                        "column1" => "1", 
    225                                        "column2" => "1", 
    226                                        "column3" => "f")); 
     223        $this->expected =  array(array('id' => '1', 
     224                                       'column1' => '1', 
     225                                       'column2' => '1', 
     226                                       'column3' => 'f')); 
    227227 
    228228        $this->actual = $this->objDbConn->getAll("SELECT * FROM test_table"); 
    … …  
    236236    function testQuery2() { 
    237237        $this->createTestTable(); 
    238         $this->setTestData(1, "2", "f"); 
     238        $this->setTestData(1, '2', 'f'); 
    239239 
    240240        $sql = "UPDATE test_table SET column1 = ?, column2 = ? WHERE id = ?"; 
    241         $data = array("2", "2", "1"); 
     241        $data = array('2', '2', '1'); 
    242242 
    243243        $this->objDbConn->query($sql, $data); 
    244244 
    245         $this->expected =  array(array("id" => "1", 
    246                                        "column1" => "2", 
    247                                        "column2" => "2", 
    248                                        "column3" => "f")); 
     245        $this->expected =  array(array('id' => '1', 
     246                                       'column1' => '2', 
     247                                       'column2' => '2', 
     248                                       'column3' => 'f')); 
    249249 
    250250        $this->actual = $this->objDbConn->getAll("SELECT * FROM test_table"); 
Note: See TracChangeset for help on using the changeset viewer.