You are here

class GardenerFake in Backup and migrate prune 7

Same name and namespace in other branches
  1. 7.2 backup_migrate_prune.test \GardenerFake

Fake gardener for test purposes

Hierarchy

Expanded class hierarchy of GardenerFake

File

./backup_migrate_prune.test, line 102
Test implementation file

View source
class GardenerFake extends Gardener {

  /**
   * Overwrites getDestination to return a fake destination
   */
  public function getDestination() {
    return new BackupMigrateDestinationFake();
  }

  /**
   * Overwrites getSettings to not to consult the DB
   */
  public function getSettings() {
    return array(
      'thisweek_slot' => array(
        'active' => TRUE,
      ),
      'thismonth_slot' => array(
        'active' => TRUE,
        'keep' => 4,
      ),
      'thisyear_slot' => array(
        'active' => TRUE,
        'keep' => 2,
      ),
      'pastyears_slot' => array(
        'active' => TRUE,
        'keep' => 10,
      ),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Gardener::$created private property Created timestamp
Gardener::$date_reference private property Time reference
Gardener::$destination private property Destination
Gardener::$id private property Numeric unique ID
Gardener::$name public property Name of the gardener
Gardener::$settings private property Array with the settings for the gardner
Gardener::arrangeFiles public function Organizes the files in the time slots according to the timestamp
Gardener::delete public function Delete the gardener from the persistent storage
Gardener::getCoworkers public function Get all gardeners associated with the destination of the current gardener
Gardener::getCreated public function Get the creation date for the gardener
Gardener::getId public function Get the id for the current gardener
Gardener::getName public function Get the name for the gardener
Gardener::INVALID_ID constant Error code INVALID_ID
Gardener::isNew protected function This method tells if the gardener is new and has not yet been persisted in the database
Gardener::load public function Load the settings of a gardener and return an instance of it.
Gardener::processPrune private function Tests if the file is elegible to be prunned and deletes it if necessary
Gardener::prune public function Delete the files that match the criteria
Gardener::save public function Persist the settings for this gardener
Gardener::setCreated public function Set the creation date for the gardener
Gardener::setDateReference public function Sets the Gardener::date_reference property.
Gardener::setDestination public function Set the destination for the gardener
Gardener::setName public function Set the name for the gardener
Gardener::setSettings public function Set the settings for a gardener
Gardener::__construct function
GardenerFake::getDestination public function Overwrites getDestination to return a fake destination Overrides Gardener::getDestination
GardenerFake::getSettings public function Overwrites getSettings to not to consult the DB Overrides Gardener::getSettings