1. Jorge Vazquez
  2. Apmgr

Commits

Jorge Omar Vazquez  committed ace19ea

Fixing the tests.

  • Participants
  • Parent commits 6198bc6
  • Branches default

Comments (0)

Files changed (292)

File .hgignore

View file
 ^\.project$
 ^nbproject$
 ^cache$
+^logs$

File application/modules/calendar/models/Events.php

View file
                 $select->where("userId=?",$userId,'integer')
                         ->where('eventDateFrom>=?',$this->timeStampToDateFormat($start,$this->dateSqlFormat),'string')
                         ->where('eventDateTo<=?',$this->timeStampToDateFormat($end,$this->dateSqlFormat),'string');
-                $result = $db->query($select);
+                $result = $select->query();
                 if( count($result) > 0 ) {
-
+                    $results = $result->fetchAll();
+                    print"<pre>";print_r($results);print"</pre>";
                 }
             }
         }

File application/modules/calendar/models/EventsChilds.php

View file
  * @author Jorge Omar Vazquez <jvazquez@debserverp4.com.ar>
  */
 
-class Calendar_Model_EventsChilds extends Calendar_Model_Events  {
+class Calendar_Model_EventsChilds extends Calendar_Model_Events {
 
-	/**
-	 * The time that this event happens
-	 * @var time
-	 */
-	protected $startTime;
+    /**
+     * The time that this event happens
+     * @var time
+     */
+    protected $startTime;
 
-	/**
-	 * The date this event happens
-	 * @var date
-	 */
-	protected $eventDate;
+    /**
+     * The date this event happens
+     * @var date
+     */
+    protected $eventDate;
 
-	/**
-	 * The time that this event happens
-	 * @var time
-	 */
-	protected $endTime;
+    /**
+     * The time that this event happens
+     * @var time
+     */
+    protected $endTime;
 
-	/**
-	 * The parent id
-	 * @var integer
-	 */
-	protected $eventId;
+    /**
+     * The parent id
+     * @var integer
+     */
+    protected $eventId;
 
-	/**
-	 * @param array $options
-	 * @return
-	 */
-	public function __construct(array $options = null) {
-		parent::__construct( $options );
-		$this->setDbTable('Calendar_Model_DbTable_EventsChilds');
-		$this->initTimeFormat();
-	}
+    /**
+     * @param array $options
+     * @return
+     */
+    public function __construct(array $options = null) {
+        parent::__construct( $options );
+        $this->setDbTable('Calendar_Model_DbTable_EventsChilds');
+        $this->initTimeFormat();
+    }
 
-	/**
-	 * Return the time this event starts
-	 * @return string
-	 */
-	public function getStartTime() {
-		Zend_Date::setOptions(array('format_type' => 'php'));
-		$date = new Zend_Date($this->startTime,Zend_Date::TIMES,Zend_Registry::get('Zend_Locale'));
-		return $date->toString('H:i:s');
-	}
+    /**
+     * Return the time this event starts
+     * @return string
+     */
+    public function getStartTime() {
+        Zend_Date::setOptions(array('format_type' => 'php'));
+        $date = new Zend_Date($this->startTime,Zend_Date::TIMES,Zend_Registry::get('Zend_Locale'));
+        return $date->toString('H:i:s');
+    }
 
-	/**
-	 * Return the time this events ends
-	 * @return string
-	 */
-	public function getEndTime() {
-		Zend_Date::setOptions(array('format_type' => 'php'));
-		$date = new Zend_Date($this->endTime,Zend_Date::TIMES,Zend_Registry::get('Zend_Locale'));
-		return $date->toString('H:i:s');
-	}
+    /**
+     * Return the time this events ends
+     * @return string
+     */
+    public function getEndTime() {
+        Zend_Date::setOptions(array('format_type' => 'php'));
+        $date = new Zend_Date($this->endTime,Zend_Date::TIMES,Zend_Registry::get('Zend_Locale'));
+        return $date->toString('H:i:s');
+    }
 
 
-	/**
-	 * Set the time , the specified value musy be an array, whith the following format.
-	 * @example 'eventTimeFrom'=>array('hour'=>date('H'),'minute'=>date('i'),'seconds'=>date('s'))
-	 * @param array $time
-	 * @return Calendar_Model_Calendar
-	 */
-	public function setStartTime($time) {
-		if( $time==null or !is_array($time) or empty($time) ) {
-			throw new InvalidArgumentException('Unhandled time format');
-		}
-		$this->startTime = $time['hour'].':'.$time['minute'].":".$time['seconds'];
-		return $this;
-	}
+    /**
+     * Set the time , the specified value musy be an array, whith the following format.
+     * @example 'eventTimeFrom'=>array('hour'=>date('H'),'minute'=>date('i'),'seconds'=>date('s'))
+     * @param array $time
+     * @return Calendar_Model_Calendar
+     */
+    public function setStartTime($time) {
+        if( $time==null or !is_array($time) or empty($time) ) {
+            throw new InvalidArgumentException('Unhandled time format');
+        }
+        $this->startTime = $time['hour'].':'.$time['minute'].":".$time['seconds'];
+        return $this;
+    }
 
-	/**
-	 * Set the time , the specified value musy be an array, whith the following format.
-	 * @example 'eventTimeFrom'=>array('hour'=>date('H'),'minute'=>date('i'),'seconds'=>date('s'))
-	 * @param array $time
-	 * @return Calendar_Model_Calendar
-	 */
-	public function setEndTime($time) {
-		if( $time==null or !is_array($time) or empty($time) ) {
-			throw new InvalidArgumentException('Unhandled timeTo format');
-		}
+    /**
+     * Set the time , the specified value musy be an array, whith the following format.
+     * @example 'eventTimeFrom'=>array('hour'=>date('H'),'minute'=>date('i'),'seconds'=>date('s'))
+     * @param array $time
+     * @return Calendar_Model_Calendar
+     */
+    public function setEndTime($time) {
+        if( $time==null or !is_array($time) or empty($time) ) {
+            throw new InvalidArgumentException('Unhandled timeTo format');
+        }
 
-		$this->endTime = $time['hour'].':'.$time['minute'].":".$time['seconds'];
-		return $this;
-	}
+        $this->endTime = $time['hour'].':'.$time['minute'].":".$time['seconds'];
+        return $this;
+    }
 
 
-	/**
-	 * Sets the eventId that is the parent of this object
-	 * @param integer $eventId
-	 * @return Calendar_Model_EventsChilds
-	 */
-	public function setEventId($eventId) {
-		$this->eventId = $eventId;
-		return $this;
-	}
+    /**
+     * Sets the eventId that is the parent of this object
+     * @param integer $eventId
+     * @return Calendar_Model_EventsChilds
+     */
+    public function setEventId($eventId) {
+        $this->eventId = $eventId;
+        return $this;
+    }
 
-	/**
-	 * @return int
-	 */
-	public function getEventId() {
-		return $this->eventId;
-	}
+    /**
+     * @return int
+     */
+    public function getEventId() {
+        return $this->eventId;
+    }
 
-	/**
-	 * Return the recursive array contents
-	 * @return array
-	 */
-	public function getRecursiveDates() {
-		return $this->recursiveDates;
-	}
+    /**
+     * Return the recursive array contents
+     * @return array
+     */
+    public function getRecursiveDates() {
+        return $this->recursiveDates;
+    }
 
-	/**
-	 * Set the recursive Dates array
-	 * @return Calendar_Model_EventsChilds
-	 */
-	public function setRecursiveDates($recursiveDates) {
-		$this->recursiveDates = $recursiveDates;
-		return $this;
-	}
+    /**
+     * Set the recursive Dates array
+     * @return Calendar_Model_EventsChilds
+     */
+    public function setRecursiveDates($recursiveDates) {
+        $this->recursiveDates = $recursiveDates;
+        return $this;
+    }
 
-	/**
-	 * @return string
-	 */
-	public function getEventDate($mode=self::FORMATVIEW) {
-		Zend_Date::setOptions(array('format_type' => 'php'));
-		$date = '';
-		switch($mode) {
-			default : case self::FORMATSQL:
-				$zendDate =  new Zend_Date($this->eventDate,null,Zend_Registry::get('Zend_Locale'));
-				$date = $zendDate->toString($this->dateSqlFormat);
-				break;
-			case self::FORMATVIEW:
-				$zendDate =  new Zend_Date($this->eventDate,null,Zend_Registry::get('Zend_Locale'));
-				$date = $zendDate->toString($this->dateFormat);
-				break;
-			case self::REGULAR:
-				$date = $this->eventDate;
-				break;
-		}
-		return $date;
-	}
+    /**
+     * @return string
+     */
+    public function getEventDate($mode=self::FORMATVIEW) {
+        Zend_Date::setOptions(array('format_type' => 'php'));
+        $date = '';
+        switch($mode) {
+            default : case self::FORMATSQL:
+                $zendDate =  new Zend_Date($this->eventDate,null,Zend_Registry::get('Zend_Locale'));
+                $date = $zendDate->toString($this->dateSqlFormat);
+                break;
+            case self::FORMATVIEW:
+                $zendDate =  new Zend_Date($this->eventDate,null,Zend_Registry::get('Zend_Locale'));
+                $date = $zendDate->toString($this->dateFormat);
+                break;
+            case self::REGULAR:
+                $date = $this->eventDate;
+                break;
+        }
+        return $date;
+    }
 
-	/**
-	 * Set the date, the specified $date must be an array, whith the following keys.
-	 * @example 'eventDateFrom'=>array('month'=>date('m'),'day'=>date('d'),'year'=>date('Y'))
-	 * @param array $date
-	 * @return Calendar_Model_Calendar
-	 */
-	public function setEventDate(array $date=null) {
-		if( $date==null or !is_array($date) or empty($date) ) {
-			throw new InvalidArgumentException('Unhandled date format');
-		}
-		$this->eventDate = $date;
-		return $this;
-	}
+    /**
+     * Set the date, the specified $date must be an array, whith the following keys.
+     * @example 'eventDateFrom'=>array('month'=>date('m'),'day'=>date('d'),'year'=>date('Y'))
+     * @param array $date
+     * @return Calendar_Model_Calendar
+     */
+    public function setEventDate(array $date=null) {
+        if( $date==null or !is_array($date) or empty($date) ) {
+            throw new InvalidArgumentException('Unhandled date format');
+        }
+        $this->eventDate = $date;
+        return $this;
+    }
 
-	/**
-	 * Save the recurrent events.
-	 * It's using a different name, because php can't track down the right method it should call.
-	 * It's calling parent, rather than child......
-	 * @return boolean
-	 */
-	public function saveEvents() {
-		$result = false;
-		$data = $this->toArray();
+    /**
+     * Save the recurrent events.
+     * It's using a different name, because php can't track down the right method it should call.
+     * It's calling parent, rather than child......
+     * @return boolean
+     */
+    public function saveEvents() {
+        $result = false;
+        $data = $this->toArray();
 
-		$data['startTime'] = $this->getStartTime();
-		$data['endTime'] = $this->getEndTime();
-		$data['eventDate'] = $this->getEventDate('sql');
+        $data['startTime'] = $this->getStartTime();
+        $data['endTime'] = $this->getEndTime();
+        $data['eventDate'] = $this->getEventDate('sql');
 
-		if( isset($data['id']) ) {
-			$result = $this->getDbTable()->find( $data['id'] );
+        if( isset($data['id']) ) {
+            $result = $this->getDbTable()->find( $data['id'] );
 
-			if( $result) {
-				$record = array_shift( $result->toArray() );
-				$data['dateCreated'] = $record['dateCreated'];
-				$data['dateUpdated'] = date('Y-m-d H:i:s');
-				$db = $this->getDbTable()->getAdapter();
-				$where = $db->quoteInto("id=?", $data['id'] );
-				$result = $this->getDbTable()->update($data, $where);
-			}
-		}
-		else {  // create record
-			$data['dateCreated'] = date('Y-m-d H:i:s');
-			$result = $this->getDbTable()->insert($data);
-		}
-		return $result;
+            if( $result) {
+                $record = array_shift( $result->toArray() );
+                $data['dateCreated'] = $record['dateCreated'];
+                $data['dateUpdated'] = date('Y-m-d H:i:s');
+                $db = $this->getDbTable()->getAdapter();
+                $where = $db->quoteInto("id=?", $data['id'] );
+                $result = $this->getDbTable()->update($data, $where);
+            }
+        }
+        else {  // create record
+            $data['dateCreated'] = date('Y-m-d H:i:s');
+            $result = $this->getDbTable()->insert($data);
+        }
+        return $result;
 
-	}
+    }
 
-	/**
-	 * Prepare an insert statement for the eventsChilds
-	 * @param array $dates The dates are in SQL format
-	 * @param integer $eventId
-	 * @return boolean
-	 */
-	public function createEventRecursive(array $dates=null) {
-		$result = array();
-		$buffer = array();
+    /**
+     * Prepare an insert statement for the eventsChilds
+     * @param array $dates The dates are in SQL format
+     * @param integer $eventId
+     * @return boolean
+     */
+    public function createEventRecursive(array $dates=null) {
+        $result = array();
+        $buffer = array();
 
-		if( empty($dates) )
-			throw new Exception('Recursive dates must retrieve an array. I received a null value');
+        if( !empty($dates) ) {
+           foreach($dates as $id=>$date) {
+                $buffer = explode('-',$date);
+                $this->setEventDate(array('year'=>$buffer[0],'month'=>$buffer[1],'day'=>$buffer[2]));
+                $result[] = $this->saveEvents();
+            }
+        } else {
+            $result[] = false;
+        }
+        return !in_array(false,$result);
+    }
 
-		foreach($dates as $id=>$date) {
-			$buffer = explode('-',$date);
-			$this->setEventDate(array('year'=>$buffer[0],'month'=>$buffer[1],'day'=>$buffer[2]));
-			$result[] = $this->saveEvents();
-		}
-
-		return !in_array(false,$result);
-	}
-
-	/**
-	 * @return string
-	 */
-	public function __toString() {
-		return "EventsChilds";
-	}
+    /**
+     * @return string
+     */
+    public function __toString() {
+        return "EventsChilds";
+    }
 }

File tests/application/modules/calendar/models/Calendar_Model_CalendarTest.php

View file
 
 class Calendar_Model_CalendarTest extends ControllerTestCase {
 
-	/**
-	 * Current date
-	 * @var date
-	 */
-	protected $curdate;
+    /**
+     * Current date
+     * @var date
+     */
+    protected $curdate;
 
-	/**
-	 * Initialize the suite
-	 * @return unknown_type
-	 */
-	public function setUp() {
-		parent::setUp();
-	}
+    /**
+     * Initialize the suite
+     * @return unknown_type
+     */
+    public function setUp() {
+        parent::setUp();
+    }
 
-	/**
-	 * Clean the tables
-	 * @return unknown_type
-	 */
-	public function tearDown() {
-		$this->db->query('DELETE FROM events WHERE id>0');
-		$this->db->query('DELETE FROM eventsChilds WHERE id>0');
-		$this->db->query('DELETE FROM eventsNotification WHERE id>0');
-	}
+    /**
+     * Clean the tables
+     * @return unknown_type
+     */
+    public function tearDown() {
+        $this->db->query('DELETE FROM events WHERE id>0');
+        $this->db->query('DELETE FROM eventsChilds WHERE id>0');
+        $this->db->query('DELETE FROM eventsNotification WHERE id>0');
+    }
 
-	public function testContruct() {
-		$calendar = new Calendar_Model_Events();
-		$this->assertTrue(isset($calendar),'Basic instantiation failed');
-	}
+    public function testContruct() {
+        $calendar = new Calendar_Model_Events();
+        $this->assertTrue(isset($calendar),'Basic instantiation failed');
+    }
 
-	public function testInitializeAttribs() {
-		$calendar = new Calendar_Model_Events(array('id'=>1,'userId'=>1,'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),'data'=>'foo','recursive'=>0,'recursivePeriod'=>Calendar_Model_Calendar::DAY));
-		$this->assertClassHasAttribute('id', 'Calendar_Model_Events','Expected an id attribute');
-		$this->assertClassHasAttribute('userId', 'Calendar_Model_Events','Expected an userId attribute');
-		$this->assertClassHasAttribute('data', 'Calendar_Model_Events','Expected a data attribute');
-		$this->assertClassHasAttribute('eventDateFrom', 'Calendar_Model_Events','Expected a eventDateFrom attribute');
-		$this->assertClassHasAttribute('eventDateTo', 'Calendar_Model_Events','Expected a eventDateTo attribute');
-		$this->assertClassHasAttribute('recursive', 'Calendar_Model_Events','Expected recursive attribute');
-		$this->assertClassHasAttribute('recursivePeriod', 'Calendar_Model_Events','Expected recursivePeriod attribute');
-		$this->assertClassHasAttribute('dateCreated', 'Calendar_Model_Events','Expected dateCreated attribute');
-		$this->assertClassHasAttribute('dateUpdated', 'Calendar_Model_Events','Expected dateUpdatedattribute');
-	}
+    public function testInitializeAttribs() {
+        $calendar = new Calendar_Model_Events(array('id'=>1,'userId'=>1,'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),'data'=>'foo','recursive'=>0,'recursivePeriod'=>Calendar_Model_Calendar::DAY));
+        $this->assertClassHasAttribute('id', 'Calendar_Model_Events','Expected an id attribute');
+        $this->assertClassHasAttribute('userId', 'Calendar_Model_Events','Expected an userId attribute');
+        $this->assertClassHasAttribute('data', 'Calendar_Model_Events','Expected a data attribute');
+        $this->assertClassHasAttribute('eventDateFrom', 'Calendar_Model_Events','Expected a eventDateFrom attribute');
+        $this->assertClassHasAttribute('eventDateTo', 'Calendar_Model_Events','Expected a eventDateTo attribute');
+        $this->assertClassHasAttribute('recursive', 'Calendar_Model_Events','Expected recursive attribute');
+        $this->assertClassHasAttribute('recursivePeriod', 'Calendar_Model_Events','Expected recursivePeriod attribute');
+        $this->assertClassHasAttribute('dateCreated', 'Calendar_Model_Events','Expected dateCreated attribute');
+        $this->assertClassHasAttribute('dateUpdated', 'Calendar_Model_Events','Expected dateUpdatedattribute');
+    }
 
-	public function testSetterFrom() {
-		$calendar = new Calendar_model_Events();
-		$calendar->setEventDateFrom(array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')));
-		$this->assertNotNull($calendar->getEventDateFrom(),'We expected a not null value');
-		$this->assertEquals($calendar->getEventDateFrom(),date('d-m-Y'),'Dates are not matching');
-	}
+    public function testSetterFrom() {
+        $calendar = new Calendar_model_Events();
+        $calendar->setEventDateFrom(array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')));
+        $this->assertNotNull($calendar->getEventDateFrom(),'We expected a not null value');
+        $this->assertEquals($calendar->getEventDateFrom(),date('d-m-Y'),'Dates are not matching');
+    }
 
-	/**
-	 * @expectedException InvalidArgumentException
-	 */
-	public function testSetterDatesFromThrowsException() {
-		$calendar = new Calendar_Model_Events();
-		$calendar->setEventDateFrom(array());
-	}
+    /**
+     * @expectedException InvalidArgumentException
+     */
+    public function testSetterDatesFromThrowsException() {
+        $calendar = new Calendar_Model_Events();
+        $calendar->setEventDateFrom(array());
+    }
 
-	/**
-	 * @expectedException InvalidArgumentException
-	 */
-	public function testSetterDatesToThrowsException() {
-		$calendar = new Calendar_Model_Events();
-		$calendar->setEventDateTo(array());
-	}
+    /**
+     * @expectedException InvalidArgumentException
+     */
+    public function testSetterDatesToThrowsException() {
+        $calendar = new Calendar_Model_Events();
+        $calendar->setEventDateTo(array());
+    }
 
-	/**
-	 * @expectedException InvalidArgumentException
-	 */
-	public function testSetTimeFromThrowsException() {
-		$calendar = new Calendar_Model_EventsChilds();
-		$calendar->setStartTime(array());
-	}
+    /**
+     * @expectedException InvalidArgumentException
+     */
+    public function testSetTimeFromThrowsException() {
+        $calendar = new Calendar_Model_EventsChilds();
+        $calendar->setStartTime(array());
+    }
 
-	public function testSavePassWithNoRecursion() {
-		$calendar = new Calendar_Model_Events(
-		array(
-            'userId' 		=>	1,
-            'eventDateFrom' =>	array('month'=>date('m'),'day'=>date('d'),'year'=>date('Y')),
-            'eventDateTo'	=>	array('month'=>date('m'),'day'=>date('d'),'year'=>date('Y')),
-            'data'			=>	'foo',
-            'recursive'		=>	0
-		)
-		);
-		$this->assertTrue($calendar->validateInsert(),'We expected a true from the validation');
-		$id = $calendar->createEvent();
-		$this->assertTrue($id!=false);
-	}
+    public function testSavePassWithNoRecursion() {
+        $calendar = new Calendar_Model_Events(
+                array(
+                        'userId' 		=>	1,
+                        'eventDateFrom' =>	array('month'=>date('m'),'day'=>date('d'),'year'=>date('Y')),
+                        'eventDateTo'	=>	array('month'=>date('m'),'day'=>date('d'),'year'=>date('Y')),
+                        'data'			=>	'foo',
+                        'recursive'		=>	0
+                )
+        );
+        $this->assertTrue($calendar->validateInsert(),'We expected a true from the validation');
+        $id = $calendar->createEvent();
+        $this->assertTrue($id!=false);
+    }
 
-	public function testYieldRecursiveDatesWithMonthIncrease() {
-		$calendar = new Calendar_Model_Events();
-		$calendar->setEventDateFrom(array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')));
-		$calendar->setEventDateTo(array('day'=>date('d'),'month'=>date(4),'year'=>date('Y')));
-		$calendar->setRecursive(10);
-		$result = $calendar->generateRecursiveDates($calendar->getEventDateFrom(),$calendar->getRecursive(),Calendar_Model_Calendar::MONTH);
-		$this->assertType('array',$result,'We expected an array as a result');
-		$this->assertTrue(count($result)==0,'We expected more than 1 result in the middle');
-		unset($calendar);
-		$calendar = new Calendar_Model_Events();
-		$calendar->setEventDateFrom(array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')));
-		$calendar->setEventDateTo(array('day'=>date('d'),'month'=>date(5),'year'=>date('Y')));
-		$calendar->setRecursive(1);
-		$result = $calendar->generateRecursiveDates($calendar->getEventDateFrom(),$calendar->getRecursive(),Calendar_Model_Calendar::MONTH);
-		$this->assertType('array',$result,'We expected an array as a result');
-		$this->assertTrue(count($result)==1,'We expected more than 1 result in the middle');
-	}
+    public function testYieldRecursiveDatesWithMonthIncrease() {
+        $calendar = new Calendar_Model_Events();
+        $calendar->setEventDateFrom(array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')));
+        $calendar->setEventDateTo(array('day'=>date('d'),'month'=>date(4),'year'=>date('Y')));
+        $calendar->setRecursive(10);
+        $result = $calendar->generateRecursiveDates($calendar->getEventDateFrom(),$calendar->getRecursive(),Calendar_Model_Calendar::MONTH);
+        $this->assertType('array',$result,'We expected an array as a result');
+        $this->assertTrue(count($result)==0,'We expected more than 1 result in the middle');
+        unset($calendar);
+        $calendar = new Calendar_Model_Events();
+        $calendar->setEventDateFrom(array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')));
+        $calendar->setEventDateTo(array('day'=>date('d'),'month'=>date(5),'year'=>date('Y')));
+        $calendar->setRecursive(1);
+        $result = $calendar->generateRecursiveDates($calendar->getEventDateFrom(),$calendar->getRecursive(),Calendar_Model_Calendar::MONTH);
+        $this->assertType('array',$result,'We expected an array as a result');
+        $this->assertTrue(count($result)==1,'We expected more than 1 result in the middle');
+    }
 
-	public function testInstantiateEventsChilds() {
-		$startTime = array('hour'=>12,'minute'=>0,'seconds'=>0);
-		$endTime = array('hour'=>13,'minute'=>0,'seconds'=>0);
-		$eventDate = array('day'=>12,'month'=>12,'year'=>2010);
-		$calendar = new Calendar_Model_EventsChilds ( array (
-            'startTime'	=>	$startTime,
-            'endTime'	=>	$endTime,
-            'eventDate' => 	$eventDate,
-            'eventId'	=>	1
-		)
-		);
-		$this->assertClassHasAttribute('startTime', 'Calendar_Model_EventsChilds','Expected timeFrom attribute');
-		$this->assertClassHasAttribute('endTime', 'Calendar_Model_EventsChilds','Expected timeTo attribute');
-		$this->assertClassHasAttribute('eventDate', 'Calendar_Model_EventsChilds','Expected eventDate attribute');
-		$this->assertClassHasAttribute('eventId', 'Calendar_Model_EventsChilds','Expected eventDate attribute');
-		$this->assertEquals($calendar->getStartTime(),'12:00:00','Time Start fail');
-		$this->assertEquals($calendar->getEndTime(),'13:00:00','Time End fail');
-		$this->assertEquals($calendar->getEventDate('sql'),'2010-12-12','Date of the event failed at SQl Level');
-		$this->assertEquals($calendar->getEventDate('regular'),'12-12-2010','Date of the event failed at Regular Level*Check your locale first, this uses ARgentina');
-		$this->assertEquals($calendar->getEventDate('array'),$eventDate,'Date of the event failed at Array Level');
-		$this->assertEquals($calendar->getEventId(),1,'EventId failed');
-	}
+    public function testInstantiateEventsChilds() {
+        $startTime = array('hour'=>12,'minute'=>0,'seconds'=>0);
+        $endTime = array('hour'=>13,'minute'=>0,'seconds'=>0);
+        $eventDate = array('day'=>12,'month'=>12,'year'=>2010);
+        $calendar = new Calendar_Model_EventsChilds ( array (
+                        'startTime'	=>	$startTime,
+                        'endTime'	=>	$endTime,
+                        'eventDate' => 	$eventDate,
+                        'eventId'	=>	1
+                )
+        );
+        $this->assertClassHasAttribute('startTime', 'Calendar_Model_EventsChilds','Expected timeFrom attribute');
+        $this->assertClassHasAttribute('endTime', 'Calendar_Model_EventsChilds','Expected timeTo attribute');
+        $this->assertClassHasAttribute('eventDate', 'Calendar_Model_EventsChilds','Expected eventDate attribute');
+        $this->assertClassHasAttribute('eventId', 'Calendar_Model_EventsChilds','Expected eventDate attribute');
+        $this->assertEquals($calendar->getStartTime(),'12:00:00','Time Start fail');
+        $this->assertEquals($calendar->getEndTime(),'13:00:00','Time End fail');
+        $this->assertEquals($calendar->getEventDate('sql'),'2010-12-12','Date of the event failed at SQl Level');
+        $this->assertEquals($calendar->getEventDate('regular'),'12-12-2010','Date of the event failed at Regular Level*Check your locale first, this uses ARgentina');
+        $this->assertEquals($calendar->getEventDate('array'),$eventDate,'Date of the event failed at Array Level');
+        $this->assertEquals($calendar->getEventId(),1,'EventId failed');
+    }
 
-	public function testSaveWithRecursiveEvents() {
-		$calendar = new Calendar_Model_Events( array(
-            'userId'=>1,
-            'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
-            'eventDateTo'=>array('day'=>date('d'),'month'=>date(4),'year'=>date('Y')),
-            'data'=>'foo',
-            'recursive'=>10,
-            'recursivePeriod' => 'dd'
-            )
-            );
-            $id = $calendar->createEvent();
-            $dates = $calendar->generateRecursiveDates($calendar->getEventDateFrom('array'),$calendar->getRecursive(),$calendar->getRecursivePeriod());
-            $this->assertTrue(is_array($dates),'Generate Recursive Dates did not generate an array');
-            $this->assertTrue(count($dates)>0,'We did not generate enough dates');
-            $this->assertTrue( $calendar->validateInsert(),'Validation Failed' );
-            $this->assertTrue($id!=false,'Create event failed');
-            $recursiveEvents = new Calendar_Model_EventsChilds(
-            array (
-            'startTime'=>array('hour'=>12,'minute'=>15,'seconds'=>0),
-            'endTime' => array('hour'=>12,'minute'=>45,'seconds'=>0),
-            'eventId' => $id
-            )
-            );
-            $result = $recursiveEvents->createEventRecursive($dates);
-            $this->assertTrue($result!=false,'The recursive events in the child table failed');
-	}
+    public function testSaveWithRecursiveEvents() {
+        $calendar = new Calendar_Model_Events( array(
+                        'userId'=>1,
+                        'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
+                        'eventDateTo'=>array('day'=>date('d'),'month'=>date(4),'year'=>date('Y')),
+                        'data'=>'foo',
+                        'recursive'=>10,
+                        'recursivePeriod' => 'dd'
+                )
+        );
+        $id = $calendar->createEvent();
+        $dates = $calendar->generateRecursiveDates($calendar->getEventDateFrom('array'),$calendar->getRecursive(),$calendar->getRecursivePeriod());
+        $this->assertTrue(is_array($dates),'Generate Recursive Dates did not generate an array');
+        $this->assertTrue(count($dates)>0,'We did not generate enough dates');
+        $this->assertTrue( $calendar->validateInsert(),'Validation Failed' );
+        $this->assertTrue($id!=false,'Create event failed');
+        $recursiveEvents = new Calendar_Model_EventsChilds(
+                array (
+                        'startTime'=>array('hour'=>12,'minute'=>15,'seconds'=>0),
+                        'endTime' => array('hour'=>12,'minute'=>45,'seconds'=>0),
+                        'eventId' => $id
+                )
+        );
+        $result = $recursiveEvents->createEventRecursive($dates);
+        $this->assertTrue($result!=false,'The recursive events in the child table failed');
+    }
 
-	public function testSaveWithRecursiveEventsFailsDueToMissingDates() {
-		$calendar = new Calendar_Model_Events( array(
-            											'userId'=>1,
-            											'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
-            											'eventDateTo'=>array('day'=>date('d'),'month'=>date(4),'year'=>date('Y')),
-            											'data'=>'foo',
-            											'recursive'=>10,
-            											'recursivePeriod' => 'MM'
-            											)
-            											);
-            											$this->assertTrue( $calendar->validateInsert(),'Validation Failed because it should pass' );
-            											$id = $calendar->createEvent();
-            											$this->assertTrue($id!=false,'Create event failed');
-            											$dates = $calendar->generateRecursiveDates($calendar->getEventDateFrom('sql'),$calendar->getRecursive(),$calendar->getRecursivePeriod());
-            											$this->assertTrue(is_array($dates),'Generate Recursive Dates did not generate an array');
-            											$this->assertTrue(count($dates)==0,'We expected a fail result');
-            											$recursiveEvents = new Calendar_Model_EventsChilds(array ('startTime'=>array('hour'=>12,'minute'=>15,'seconds'=>0),'endTime' => array('hour'=>12,'minute'=>45,'seconds'=>0),'eventId' => $id));
-            											$result = $recursiveEvents->createEventRecursive($dates);
-            											$this->assertFalse($result,'The recursive events in the child table failed');
-	}
+    public function testSaveWithRecursiveEventsFailsDueToMissingDates() {
+        $calendar = new Calendar_Model_Events( array(
+                        'userId'=>1,
+                        'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
+                        'eventDateTo'=>array('day'=>date('d'),'month'=>date(4),'year'=>date('Y')),
+                        'data'=>'foo',
+                        'recursive'=>10,
+                        'recursivePeriod' => 'MM'
+                )
+        );
+        $this->assertTrue( $calendar->validateInsert(),'Validation Failed because it should pass' );
+        $id = $calendar->createEvent();
+        $this->assertTrue($id!=false,'Create event failed');
+        $dates = $calendar->generateRecursiveDates($calendar->getEventDateFrom('sql'),$calendar->getRecursive(),$calendar->getRecursivePeriod());
+        $this->assertTrue(is_array($dates),'Generate Recursive Dates did not generate an array');
+        $this->assertTrue(count($dates)==0,'We expected a fail result');
+        $recursiveEvents = new Calendar_Model_EventsChilds(array ('startTime'=>array('hour'=>12,'minute'=>15,'seconds'=>0),'endTime' => array('hour'=>12,'minute'=>45,'seconds'=>0),'eventId' => $id));
+        $result = $recursiveEvents->createEventRecursive($dates);
+        $this->assertFalse($result,'The recursive events in the child table failed');
+    }
 
-	public function testUpdateEventsNonRecursive() {
-		$calendar = new Calendar_Model_Events( array(
-            											'userId'=>1,
-            											'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
-            											'eventDateTo'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
-            											'data'=>'foo',
-            											'recursive'=>0
-		)
-		);
-		$this->assertTrue($calendar->validateInsert(),'Validation not working properly');
-		$id = $calendar->createEvent();
-		$this->assertTrue($id!==false,'Create event did not work');
-		$calendar->setData('This is an important change in the information');
-		$calendar->setId($id);
-		$result = $calendar->createEvent();
-		$this->assertTrue($result!==false,'Update event did not work');
-	}
+    public function testUpdateEventsNonRecursive() {
+        $calendar = new Calendar_Model_Events( array(
+                        'userId'=>1,
+                        'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
+                        'eventDateTo'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
+                        'data'=>'foo',
+                        'recursive'=>0
+                )
+        );
+        $this->assertTrue($calendar->validateInsert(),'Validation not working properly');
+        $id = $calendar->createEvent();
+        $this->assertTrue($id!==false,'Create event did not work');
+        $calendar->setData('This is an important change in the information');
+        $calendar->setId($id);
+        $result = $calendar->createEvent();
+        $this->assertTrue($result!==false,'Update event did not work');
+    }
 
-	public function testDeleteEvents() {
-		$calendar = new Calendar_Model_Events( array('userId'=>1,'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),'eventDateTo'=>array('day'=>date('d'),'month'=>date(4),'year'=>date('Y')),'data'=>'foo','recursive'=>10,'recursivePeriod' => 'dd'));
-		$id = $calendar->createEvent();
-		$dates = $calendar->generateRecursiveDates($calendar->getEventDateFrom('array'),$calendar->getRecursive(),$calendar->getRecursivePeriod());
-		$this->assertTrue(is_array($dates),'Generate Recursive Dates did not generate an array');
-		$this->assertTrue(count($dates)>0,'We did not generate enough dates');
-		$this->assertTrue( $calendar->validateInsert(),'Validation Failed' );
-		$this->assertTrue($id!=false,'Create event failed');
-		$recursiveEvents = new Calendar_Model_EventsChilds(array ('startTime'=>array('hour'=>12,'minute'=>15,'seconds'=>0),'endTime' => array('hour'=>12,'minute'=>45,'seconds'=>0),'eventId' => $id));
-		$result = $recursiveEvents->createEventRecursive($dates);
-		$this->assertTrue($result!=false,'The recursive events in the child table failed');
-		$deleted = $calendar->delete($id);
-		$this->assertTrue($deleted!=false,'Calendar did not delete the event');
-		$buffer = $recursiveEvents->findByKey(array('returnClassObject'=>false,'search'=>array('eventId'=>$id)));
-		$this->assertTrue(count($buffer)==0,'We expected that the db engine wiped the childs, but it did not');
-	}
-	
-	public function testSaveNotifyEventWillPass() {
-//		$event = $this->getMock('Calendar_Model_Events',array('save'));
-//		$event->expects($this->once())
-//			  ->method('save')
-//			  ->will($this->returnValue(2));
-//		$this->assertEquals(2,$event->save(),'Stub failed');
-		$eventNotification = new Calendar_Model_EventsNotification(array('userId'=>1,'eventId'=>2));
-		$this->assertTrue($eventNotification->save()!=false,'Save Method Failed');
-	}
-	
-	public function testUpdateNotifyEvents() {
-		$eventNotification = new Calendar_Model_EventsNotification(array('userId'=>1,'eventId'=>2));
-		$notifyId = $eventNotification->save();
-		$this->assertTrue($notifyId!=false,'Save Method Failed');
-		$eventNotification->setConfirmed(1);
-		$eventNotification->setId($notifyId);
-		$this->assertTrue($eventNotification->save()!=false,'Update Method Failed');
-	}
+    public function testDeleteEvents() {
+        $calendar = new Calendar_Model_Events( array('userId'=>1,'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),'eventDateTo'=>array('day'=>date('d'),'month'=>date(4),'year'=>date('Y')),'data'=>'foo','recursive'=>10,'recursivePeriod' => 'dd'));
+        $id = $calendar->createEvent();
+        $dates = $calendar->generateRecursiveDates($calendar->getEventDateFrom('array'),$calendar->getRecursive(),$calendar->getRecursivePeriod());
+        $this->assertTrue(is_array($dates),'Generate Recursive Dates did not generate an array');
+        $this->assertTrue(count($dates)>0,'We did not generate enough dates');
+        $this->assertTrue( $calendar->validateInsert(),'Validation Failed' );
+        $this->assertTrue($id!=false,'Create event failed');
+        $recursiveEvents = new Calendar_Model_EventsChilds(array ('startTime'=>array('hour'=>12,'minute'=>15,'seconds'=>0),'endTime' => array('hour'=>12,'minute'=>45,'seconds'=>0),'eventId' => $id));
+        $result = $recursiveEvents->createEventRecursive($dates);
+        $this->assertTrue($result!=false,'The recursive events in the child table failed');
+        $deleted = $calendar->delete($id);
+        $this->assertTrue($deleted!=false,'Calendar did not delete the event');
+        $buffer = $recursiveEvents->findByKey(array('returnClassObject'=>false,'search'=>array('eventId'=>$id)));
+        $this->assertTrue(count($buffer)==0,'We expected that the db engine wiped the childs, but it did not');
+    }
+
+    public function testSaveNotifyEventWillPass() {
+        $calendar = new Calendar_Model_Events( array(
+                        'userId'=>1,
+                        'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
+                        'eventDateTo'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
+                        'data'=>'foo',
+                        'recursive'=>0
+                )
+        );
+        $this->assertTrue($calendar->validateInsert(),'Validation not working properly');
+        $id = $calendar->createEvent();
+        $this->assertTrue($id!==false,'Create event did not work');
+
+        $eventNotification = new Calendar_Model_EventsNotification(array('userId'=>1,'eventId'=>$id));
+        $this->assertTrue($eventNotification->save()!=false,'Save Method Failed');
+    }
+
+    public function testUpdateNotifyEvents() {
+        $calendar = new Calendar_Model_Events( array(
+                        'userId'=>1,
+                        'eventDateFrom'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
+                        'eventDateTo'=>array('day'=>date('d'),'month'=>date('m'),'year'=>date('Y')),
+                        'data'=>'foo',
+                        'recursive'=>0
+                )
+        );
+        $this->assertTrue($calendar->validateInsert(),'Validation not working properly');
+        $id = $calendar->createEvent();
+        $this->assertTrue($id!==false,'Create event did not work');
+        $eventNotification = new Calendar_Model_EventsNotification(array('userId'=>1,'eventId'=>$id));
+        $notifyId = $eventNotification->save();
+        $this->assertTrue($notifyId!=false,'Save Method Failed');
+        $eventNotification->setConfirmed(1);
+        $eventNotification->setId($notifyId);
+        $this->assertTrue($eventNotification->save()!=false,'Update Method Failed');
+    }
 }
 ?>

File tests/logs/.hgignore

View file
+^report$

File tests/logs/report/Bootstrap.php.html

View file
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html lang="en">
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <title>Calendar_Model_CalendarTest</title>
-    <link rel="stylesheet" type="text/css" href="style.css">
-    <link rel="stylesheet" type="text/css" href="container.css">
-    <script type="text/javascript" src="yahoo-dom-event.js"></script>
-    <script type="text/javascript" src="container-min.js"></script>
-  </head>
-
-  <body class="yui-skin-sam">
-    <table width="100%" border="0" cellspacing="0" cellpadding="0">
-      <tr><td class="title">Calendar_Model_CalendarTest</td></tr>
-      <tr><td class="ruler"><img src="glass.png" width="3" height="3" alt=""></td></tr>
-
-      <tr>
-        <td width="100%">
-          <table cellpadding="1" border="0" width="100%">
-            <tr>
-              <td class="headerItem" width="20%">Current file:</td>
-              <td class="headerValue" width="80%"><a href="index.html">C:\workspace\apmgr\application</a>\<a href="Bootstrap.php.html">Bootstrap.php</a></td>
-            </tr>
-            <tr>
-              <td class="legendItem" width="20%">Legend:</td>
-              <td class="legendValue" width="80%">
-                <span class="legendCov">executed</span>
-                <span class="legendNoCov">not executed</span>
-                <span class="legendDeadCode">dead code</span>
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-
-      <tr>
-        <td class="ruler"><img src="glass.png" width="3" height="3" alt=""></td>
-      </tr>
-    </table>
-
-    <br />
-
-    <center>
-      <table width="90%" cellpadding="2" cellspacing="1" border="0">
-        <tr>
-          <td class="tableHead" width="30%">&nbsp;</td>
-          <td class="tableHead" colspan="9">Coverage</td>
-        </tr>
-        <tr>
-          <td class="tableHead">&nbsp;</td>
-          <td class="tableHead" colspan="3">Classes</td>
-          <td class="tableHead" colspan="3">Functions / Methods</td>
-          <td class="tableHead" colspan="3">Lines</td>
-        </tr>
-        <tr>
-          <td class="coverItem">Total</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="10" height="10" alt="10.00%"><img src="snow.png" width="90" height="10" alt="10.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">10.00%</td>
-          <td class="coverNumLo">1 / 10</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="15" height="10" alt="15.85%"><img src="snow.png" width="85" height="10" alt="15.85%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">15.85%</td>
-          <td class="coverNumLo">13 / 82</td>
-        </tr>
-
-        <tr>
-          <td class="tableHead" colspan="10">&nbsp;</td>
-        </tr>
-        <tr>
-          <td class="coverItem"><b><a href="#17">Bootstrap</a></b></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="10" height="10" alt="10.00%"><img src="snow.png" width="90" height="10" alt="10.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">10.00%</td>
-          <td class="coverNumLo">1 / 10</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="15" height="10" alt="15.85%"><img src="snow.png" width="85" height="10" alt="15.85%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">15.85%</td>
-          <td class="coverNumLo">13 / 82</td>
-        </tr>
-
-        <tr>
-          <td class="coverFile" colspan="4">&nbsp;<a href="#24">protected function _initDb()</a></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="chameleon.png" width="100" height="10" alt="100.00%"><img src="snow.png" width="0" height="10" alt="100.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerHi">100.00%</td>
-          <td class="coverNumHi">1 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="chameleon.png" width="100" height="10" alt="100.00%"><img src="snow.png" width="0" height="10" alt="100.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerHi">100.00%</td>
-          <td class="coverNumHi">12 / 12</td>
-        </tr>
-
-        <tr>
-          <td class="coverFile" colspan="4">&nbsp;<a href="#46">protected function _initDoctype()</a></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 13</td>
-        </tr>
-
-        <tr>
-          <td class="coverFile" colspan="4">&nbsp;<a href="#79">protected function _initAutoload()</a></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 2</td>
-        </tr>
-
-        <tr>
-          <td class="coverFile" colspan="4">&nbsp;<a href="#87">protected function _initModelPlugin()</a></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 4</td>
-        </tr>
-
-        <tr>
-          <td class="coverFile" colspan="4">&nbsp;<a href="#96">protected function _initModularApplication()</a></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 14</td>
-        </tr>
-
-        <tr>
-          <td class="coverFile" colspan="4">&nbsp;<a href="#113">protected function _initCacheTableAbstract()</a></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 7</td>
-        </tr>
-
-        <tr>
-          <td class="coverFile" colspan="4">&nbsp;<a href="#128">protected function _initAcl()</a></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 7</td>
-        </tr>
-
-        <tr>
-          <td class="coverFile" colspan="4">&nbsp;<a href="#144">protected function _initLocale()</a></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 14</td>
-        </tr>
-
-        <tr>
-          <td class="coverFile" colspan="4">&nbsp;<a href="#170">protected function _initDockletCheck()</a></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 4</td>
-        </tr>
-
-        <tr>
-          <td class="coverFile" colspan="4">&nbsp;<a href="#180">protected function _initHistory()</a></td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 1</td>
-          <td class="coverBar" align="center" width="100">
-            <table border="0" cellspacing="0" cellpadding="1">
-              <tr>
-                <td class="coverBarOutline"><img src="scarlet_red.png" width="0" height="10" alt="0.00%"><img src="snow.png" width="100" height="10" alt="0.00%"></td>
-              </tr>
-            </table>
-          </td>
-          <td class="coverPerLo">0.00%</td>
-          <td class="coverNumLo">0 / 4</td>
-        </tr>
-
-
-      </table>
-    </center>
-
-    <br />
-
-    <table cellpadding="0" cellspacing="0" border="0">
-      <tr>
-        <td><br /></td>
-      </tr>
-      <tr>
-        <td>
-<pre class="source">
-<span class="lineNum" id="container1"><a name="1"></a><a href="#1" id="line1">       1</a> </span>                : <span class="default">&lt;?php</span>                                                                                                                                                                                                                                  
-<span class="lineNum" id="container2"><a name="2"></a><a href="#2" id="line2">       2</a> </span>                : <span class="comment">/**</span>                                                                                                                                                                                                                                    
-<span class="lineNum" id="container3"><a name="3"></a><a href="#3" id="line3">       3</a> </span>                : <span class="comment">&nbsp;*&nbsp;Created&nbsp;on&nbsp;Sep&nbsp;5,&nbsp;2009&nbsp;by&nbsp;jvazquez</span>                                                                                                                                                                                                  
-<span class="lineNum" id="container4"><a name="4"></a><a href="#4" id="line4">       4</a> </span>                : <span class="comment">&nbsp;*&nbsp;utils</span>                                                                                                                                                                                                                               
-<span class="lineNum" id="container5"><a name="5"></a><a href="#5" id="line5">       5</a> </span>                : <span class="comment">&nbsp;*&nbsp;utils.bootstrap</span>                                                                                                                                                                                                                     
-<span class="lineNum" id="container6"><a name="6"></a><a href="#6" id="line6">       6</a> </span>                : <span class="comment">&nbsp;*&nbsp;&lt;p&gt;</span>                                                                                                                                                                                                                                 
-<span class="lineNum" id="container7"><a name="7"></a><a href="#7" id="line7">       7</a> </span>                : <span class="comment">&nbsp;*&nbsp;This&nbsp;class&nbsp;is&nbsp;loaded&nbsp;and&nbsp;provides&nbsp;the&nbsp;resources&nbsp;that&nbsp;we&nbsp;will&nbsp;be&nbsp;using.</span>                                                                                                                                                              
-<span class="lineNum" id="container8"><a name="8"></a><a href="#8" id="line8">       8</a> </span>                : <span class="comment">&nbsp;*&nbsp;Why&nbsp;we&nbsp;can't&nbsp;use&nbsp;the&nbsp;functionality&nbsp;of&nbsp;request,&nbsp;plugins&nbsp;,&nbsp;zend&nbsp;view&nbsp;and&nbsp;other&nbsp;things&nbsp;and&nbsp;depend&nbsp;on&nbsp;the&nbsp;registry</span>                                                                                                                      
-<span class="lineNum" id="container9"><a name="9"></a><a href="#9" id="line9">       9</a> </span>                : <span class="comment">&nbsp;*&nbsp;Because&nbsp;the&nbsp;core.php&nbsp;isn't&nbsp;calling&nbsp;the&nbsp;run&nbsp;method,&nbsp;that&nbsp;allows&nbsp;you&nbsp;to&nbsp;have&nbsp;that.&nbsp;If&nbsp;we&nbsp;&lt;strong&gt;run()&lt;/strong&gt;,&nbsp;we&nbsp;will</span>                                                                                                              
-<span class="lineNum" id="container10"><a name="10"></a><a href="#10" id="line10">      10</a> </span>                : <span class="comment">&nbsp;*&nbsp;go&nbsp;to&nbsp;the&nbsp;zend&nbsp;framework&nbsp;environment&nbsp;fully,&nbsp;and&nbsp;controllers&nbsp;will&nbsp;have&nbsp;to&nbsp;be&nbsp;created&nbsp;for&nbsp;that.</span>                                                                                                                                       
-<span class="lineNum" id="container11"><a name="11"></a><a href="#11" id="line11">      11</a> </span>                : <span class="comment">&nbsp;*&nbsp;For&nbsp;more&nbsp;information,&nbsp;please&nbsp;read</span>                                                                                                                                                                                                   
-<span class="lineNum" id="container12"><a name="12"></a><a href="#12" id="line12">      12</a> </span>                : <span class="comment">&nbsp;*&nbsp;@link&nbsp;http://framework.zend.com/manual/en/zend.application.theory-of-operation.html&nbsp;Read&nbsp;this&nbsp;page,&nbsp;there&nbsp;is&nbsp;the&nbsp;correct&nbsp;explanation&nbsp;of&nbsp;why&nbsp;things&nbsp;are&nbsp;working&nbsp;this&nbsp;way.</span>                                                            
-<span class="lineNum" id="container13"><a name="13"></a><a href="#13" id="line13">      13</a> </span>                : <span class="comment">&nbsp;*&nbsp;I&nbsp;don't&nbsp;think&nbsp;that&nbsp;switching&nbsp;will&nbsp;be&nbsp;much&nbsp;of&nbsp;a&nbsp;problem,&nbsp;the&nbsp;model&nbsp;section&nbsp;of&nbsp;zend&nbsp;is&nbsp;basically&nbsp;covered&nbsp;here.</span>                                                                                                                        
-<span class="lineNum" id="container14"><a name="14"></a><a href="#14" id="line14">      14</a> </span>                : <span class="comment">&nbsp;*&nbsp;&lt;/p&gt;</span>                                                                                                                                                                                                                                
-<span class="lineNum" id="container15"><a name="15"></a><a href="#15" id="line15">      15</a> </span>                : <span class="comment">&nbsp;*/</span>                                                                                                                                                                                                                                    
-<span class="lineNum" id="container16"><a name="16"></a><a href="#16" id="line16">      16</a> </span>                :                                                                                                                                                                                                                                        
-<span class="lineNum" id="container17"><a name="17"></a><a href="#17" id="line17">      17</a> </span><span class="lineCov">              1 : <span class="keyword">class</span><span class="default">&nbsp;</span><span class="default">Bootstrap</span><span class="default">&nbsp;</span><span class="keyword">extends</span><span class="default">&nbsp;</span><span class="default">Zend_Application_Bootstrap_Bootstrap</span><span class="default">&nbsp;</span><span class="keyword">{</span>                                                                                                                                                                         </span>
-<span class="lineNum" id="container18"><a name="18"></a><a href="#18" id="line18">      18</a> </span>                :                                                                                                                                                                                                                                        
-<span class="lineNum" id="container19"><a name="19"></a><a href="#19" id="line19">      19</a> </span>                : <span class="comment">/**</span>                                                                                                                                                                                                                                    
-<span class="lineNum" id="container20"><a name="20"></a><a href="#20" id="line20">      20</a> </span>                : <span class="comment">&nbsp;*&nbsp;Initializes&nbsp;the&nbsp;database&nbsp;connection.</span>                                                                                                                                                                                                
-<span class="lineNum" id="container21"><a name="21"></a><a href="#21" id="line21">      21</a> </span>                : <span class="comment">&nbsp;*&nbsp;From&nbsp;any&nbsp;point&nbsp;of&nbsp;the&nbsp;application,&nbsp;now&nbsp;you&nbsp;can&nbsp;do</span>                                                                                                                                                                                   
-<span class="lineNum" id="container22"><a name="22"></a><a href="#22" id="line22">      22</a> </span>                : <span class="comment">&nbsp;*&nbsp;@example&nbsp;connection&nbsp;$db&nbsp;=&nbsp;Zend_Registry::get('db');&nbsp;and&nbsp;it&nbsp;will&nbsp;allow&nbsp;you&nbsp;to&nbsp;do&nbsp;queries&nbsp;against&nbsp;the&nbsp;database</span>                                                                                                                        
-<span class="lineNum" id="container23"><a name="23"></a><a href="#23" id="line23">      23</a> </span>                : <span class="comment">&nbsp;*/</span>                                                                                                                                                                                                                                    
-<span class="lineNum" id="container24"><a name="24"></a><a href="#24" id="line24">      24</a> </span>                : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected</span><span class="default">&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">_initDb</span><span class="keyword">(</span><span class="keyword">)</span><span class="default">&nbsp;</span><span class="keyword">{</span>                                                                                                                                                                                                     
-<span class="lineNum" id="container25"><a name="25"></a><a href="#25" id="line25">      25</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$options</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="keyword">array</span><span class="default">&nbsp;</span><span class="keyword">(</span><span class="default">'nestSeparator'</span><span class="default">&nbsp;</span><span class="keyword">=&gt;</span><span class="default">&nbsp;</span><span class="default">&quot;.&quot;</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                                                     </span>
-<span class="lineNum" id="container26"><a name="26"></a><a href="#26" id="line26">      26</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$config</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="keyword">new</span><span class="default">&nbsp;</span><span class="default">Zend_Config_Ini</span><span class="keyword">(</span><span class="default">APPLICATION_PATH</span><span class="default">&nbsp;</span><span class="keyword">.</span><span class="default">&nbsp;</span><span class="default">&quot;/configs/application.ini&quot;</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">APPLICATION_ENV</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">$options</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                       </span>
-<span class="lineNum" id="container27"><a name="27"></a><a href="#27" id="line27">      27</a> </span>                :                                                                                                                                                                                                                                        
-<span class="lineNum" id="container28"><a name="28"></a><a href="#28" id="line28">      28</a> </span>                : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//db&nbsp;config&nbsp;and&nbsp;connect</span>                                                                                                                                                                                                        
-<span class="lineNum" id="container29"><a name="29"></a><a href="#29" id="line29">      29</a> </span>                : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$params</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="keyword">array</span><span class="default">&nbsp;</span><span class="keyword">(</span>                                                                                                                                                                                                              
-<span class="lineNum" id="container30"><a name="30"></a><a href="#30" id="line30">      30</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">'host'</span><span class="default">&nbsp;</span><span class="keyword">=&gt;</span><span class="default">&nbsp;</span><span class="default">$config</span><span class="keyword">-&gt;</span><span class="default">resources</span><span class="keyword">-&gt;</span><span class="default">db</span><span class="keyword">-&gt;</span><span class="default">params</span><span class="keyword">-&gt;</span><span class="default">host</span><span class="keyword">,</span>                                                                                                                                                                            </span>
-<span class="lineNum" id="container31"><a name="31"></a><a href="#31" id="line31">      31</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">'username'</span><span class="default">&nbsp;</span><span class="keyword">=&gt;</span><span class="default">&nbsp;</span><span class="default">$config</span><span class="keyword">-&gt;</span><span class="default">resources</span><span class="keyword">-&gt;</span><span class="default">db</span><span class="keyword">-&gt;</span><span class="default">params</span><span class="keyword">-&gt;</span><span class="default">username</span><span class="keyword">,</span>                                                                                                                                                                    </span>
-<span class="lineNum" id="container32"><a name="32"></a><a href="#32" id="line32">      32</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">'password'</span><span class="default">&nbsp;</span><span class="keyword">=&gt;</span><span class="default">&nbsp;</span><span class="default">$config</span><span class="keyword">-&gt;</span><span class="default">resources</span><span class="keyword">-&gt;</span><span class="default">db</span><span class="keyword">-&gt;</span><span class="default">params</span><span class="keyword">-&gt;</span><span class="default">password</span><span class="keyword">,</span>                                                                                                                                                                    </span>
-<span class="lineNum" id="container33"><a name="33"></a><a href="#33" id="line33">      33</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">'dbname'</span><span class="default">&nbsp;</span><span class="keyword">=&gt;</span><span class="default">&nbsp;</span><span class="default">$config</span><span class="keyword">-&gt;</span><span class="default">resources</span><span class="keyword">-&gt;</span><span class="default">db</span><span class="keyword">-&gt;</span><span class="default">params</span><span class="keyword">-&gt;</span><span class="default">dbname</span>                                                                                                                                                                         </span>
-<span class="lineNum" id="container34"><a name="34"></a><a href="#34" id="line34">      34</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                                                                                             </span>
-<span class="lineNum" id="container35"><a name="35"></a><a href="#35" id="line35">      35</a> </span>                :                                                                                                                                                                                                                                        
-<span class="lineNum" id="container36"><a name="36"></a><a href="#36" id="line36">      36</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$db</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="default">Zend_Db</span><span class="default">&nbsp;</span><span class="keyword">::</span><span class="default">&nbsp;</span><span class="default">factory</span><span class="keyword">(</span><span class="default">$config</span><span class="keyword">-&gt;</span><span class="default">resources</span><span class="keyword">-&gt;</span><span class="default">db</span><span class="keyword">-&gt;</span><span class="default">adapter</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">$params</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                            </span>
-<span class="lineNum" id="container37"><a name="37"></a><a href="#37" id="line37">      37</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$db</span><span class="keyword">-&gt;</span><span class="default">query</span><span class="keyword">(</span><span class="default">&quot;SET&nbsp;NAMES&nbsp;'utf8'&quot;</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                                                                </span>
-<span class="lineNum" id="container38"><a name="38"></a><a href="#38" id="line38">      38</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">Zend_Db_Table</span><span class="default">&nbsp;</span><span class="keyword">::</span><span class="default">&nbsp;</span><span class="default">setDefaultAdapter</span><span class="keyword">(</span><span class="default">$db</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                                                       </span>
-<span class="lineNum" id="container39"><a name="39"></a><a href="#39" id="line39">      39</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">Zend_Registry</span><span class="keyword">::</span><span class="default">set</span><span class="keyword">(</span><span class="default">'db'</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">$db</span><span class="keyword">)</span><span class="keyword">;</span><span class="comment">//Register</span>                                                                                                                                                                                       </span>
-<span class="lineNum" id="container40"><a name="40"></a><a href="#40" id="line40">      40</a> </span><span class="lineCov">             15 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">return</span><span class="default">&nbsp;</span><span class="default">$db</span><span class="keyword">;</span>                                                                                                                                                                                                                    </span>
-<span class="lineNum" id="container41"><a name="41"></a><a href="#41" id="line41">      41</a> </span><span class="lineDeadCode">                : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">}</span>                                                                                                                                                                                                                                  </span>
-<span class="lineNum" id="container42"><a name="42"></a><a href="#42" id="line42">      42</a> </span>                :                                                                                                                                                                                                                                        
-<span class="lineNum" id="container43"><a name="43"></a><a href="#43" id="line43">      43</a> </span>                : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span>                                                                                                                                                                                                                                
-<span class="lineNum" id="container44"><a name="44"></a><a href="#44" id="line44">      44</a> </span>                : <span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Initializes&nbsp;the&nbsp;view&nbsp;doctype&nbsp;and&nbsp;the&nbsp;filter&nbsp;for&nbsp;i18n</span>                                                                                                                                                                            
-<span class="lineNum" id="container45"><a name="45"></a><a href="#45" id="line45">      45</a> </span>                : <span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span>                                                                                                                                                                                                                                
-<span class="lineNum" id="container46"><a name="46"></a><a href="#46" id="line46">      46</a> </span>                : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">protected</span><span class="default">&nbsp;</span><span class="keyword">function</span><span class="default">&nbsp;</span><span class="default">_initDoctype</span><span class="keyword">(</span><span class="keyword">)</span><span class="default">&nbsp;</span><span class="keyword">{</span>                                                                                                                                                                                                
-<span class="lineNum" id="container47"><a name="47"></a><a href="#47" id="line47">      47</a> </span><span class="lineNoCov">              0 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">bootstrap</span><span class="keyword">(</span><span class="default">'view'</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                                                                      </span>
-<span class="lineNum" id="container48"><a name="48"></a><a href="#48" id="line48">      48</a> </span><span class="lineNoCov">              0 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$view</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="default">$this</span><span class="keyword">-&gt;</span><span class="default">getResource</span><span class="keyword">(</span><span class="default">'view'</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                                                            </span>
-<span class="lineNum" id="container49"><a name="49"></a><a href="#49" id="line49">      49</a> </span><span class="lineNoCov">              0 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$view</span><span class="keyword">-&gt;</span><span class="default">doctype</span><span class="keyword">(</span><span class="default">'XHTML1_STRICT'</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                                                               </span>
-<span class="lineNum" id="container50"><a name="50"></a><a href="#50" id="line50">      50</a> </span><span class="lineNoCov">              0 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$view</span><span class="keyword">-&gt;</span><span class="default">appTitle</span><span class="default">&nbsp;</span><span class="keyword">=</span><span class="default">&nbsp;</span><span class="default">&quot;Apartment&nbsp;Manager&quot;</span><span class="keyword">;</span>                                                                                                                                                                                         </span>
-<span class="lineNum" id="container51"><a name="51"></a><a href="#51" id="line51">      51</a> </span>                : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//&nbsp;&nbsp;&nbsp;&nbsp;Let&nbsp;Zend&nbsp;know&nbsp;about&nbsp;all&nbsp;of&nbsp;our&nbsp;helpers</span>                                                                                                                                                                                   
-<span class="lineNum" id="container52"><a name="52"></a><a href="#52" id="line52">      52</a> </span><span class="lineNoCov">              0 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$view</span><span class="keyword">-&gt;</span><span class="default">addHelperPath</span><span class="keyword">(</span><span class="default">APPLICATION_PATH</span><span class="default">&nbsp;</span><span class="keyword">.</span><span class="default">&nbsp;</span><span class="default">'/helpers'</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">'Wulf_View_Helper'</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                       </span>
-<span class="lineNum" id="container53"><a name="53"></a><a href="#53" id="line53">      53</a> </span>                :                                                                                                                                                                                                                                        
-<span class="lineNum" id="container54"><a name="54"></a><a href="#54" id="line54">      54</a> </span>                : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span>                                                                                                                                                                                                                            
-<span class="lineNum" id="container55"><a name="55"></a><a href="#55" id="line55">      55</a> </span>                : <span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@internal&nbsp;Add&nbsp;the&nbsp;filter&nbsp;for&nbsp;i18n</span>                                                                                                                                                                                           
-<span class="lineNum" id="container56"><a name="56"></a><a href="#56" id="line56">      56</a> </span>                : <span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@link&nbsp;http://devzone.zend.com/article/4513-Zend-Framework-and-Translation</span>                                                                                                                                                   
-<span class="lineNum" id="container57"><a name="57"></a><a href="#57" id="line57">      57</a> </span>                : <span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span>                                                                                                                                                                                                                            
-<span class="lineNum" id="container58"><a name="58"></a><a href="#58" id="line58">      58</a> </span><span class="lineNoCov">              0 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$view</span><span class="keyword">-&gt;</span><span class="default">addFilterPath</span><span class="keyword">(</span><span class="default">'ZFTranslate/View/Filter'</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">'ZFTranslate_View_Filter'</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                    </span>
-<span class="lineNum" id="container59"><a name="59"></a><a href="#59" id="line59">      59</a> </span><span class="lineNoCov">              0 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$view</span><span class="keyword">-&gt;</span><span class="default">setFilter</span><span class="keyword">(</span><span class="default">'Translate'</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                                                                 </span>
-<span class="lineNum" id="container60"><a name="60"></a><a href="#60" id="line60">      60</a> </span>                :                                                                                                                                                                                                                                        
-<span class="lineNum" id="container61"><a name="61"></a><a href="#61" id="line61">      61</a> </span>                : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">/**</span>                                                                                                                                                                                                                            
-<span class="lineNum" id="container62"><a name="62"></a><a href="#62" id="line62">      62</a> </span>                : <span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Append&nbsp;our&nbsp;experiment&nbsp;to&nbsp;filter&nbsp;resources</span>                                                                                                                                                                                   
-<span class="lineNum" id="container63"><a name="63"></a><a href="#63" id="line63">      63</a> </span>                : <span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;if&nbsp;the&nbsp;user&nbsp;is&nbsp;logged&nbsp;in,&nbsp;we&nbsp;will&nbsp;show&nbsp;the&nbsp;html&nbsp;,&nbsp;else&nbsp;we&nbsp;won't</span>                                                                                                                                                             
-<span class="lineNum" id="container64"><a name="64"></a><a href="#64" id="line64">      64</a> </span>                : <span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span>                                                                                                                                                                                                                            
-<span class="lineNum" id="container65"><a name="65"></a><a href="#65" id="line65">      65</a> </span><span class="lineNoCov">              0 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$view</span><span class="keyword">-&gt;</span><span class="default">addFilterPath</span><span class="keyword">(</span><span class="default">'ZFViewfilter/View/Filter'</span><span class="keyword">,</span><span class="default">&nbsp;</span><span class="default">'ZFViewfilter_View_Filter'</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                  </span>
-<span class="lineNum" id="container66"><a name="66"></a><a href="#66" id="line66">      66</a> </span><span class="lineNoCov">              0 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$view</span><span class="keyword">-&gt;</span><span class="default">addFilter</span><span class="keyword">(</span><span class="default">'Show'</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                                                                      </span>
-<span class="lineNum" id="container67"><a name="67"></a><a href="#67" id="line67">      67</a> </span>                : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment">//&nbsp;&nbsp;&nbsp;&nbsp;We&nbsp;display&nbsp;content&nbsp;or&nbsp;an&nbsp;error&nbsp;message&nbsp;,&nbsp;the&nbsp;file&nbsp;is&nbsp;on&nbsp;the&nbsp;same&nbsp;path</span>                                                                                                                                                    
-<span class="lineNum" id="container68"><a name="68"></a><a href="#68" id="line68">      68</a> </span><span class="lineNoCov">              0 : <span class="default">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="default">$view</span><span class="keyword">-&gt;</span><span class="default">addFilter</span><span class="keyword">(</span><span class="default">'Contentcheck'</span><span class="keyword">)</span><span class="keyword">;</span>                                                                                                                                                                                              </span>
-<span class="lineNum" id="container69"><a name="69"></a><a href="#69" id="line69">      69</a> </span>                :                                                                                                                                                                                                                                        
-<span class="lineNum" id="container70"><a name="70&quo