Skip to content

Commit

Permalink
Add initial config for WPBrowser.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion committed Jan 7, 2022
1 parent 6884f46 commit f8e1852
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -4,6 +4,8 @@
/vendor
/node_modules
/package-lock.json
/tests/_output/
/tests/_support/_generated
/tests/.env
/tests/cache
/tests/wordpress
9 changes: 9 additions & 0 deletions codeception.dist.yml
@@ -0,0 +1,9 @@
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
actor_suffix: Tester
params:
- env
12 changes: 9 additions & 3 deletions composer.json
Expand Up @@ -15,7 +15,15 @@
"composer/installers": "~1.0"
},
"require-dev": {
"codeception/module-asserts": "^1.0",
"codeception/module-phpbrowser": "^1.0",
"codeception/module-webdriver": "^1.0",
"codeception/module-db": "^1.0",
"codeception/module-filesystem": "^1.0",
"codeception/module-cli": "^1.0",
"codeception/util-universalframework": "^1.0",
"dealerdirect/phpcodesniffer-composer-installer": "0.7.0",
"lucatume/wp-browser": "^3.0",
"phpcompatibility/phpcompatibility-wp": "2.1.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
Expand All @@ -25,9 +33,7 @@
"szepeviktor/phpstan-wordpress": "^1.0",
"vlucas/phpdotenv": "^3",
"wp-cli/db-command": "^2",
"wp-coding-standards/wpcs": "2.3.0",
"wp-phpunit/wp-phpunit": "*",
"yoast/phpunit-polyfills": "^1.0"
"wp-coding-standards/wpcs": "2.3.0"
},
"config": {
"preferred-install": "dist",
Expand Down
Empty file added tests/_data/.gitkeep
Empty file.
Empty file added tests/_output/.gitkeep
Empty file.
22 changes: 22 additions & 0 deletions tests/_support/WpunitTester.php
@@ -0,0 +1,22 @@
<?php

/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void pause()
*/
class WpunitTester extends \Codeception\Actor {
use _generated\WpunitTesterActions;

/**
* Define custom actions here
*/
}
17 changes: 17 additions & 0 deletions tests/integration.suite.yml
@@ -0,0 +1,17 @@
# Codeception Test Suite Configuration
#
# Suite for integration tests that require WordPress functions and classes.

actor: WpunitTester
modules:
enabled:
- WPLoader
config:
WPLoader:
wpRootFolder: 'tests/wordpress'
dbName: '%TEST_DB_NAME%'
dbHost: '%TEST_DB_HOST%'
dbUser: '%TEST_DB_USER%'
dbPassword: '%TEST_DB_PASSWORD%'
plugins: ['query-monitor/query-monitor.php']
activatePlugins: ['query-monitor/query-monitor.php']

0 comments on commit f8e1852

Please sign in to comment.