function test_pmp_get_updates() { if ($this->skip) { $this->markTestSkipped('This test requires site options `pmp_api_url`, `pmp_client_id` and `pmp_client_secret`'); return; } $success = true; try { pmp_get_updates(); } catch (Exception $e) { $success = false; } $this->assertTrue($success); }
/** * On the scheduled action hook, run the function. * * @since 0.1 */ function pmp_hourly_cron() { $options = get_option('pmp_settings'); if (!isset($options['pmp_use_api_notifications']) || $options['pmp_use_api_notifications'] !== 'on') { pmp_get_updates(); } pmp_import_for_saved_queries(); }