Exemplo n.º 1
0
 public function setUp()
 {
     parent::setUp();
     WP_HTTP_TestCase::init();
     update_option('wpghs_repository', self::REPO_OPTION_VALUE);
     update_option('wpghs_oauth_token', self::TOKEN_OPTION_VALUE);
     update_option('wpghs_host', self::HOST_OPTION_VALUE);
     $this->http_responder = array($this, 'mock_github_api');
 }
Exemplo n.º 2
0
 public function setUp()
 {
     parent::setUp();
     WP_HTTP_TestCase::init();
     update_option('wpghs_repository', 'person/repo');
     update_option('wpghs_oauth_token', 'the-token');
     update_option('wpghs_host', 'github.api');
     $this->http_responder = array($this, 'mock_github_api');
     $this->api = new WordPress_GitHub_Sync_Api();
 }
Exemplo n.º 3
0
<?php

$_tests_dir = getenv('WP_TESTS_DIR');
if (!$_tests_dir) {
    $_tests_dir = '/tmp/wordpress-tests-lib';
}
require_once $_tests_dir . '/includes/functions.php';
function _manually_load_plugin()
{
    require dirname(__FILE__) . '/../wp-github-sync.php';
}
tests_add_filter('muplugins_loaded', '_manually_load_plugin');
require $_tests_dir . '/includes/bootstrap.php';
require dirname(__FILE__) . '/../vendor/jdgrimes/wp-http-testcase/wp-http-testcase.php';
WP_HTTP_TestCase::init();