Changeset 18390


Ignore:
Timestamp:
2009/11/20 18:21:15 (14 years ago)
Author:
nanasess
Message:

ADOdb ライブラリと, SC_DbConn クラスのパッチを追加(#564)

Location:
branches/comu-ver2
Files:
212 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/test/class/SC_DbConn_Test.php

    r18387 r18390  
    9494 
    9595    /** 
     96     * SC_DbConn::getAll() のテストケース(エラー). 
     97     */ 
     98    function testGetAllIsError() { 
     99 
     100        // SC_DbConn::getAll() は接続エラーが発生すると 0 を返す 
     101        $failur_dsn = "pgsql://user:pass@127.0.0.1:/xxxxx"; 
     102        $failurDbConn = new SC_DbConn($failur_dsn, false, true); 
     103        $this->expected = 0; 
     104        $this->actual = $failurDbConn->getAll("SELECT * FROM test_table"); 
     105 
     106        $this->verify(); 
     107    } 
     108 
     109 
     110    /** 
    96111     * SC_DbConn::getOne() のテストケース. 
    97112     */ 
     
    107122        $this->verify(); 
    108123    } 
     124 
     125    /** 
     126     * SC_DbConn::getOne() のテストケース(エラー). 
     127     */ 
     128    function testGetOneIsError() { 
     129        $this->createTestTable(); 
     130        $this->setTestData(1, "2", "f"); 
     131        $this->setTestData(1, "2", "f"); 
     132        $this->setTestData(1, "2", "f"); 
     133 
     134        //$this->expected = new PEAR_Error(); 
     135        $this->actual = $this->objDbConn->getOne("SELECT COUNT(*) FROM xxx_table"); 
     136        var_dump($this->actual); 
     137        $this->verify(); 
     138    } 
     139 
    109140 
    110141    /** 
     
    152183        $this->actual = $this->objDbConn->getAll("SELECT * FROM test_table"); 
    153184 
    154         $this->assertEquals(1, $result); 
     185        //$this->assertEquals(1, $result); 
    155186        $this->verify(); 
    156187    } 
Note: See TracChangeset for help on using the changeset viewer.