Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 64 lines (42 sloc) 1.361 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
<?php

/**
* Tests for the complete backup process both with
* the shell commands and with the PHP fallbacks
*
* @extends WP_UnitTestCase
*/
class testScheduleTestCase extends WP_UnitTestCase {

/**
* Contains the current backup schedule instance
*
* @var object
* @access protected
*/
protected $schedule;

/**
* Setup the backup object and create the tmp directory
*
* @access public
*/
public function setUp() {

$this->schedule = new HMBKP_Scheduled_Backup( 'unit-test' );

}

public function tearDown() {
unset( $this->schedule );
}

public function testDefaultReoccurrence() {

$this->assertEquals( 'weekly', $this->schedule->get_reoccurrence() );

}

public function testDefaultSchedule() {

$this->assertEquals( $this->schedule->get_schedule_start_time() + $this->schedule->get_interval(), $this->schedule->get_next_occurrence() );

}

public function testSetReoccurrence() {

$this->schedule->set_reoccurrence( 'daily' );

$this->assertEquals( 'daily', $this->schedule->get_reoccurrence() );

}

public function testSetSchedule() {

$this->schedule->set_reoccurrence( 'daily' );

$this->assertEquals( 'daily', $this->schedule->get_reoccurrence() );

$this->assertEquals( $this->schedule->get_schedule_start_time() + $this->schedule->get_interval(), $this->schedule->get_next_occurrence() );

}

}
Something went wrong with that request. Please try again.