Ejemplo n.º 1
0
 public function test_constants_are_used_when_database_options_are_empty()
 {
     \WP_Mock::wpFunction('get_option', array('args' => array('purgely-settings', array()), 'times' => 1, 'return' => array()));
     $settings = Purgely_Settings::get_settings();
     $this->assertEquals(PURGELY_FASTLY_KEY, $settings['fastly_key']);
 }
Ejemplo n.º 2
0
    /**
     * Render the setting input.
     *
     * @since 1.0.0.
     *
     * @return void
     */
    public function stale_if_error_ttl_render()
    {
        $options = Purgely_Settings::get_settings();
        ?>
		<input type='text' name='purgely-settings[stale_if_error_ttl]' value='<?php 
        echo esc_attr($options['stale_if_error_ttl']);
        ?>
'>
		<p class="description">
			<?php 
        esc_html_e('This setting determines the amount of time that stale content will be served while the origin is returning an error state.', 'purgely');
        ?>
		</p>
		<?php 
    }