CH13: SysMessageTest Failure.

I am on CH13 of the book specifically page: 326.

My SysMessageTest is failing:

My Code is as follows:

SysMessageTest.php




<?php


class SysMessageTest extends CDbTestCase

{

        public $fixtures=array(

            'messages'=>'SysMessage',

        );

        

        public function testGetLatest()

        {

            $message = SysMessage::getLatest();

            $this->assertTrue($message instanceof SysMessage);

        }

}



tbl_sys_message.php




<?php

return array(

    'message1'=>array(

        'message' => 'This is a test message',

        'create_time' => new CDbExpression('NOW()'),

        'create_user_id' => 1,

        'update_time' => new CDbExpression('NOW()'),

        'update_user_id' => 1,

    ),

);



GetLatest function in SysMessage AR Class




public static function getLatest()

        {

                //see if it is in the cache, if so, just return it

                if( ($cache=Yii::app()->cache)!==null)

                {

                    $key='TrackStar.ProjectListing.SystemMessage';

                    if(($sysMessage=$cache->get($key))!==false)

                        return $sysMessage;

                }

                

                //The system message was either not found in the cache, or

                //there is no cache component defined for the application

                //retrieve the system message from the database

                $sysMessage = SysMessage::model()->find(array(

                    'order'=>'t.update_time DESC',

                ));

                

                if($sysMessage != null)

                {

                    //a valid message was found. Store it in cache for future retrievals

                    if(isset($key))

                    $cache->set($key,$sysMessage,300);

                    return $sysMessage;

                }

                else

                    return null;

        }



Now I did get this test to pass by continuing on and generating the cache with the ProjectController::actionIndex call. However once I changed the cache location in the test.php configuration so the dev and test cache locations are different it would then again fail.