class GardenerFake in Backup and migrate prune 7.2
Same name and namespace in other branches
- 7 backup_migrate_prune.test \GardenerFake
Fake gardener for test purposes
Hierarchy
- class \Gardener- class \GardenerFake
 
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
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| Gardener:: | private | property | Created timestamp | |
| Gardener:: | private | property | Time reference | |
| Gardener:: | private | property | Destination | |
| Gardener:: | private | property | Numeric unique ID | |
| Gardener:: | public | property | Name of the gardener | |
| Gardener:: | private | property | Array with the settings for the gardner | |
| Gardener:: | public | function | Organizes the files in the time slots according to the timestamp | |
| Gardener:: | public | function | Delete the gardener from the persistent storage | |
| Gardener:: | public | function | Get all gardeners associated with the destination of the current gardener | |
| Gardener:: | public | function | Get the creation date for the gardener | |
| Gardener:: | public | function | Get the id for the current gardener | |
| Gardener:: | public | function | Get the name for the gardener | |
| Gardener:: | constant | Error code INVALID_ID | ||
| Gardener:: | protected | function | This method tells if the gardener is new and has not yet been persisted in the database | |
| Gardener:: | public | function | Load the settings of a gardener and return an instance of it. | |
| Gardener:: | private | function | Tests if the file is elegible to be prunned and deletes it if necessary | |
| Gardener:: | public | function | Delete the files that match the criteria | |
| Gardener:: | public | function | Persist the settings for this gardener | |
| Gardener:: | public | function | Set the creation date for the gardener | |
| Gardener:: | public | function | Sets the Gardener::date_reference property. | |
| Gardener:: | public | function | Set the destination for the gardener | |
| Gardener:: | public | function | Set the name for the gardener | |
| Gardener:: | public | function | Set the settings for a gardener | |
| Gardener:: | function | |||
| GardenerFake:: | public | function | Overwrites getDestination to return a fake destination Overrides Gardener:: | |
| GardenerFake:: | public | function | Overwrites getSettings to not to consult the DB Overrides Gardener:: | 
