# jQuery Updater - PHPUnit Testing Setup

This branch includes PHPUnit testing for the jQuery Updater plugin.

## Installation

1. **Install WordPress test suite**:
   ```bash
   bash bin/install-wp-tests.sh wordpress_test root password localhost latest
   ```

2. **Install Composer dependencies**:
   ```bash
   composer install
   ```

## Running Tests

```bash
phpunit
```

Or with coverage:
```bash
phpunit --coverage-html coverage/
```

## Test Structure

- `phpunit.xml` - PHPUnit configuration
- `tests/bootstrap.php` - Test environment setup
- `tests/test-jquery-updater.php` - Test cases

## Test Coverage

The test suite covers:

- ✓ Plugin functions exist
- ✓ jQuery Core script registration (version 4.0.0)
- ✓ jQuery Migrate script registration (version 3.6.0)
- ✓ jQuery meta script setup with dependencies
- ✓ Activation hook behavior (transient setting)
- ✓ Proper hook attachment for script enqueuing
- ✓ Text domain loading on plugin load
- ✓ Admin notice functionality

## Setting up WordPress Test Environment

You'll need the WordPress test suite. Download it to a temp directory:

```bash
cd /tmp
git clone git://develop.git.wordpress.org/ wordpress-tests-lib
cd wordpress-tests-lib
cp wp-tests-config-sample.php wp-tests-config.php
# Edit wp-tests-config.php with your database credentials
```

Then set the environment variable:
```bash
export WP_TESTS_DIR=/tmp/wordpress-tests-lib
```

Or adjust the path in `tests/bootstrap.php` as needed.
