Changeset 1648

Show
Ignore:
Timestamp:
02/26/10 17:50:35 (5 months ago)
Author:
klemens
Message:

Fixed ullQueryTest

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/ullCorePlugin/ullQueryTest.php

    r1647 r1648  
    1717  $q = new ullQuery('TestTable'); 
    1818 
    19    
    20 $t->begin('__construct() with INDEXBY | Also tests limit()'); 
    21   $q = new ullQuery('UllUserStatus', 'slug'); 
    22   $q->addSelect('is_absent'); 
    23   $q->limit(1); 
    24   $t->is( 
    25     $q->getSqlQuery(), 
    26     "SELECT u.id AS u__id, u.slug AS u__slug, u.is_absent AS u__is_absent FROM ull_user_status u LIMIT 1", 
    27     'Created the correct SQL query' 
    28   ); 
    29   $t->is( 
    30     $q->execute(array(), DOCTRINE::HYDRATE_ARRAY),  
    31     array('active' => array('id' => 1, 'slug' => 'active', 'is_absent' => false)),  
    32     'Returns an indexed by array' 
    33   ); 
    34    
    3519   
    3620$t->diag('getBaseModel()'); 
     
    203187  ); 
    204188   
     189$t->diag('__construct() with INDEXBY | Also tests limit()'); 
     190  $q = new ullQuery('UllUserStatus', 'slug'); 
     191  $q->addSelect('is_absent'); 
     192  $q->limit(1); 
     193  $t->is( 
     194    $q->getSqlQuery(), 
     195    "SELECT u.id AS u__id, u.slug AS u__slug, u.is_absent AS u__is_absent FROM ull_user_status u LIMIT 1", 
     196    'Created the correct SQL query' 
     197  ); 
     198  $t->is( 
     199    $q->execute(array(), DOCTRINE::HYDRATE_ARRAY),  
     200    array('active' => array('id' => 1, 'slug' => 'active', 'is_absent' => false)),  
     201    'Returns an indexed by array' 
     202  );   
     203   
    205204 
    206205$t->diag('Doctrine 1.0 bug resolved with UllUser and SELECT on >= 2 relations');