Changeset 48937 for trunk/tests/phpunit/tests/cron.php
- Timestamp:
- 09/02/2020 12:35:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/cron.php
r47122 r48937 44 44 $scheduled = wp_schedule_single_event( $timestamp, $hook ); 45 45 $this->assertTrue( $scheduled ); 46 $this->assert Equals( $timestamp, wp_next_scheduled( $hook ) );46 $this->assertSame( $timestamp, wp_next_scheduled( $hook ) ); 47 47 48 48 // It's a non-recurring event. 49 $this->assert Equals( '',wp_get_schedule( $hook ) );49 $this->assertFalse( wp_get_schedule( $hook ) ); 50 50 51 51 } … … 60 60 $this->assertTrue( $scheduled ); 61 61 // This returns the timestamp only if we provide matching args. 62 $this->assert Equals( $timestamp, wp_next_scheduled( $hook, $args ) );62 $this->assertSame( $timestamp, wp_next_scheduled( $hook, $args ) ); 63 63 // These don't match so return nothing. 64 $this->assert Equals( false,wp_next_scheduled( $hook ) );65 $this->assert Equals( false,wp_next_scheduled( $hook, array( 'bar' ) ) );64 $this->assertFalse( wp_next_scheduled( $hook ) ); 65 $this->assertFalse( wp_next_scheduled( $hook, array( 'bar' ) ) ); 66 66 67 67 // It's a non-recurring event. 68 $this->assert Equals( '',wp_get_schedule( $hook, $args ) );68 $this->assertFalse( wp_get_schedule( $hook, $args ) ); 69 69 } 70 70 … … 78 78 $this->assertTrue( $scheduled ); 79 79 // It's scheduled for the right time. 80 $this->assert Equals( $timestamp, wp_next_scheduled( $hook ) );80 $this->assertSame( $timestamp, wp_next_scheduled( $hook ) ); 81 81 // It's a recurring event. 82 $this->assert Equals( $recur, wp_get_schedule( $hook ) );82 $this->assertSame( $recur, wp_get_schedule( $hook ) ); 83 83 } 84 84 … … 93 93 $this->assertTrue( $scheduled ); 94 94 // This returns the timestamp only if we provide matching args. 95 $this->assert Equals( $timestamp, wp_next_scheduled( $hook, $args ) );95 $this->assertSame( $timestamp, wp_next_scheduled( $hook, $args ) ); 96 96 // These don't match so return nothing. 97 $this->assert Equals( false,wp_next_scheduled( $hook ) );98 $this->assert Equals( false,wp_next_scheduled( $hook, array( 'bar' ) ) );99 100 $this->assert Equals( $recur, wp_get_schedule( $hook, $args ) );97 $this->assertFalse( wp_next_scheduled( $hook ) ); 98 $this->assertFalse( wp_next_scheduled( $hook, array( 'bar' ) ) ); 99 100 $this->assertSame( $recur, wp_get_schedule( $hook, $args ) ); 101 101 102 102 } … … 108 108 109 109 wp_schedule_single_event( $timestamp, $hook ); 110 $this->assert Equals( $timestamp, wp_next_scheduled( $hook ) );110 $this->assertSame( $timestamp, wp_next_scheduled( $hook ) ); 111 111 112 112 // Now unschedule it and make sure it's gone. 113 113 $unscheduled = wp_unschedule_event( $timestamp, $hook ); 114 114 $this->assertTrue( $unscheduled ); 115 $this->assert Equals( false,wp_next_scheduled( $hook ) );115 $this->assertFalse( wp_next_scheduled( $hook ) ); 116 116 } 117 117 … … 276 276 277 277 // The next event should be at +5 minutes, not +3. 278 $this->assert Equals( $ts1, wp_next_scheduled( $hook, $args ) );278 $this->assertSame( $ts1, wp_next_scheduled( $hook, $args ) ); 279 279 } 280 280 … … 295 295 296 296 // The next event should be at +3 minutes, even though that one was scheduled second. 297 $this->assert Equals( $ts2, wp_next_scheduled( $hook, $args ) );297 $this->assertSame( $ts2, wp_next_scheduled( $hook, $args ) ); 298 298 wp_unschedule_event( $ts2, $hook, $args ); 299 299 // Following event at +30 minutes should be there too. 300 $this->assert Equals( $ts1, wp_next_scheduled( $hook, $args ) );300 $this->assertSame( $ts1, wp_next_scheduled( $hook, $args ) ); 301 301 } 302 302 … … 314 314 315 315 // The next event should be at +3 minutes. 316 $this->assert Equals( $ts1, wp_next_scheduled( $hook, $args ) );316 $this->assertSame( $ts1, wp_next_scheduled( $hook, $args ) ); 317 317 wp_unschedule_event( $ts1, $hook, $args ); 318 318 // Following event should be there too. 319 $this->assert Equals( $ts2, wp_next_scheduled( $hook, $args ) );319 $this->assertSame( $ts2, wp_next_scheduled( $hook, $args ) ); 320 320 } 321 321 … … 471 471 472 472 $this->assertEquals( $expected, $actual ); 473 $this->assert Equals( $expected->timestamp, $actual2 );473 $this->assertSame( $expected->timestamp, $actual2 ); 474 474 } 475 475
Note: See TracChangeset
for help on using the changeset viewer.