Ignore:
Timestamp:
2010/09/09 18:05:15 (14 years ago)
Author:
nanasess
bzr:base-revision:
ohkouchi@loop-az.jp-20100909013100-rwua4q4xm052kab2
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/class/SC_Query.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2FSC_Query.php
test/class/SC_Query_Test.php sc_query_test.php-20100803024127-ljzonih8f5jpan9o-1
bzr:mapping-version:
v4
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20100909090512-qyyhgu9bnz0iwjna
bzr:revno:
2284
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:timestamp:
2010-09-09 18:05:12.825000048 +0900
bzr:user-agent:
bzr2.2.0+bzr-svn1.0.3
svn:original-date:
2010-09-09T09:05:12.825000Z
Message:

SC_Query::getSql() の WHERE が動作していなかったため修正(#565)

File:
1 edited

Legend:

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

    r18790 r18801  
    4747 
    4848    function tearDown() { 
    49         $this->objQuery->rollback(); 
    5049        // MySQL では CREATE TABLE がロールバックされないので DROP TABLE を行う 
    5150        $this->dropTestTable(); 
     51        $this->objQuery->rollback(); 
    5252        $this->objQuery = null; 
    5353    } 
     
    8383     */ 
    8484    function testGetAll() { 
    85         $this->createTestTable(); 
     85        $result = $this->createTestTable(); 
    8686        $result = $this->setTestData(1, "2", "f"); 
    8787 
     
    9494        $this->verify(); 
    9595    } 
     96 
     97    /** 
     98     * SC_Query::select() のテストケース. 
     99     */ 
     100    function testSelect() { 
     101        $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")); 
     108 
     109        $this->actual = $this->objQuery->setWhere("id = ?") 
     110                                       ->setOrder("id") 
     111                                       ->select("*", "test_table", "", array(1)); 
     112 
     113        $this->verify(); 
     114    } 
     115 
    96116 
    97117    /** 
     
    253273 
    254274    function dropTestTable() { 
    255         return $this->objQuery->query("DROP TABLE test_table"); 
     275        $tables = $this->objQuery->listTables(); 
     276        if (in_array("test_table", $tables)) { 
     277            $this->objQuery->query("DROP TABLE test_table"); 
     278        } 
     279        return; 
    256280    } 
    257281 
Note: See TracChangeset for help on using the changeset viewer.