<commit_before>WP HTTP Testcase
================

PHPUnit testcase for testing code that uses WordPress's `WP_Http` class.

If you use `wp_remote_request()` or other wrappers for `WP_Http` methods in your
code, this makes it difficult to test, especially if the remote server may not be
reachable from your testing environment. This testcase solves this by letting you
route your requests to a different different host address, use a cached set of
responses, or just mock the remote responses by supplying artificial ones.

# Installation

You can install this package using composer:

```bash
composer require --dev jdgrimes/wp-http-testcase:~1.1
```

# Usage

To use it in your code, you need to first include the `wp-http-testcase.php` file in
your PHPUnit bootstrap file. If you will be using the host routing and response
caching features, you will need to call `WP_HTTP_TestCase::init()` in your
bootstrap file.

Then, in your tests that involve `WP_Http`, you need to extend `WP_HTTP_TestCase`
instead of `WP_UnitTestCase` as you normally would.<commit_msg>Not that different<commit_after>WP HTTP Testcase
================

PHPUnit testcase for testing code that uses WordPress's `WP_Http` class.

If you use `wp_remote_request()` or other wrappers for `WP_Http` methods in your
code, this makes it difficult to test, especially if the remote server may not be
reachable from your testing environment. This testcase solves this by letting you
route your requests to a different host address, use a cached set of
responses, or just mock the remote responses by supplying artificial ones.

# Installation

You can install this package using composer:

```bash
composer require --dev jdgrimes/wp-http-testcase:~1.1
```

# Usage

To use it in your code, you need to first include the `wp-http-testcase.php` file in
your PHPUnit bootstrap file. If you will be using the host routing and response
caching features, you will need to call `WP_HTTP_TestCase::init()` in your
bootstrap file.

Then, in your tests that involve `WP_Http`, you need to extend `WP_HTTP_TestCase`
instead of `WP_UnitTestCase` as you normally would.
{'fraction_non_alphanumeric': 0.07159679698539802, 'fraction_numerical': 0.0018841262364578427, 'mean_word_length': 4.966292134831461, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3330247', 'n_tokens_mistral': 583, 'n_tokens_neox': 558, 'n_words': 302}