assertEquals( true, $queue->is_queue_empty() ); $queue->push_to_queue( array( 'mock_key' => 'mock_value', ) ); $queue->save(); $this->assertEquals( false, $queue->is_queue_empty() ); } /** * Make sure the cron works. * * @return void */ public function test_schedule_cron_healthcheck() { require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-wc-mock-background-process.php' ); $queue = new WC_Mock_Background_Process(); $this->assertArraySubset( [ 'wp_woocommerce_mock_background_process_cron_interval' => [ 'interval' => 300, 'display' => 'Every 5 minutes' ] ], $queue->schedule_cron_healthcheck( array() ) ); } /** * Test to make sure a batch is returned. * * @return void */ public function test_get_batch() { require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-wc-mock-background-process.php' ); $queue = new WC_Mock_Background_Process(); $queue->push_to_queue( array( 'mock_key' => 'mock_value', ) ); $queue->save(); $this->assertNotEmpty( $queue->get_batch() ); } }