Skip to content

Commit

Permalink
Merge pull request #5 from bluem-development/acceptance-test-setup
Browse files Browse the repository at this point in the history
Acceptance test basics and makefile
  • Loading branch information
DaanRijpkema authored Dec 29, 2023
2 parents e0daff1 + 1f4932a commit c7bfe67
Show file tree
Hide file tree
Showing 12 changed files with 2,898 additions and 1,182 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ bluem.zip
_notes
docker
._*
/tests/Support/_generated/AcceptanceTesterActions.php
/tests/Support/_generated/FunctionalTesterActions.php
/tests/Support/_generated/UnitTesterActions.php
/.php-cs-fixer.cache
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.DEFAULT_GOAL := help

.PHONY: help
help:
@printf '\nTo run a task: make <task_name>\n'
@printf '\nExamples:\n'
@printf '\- make install\n'
@printf '\- make test\n'
@printf '\- make unit_test\n'
@printf '\- make acceptance_test\n'
@printf '\- make add_git_hooks\n'

.PHONY: install
install:
composer install

.PHONY: lint
lint:
./tools/php-cs-fixer/vendor/bin/php-cs-fixer check .

.PHONY: lint_fix
lint_fix:
./tools/php-cs-fixer/vendor/bin/php-cs-fixer fix .

.PHONY: test
test: unit_test acceptance_test

.PHONY: unit_test
unit_test:
./vendor/bin/phpunit

.PHONY: acceptance_test
acceptance_test:
php vendor/bin/codecept run --steps

.PHONY: add_git_hooks
add_git_hooks:
sh ./scripts/add-git-hooks.sh

25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,31 @@ This plug-in requires PHP >= 7.4 | PHP >= 8.0, which is the standard WordPress r
If you use our plug-in files or databases in your own custom development, please disable auto-update and check each update manually before installing.
Our plug-in files or database tables structure may change during time.


## Development & testing
### Before you start developing
Run
```bash
make add_git_hooks
```
to enable git hooks, which will automatically run **unit** tests and CS linting (soon) before any commit.

- Also if you want to lint or use automatic lint-fixes, ensure that the PHP CS fixer is installed in the `tools` folder.

### Unit testing

```bash
make unit_test
```

### Acceptance testing
Your local environment (a WordPress website instance has to be running, at [localhost:8000]()).

```bash
make acceptance_test
```


# Installation
<!-- If you want to install this plug-in, the easiest way is to use the WordPress plug-in directly from the WordPress plug-in directory here: -->

Expand Down
12 changes: 12 additions & 0 deletions codeception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace: Tests
support_namespace: Support
paths:
tests: tests
output: tests/_output
data: tests/Support/Data
support: tests/Support
envs: tests/_envs
actor_suffix: Tester
extensions:
enabled:
- Codeception\Extension\RunFailed
14 changes: 12 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
"license": "GPL-2.0-or-later",
"description": "WordPress and WooCommerce plug-in for identity, payment and mandate services.",
"keywords": [
"bluem", "payment", "identity", "emandates", "woocommerce", "idin","iban-name-check","iban"
"bluem",
"payment",
"identity",
"emandates",
"woocommerce",
"idin",
"iban-name-check",
"iban"
],
"support": {
"issues": "https://github.com/bluem-development/bluem-woocommerce"
Expand All @@ -23,7 +30,10 @@
"require-dev": {
"phpunit/phpunit": "^9.5",
"yoast/phpunit-polyfills": "^1.0",
"vimeo/psalm": "^4.16"
"vimeo/psalm": "^4.16",
"codeception/codeception": "^5.0",
"codeception/module-phpbrowser": "*",
"codeception/module-asserts": "*"
},
"config": {
"allow-plugins": {
Expand Down
Loading

0 comments on commit c7bfe67

Please sign in to comment.