From d06bd0172edcf989cc3b0fbb01ab4cf51bc469d0 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 9 Dec 2016 23:11:28 +0000 Subject: [PATCH] Build/Test Tools: Remove commented out tests that have existed in an unimplemented state since the dawn of the test infrastructure. See #38716 git-svn-id: https://develop.svn.wordpress.org/trunk@39554 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/cron.php | 78 ------------------------------------ 1 file changed, 78 deletions(-) diff --git a/tests/phpunit/tests/cron.php b/tests/phpunit/tests/cron.php index 3beac80264..ee231d4b05 100644 --- a/tests/phpunit/tests/cron.php +++ b/tests/phpunit/tests/cron.php @@ -249,81 +249,3 @@ class Tests_Cron extends WP_UnitTestCase { $this->assertEquals( $ts2, wp_next_scheduled( $hook, $args ) ); } } - -/* - * Disable the WP Cron running test for the moment as it kills the whole test suite. - * TODO - Fix it to work with the new cron implementation in trunk - * -class WPTestCronRunning extends _WPEmptyBlog { - function setUp() { - parent::setUp(); - // make sure the schedule is clear - _set_cron_array(array()); - } - - function tearDown() { - parent::tearDown(); - // make sure the schedule is clear - _set_cron_array(array()); - } - function _do_cron() { - // FIXME: wp-cron.php is difficult to test, could be wrapped in a function - $_GET['check'] = wp_hash('187425'); - require(ABSPATH.'/wp-cron.php'); - } - - function test_run_schedule_single() { - // schedule an event, run it, and make sure the hook is called - $hook = __FUNCTION__; - $args = array(rand_str()); - $timestamp = strtotime('-1 second'); - - // register a test action - $a = new MockAction(); - add_action($hook, array(&$a, 'action')); - - // schedule an event for 1 second ago - wp_schedule_single_event( $timestamp, $hook, $args ); - $this->assertEquals( $timestamp, wp_next_scheduled($hook, $args) ); - - // run cron jobs - $this->_do_cron(); - - // our action should have been called once with the correct args - $this->assertEquals( 1, $a->get_call_count() ); - $this->assertEquals( array($args), $a->get_args() ); - - // it shouldn't appear in the schedule anymore - $this->assertFalse( wp_next_scheduled($hook, $args) ); - - } - - function test_run_schedule_recurring() { - // schedule a recurring event, run it, and make sure the hook is called - $hook = __FUNCTION__; - $args = array(rand_str()); - $timestamp = strtotime('-1 second'); - $recur = 'hourly'; - - // register a test action - $a = new MockAction(); - add_action($hook, array(&$a, 'action')); - - // schedule an event for 1 second ago - wp_schedule_event( $timestamp, $recur, $hook, $args ); - $this->assertEquals( $timestamp, wp_next_scheduled($hook, $args) ); - $this->assertEquals( $recur, wp_get_schedule($hook, $args) ); - - // run cron jobs - $this->_do_cron(); - - // our action should have been called once with the correct args - $this->assertEquals( 1, $a->get_call_count() ); - $this->assertEquals( array($args), $a->get_args() ); - - // it should appear in the schedule to run again in an hour's time - $this->assertEquals( $timestamp + 3600, wp_next_scheduled($hook, $args) ); - - } -} -*/