Skip to content

Commit

Permalink
docd(mkdocs.yml) udpate toc, rename migration
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Feb 18, 2024
1 parent 5c44672 commit 6c35209
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

You can use wp-browser to test WordPress sites, plugins and themes.

An easy and quick setup, with a default configuration that will work for most projects, run end-to-end tests, integration tests and unit tests all wit the same tool.

## Requirements

Depending on the nature of your project, there are different requirements it will need to satisfy before getting started.
Expand Down
2 changes: 2 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ extensions:

Clear the monkey-patching cache.

Use the `--porcelain` or `-p` option to suppress any confirmation output.

[1]: https://wp-cli.org/

[2]: https://github.com/WordPress/wordpress-develop/tree/trunk/tests/phpunit
2 changes: 2 additions & 0 deletions docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ extensions:
In your tests, you can use the annotations or attributes as you would in a PHPUnit test:

```php
<?php
use lucatume\WPBrowser\TestCase\WPTestCase;
class IsolationExampleTest extends WPTestCase {
Expand Down
8 changes: 8 additions & 0 deletions docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ back-compatibility purposes.
2. If your test code is loading deprecated functions, arguments, classes, files, or hooks, you need to update your test
code to let the test case know using the `setExpectedDeprecated` method:
```php
<?php

use lucatume\WPBrowser\TestCase\WPTestCase;

class MyTestUsingDeprecatedCode extends WPTestCase {
Expand Down Expand Up @@ -90,6 +92,8 @@ back-compatibility purposes.

3. If your test code is directly modifying properties like `$expected_deprecated` or `$expected_doing_it_wrong` directly, you need to update your test code to use the `setExpectedDeprecated` and `setExpectedIncorrectUsage` methods:
```php
<?php

use lucatume\WPBrowser\TestCase\WPTestCase;
class MyTestUsingDeprecatedCode extends WPTestCase {
public function test_deprecated_function() {
Expand All @@ -109,6 +113,8 @@ back-compatibility purposes.
4. If your test code is knowingly triggering doing-it-wrong notices, you need to update your test code to let the test
case know using the `setExpectedIncorrectUsage` method:
```php
<?php

use lucatume\WPBrowser\TestCase\WPTestCase;
class MyTestUsingDoingItWrongTest extends WPTestCase {
public function test_it_can_use_doing_it_wrong() {
Expand All @@ -122,6 +128,8 @@ back-compatibility purposes.

5. Some assertion methods have, in more recent versions of the PHPUnit core suite, adopted stricter type checks when it comes to comparison. E.g., the `assertEqualFields` will now check the object to check the fields on is actually an object. Depending on how loose your use of assertions was before, you might have to update your work to make it pass the stricter checks:
```php
<?php

use lucatume\WPBrowser\TestCase\WPTestCase;

class MyTestUsingAssertEqualFields extends WPTestCase {
Expand Down
12 changes: 11 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ site_description: 'Documentation for the wp-browser WordPress testing framework.
site_author: 'Luca Tumedei'
nav:
- Getting started: 'README.md'
- Migrating to version 4: 'migration.md'
- Migrating to newer versions: 'migration.md'
- Default configuration: 'default-configuration.md'
- Custom configuration: 'custom-configuration.md'
- Modules:
Expand All @@ -25,6 +25,7 @@ nav:
- PHP Built-in Server Controller: 'extensions#builtinservercontroller'
- ChromeDriver Controller: 'extensions#chromedrivercontroller'
- Docker Compose Controller: 'extensions#dockercomposecontroller'
- Isolation Support: 'extensions#isolationsupport'
- Commands:
- run and codeception:run: 'commands#run-and-codeceptionrun'
- dev:start: 'commands#devstart'
Expand All @@ -34,6 +35,15 @@ nav:
- wp:db:export: 'commands#wpdbexport'
- chromedriver:update: 'commands#chromedriverupdate'
- generate:wpunit: 'commands#generatewpunit'
- generate:wpajax: 'commands#generatewpajax'
- generate:wpcanonical: 'commands#generatewpcanonical'
- generate:wprestapi: 'commands#generatewprestapi'
- generate:wprestcontroller: 'commands#generatewprestcontroller'
- generate:wprestposttypecontroller: 'commands#generatewprestposttypecontroller'
- generate:wpxml: 'commands#generatewpxml'
- generate:wpxmlrpc: 'commands#generatewpxmlrpc'
- monkey:cache:path: 'commands#monkeycachepath'
- monkey:cache:clear: 'commands#monkeycacheclear'
- Troubleshooting: 'troubleshooting.md'
- Sponsorship: 'https://github.com/sponsors/lucatume'
- Changelog: 'https://github.com/lucatume/wp-browser/blob/master/CHANGELOG.md'
Expand Down

0 comments on commit 6c35209

Please sign in to comment.