Changeset 488

Show
Ignore:
Timestamp:
02/23/08 07:37:14 (9 months ago)
Author:
kaste
Message:

Added test for #128

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/unit/lib/AkActiveRecord/_AkActiveRecord_type_casting.php

    r404 r488  
    6262        $Post->reload(); 
    6363        $this->assertEqual($Post->get('expires_at'), '2007-10-15 17:30:00'); 
     64    } 
     65     
     66    function test_should_handle_empty_date_as_null() 
     67    { 
     68        $this->installAndIncludeModels(array('Post')); 
    6469 
     70        $params = array('title'=>'An empty date is a null date','posted_on(1i)'=>'','posted_on(2i)'=>'','posted_on(3i)'=>''); 
     71        $MyPost =& $this->Post->create($params); 
     72         
     73        $MyPost->reload(); 
     74        $this->assertNull($MyPost->posted_on,"Issue #128. Should be null, actually is {$MyPost->posted_on}."); 
    6575    } 
    6676}