https://github.com/unb-libraries/trupal
Auto-generate automated testing.
https://github.com/unb-libraries/trupal
Last synced: about 1 year ago
JSON representation
Auto-generate automated testing.
- Host: GitHub
- URL: https://github.com/unb-libraries/trupal
- Owner: unb-libraries
- License: mit
- Created: 2019-11-29T14:51:23.000Z (over 6 years ago)
- Default Branch: dev
- Last Pushed: 2021-05-07T15:15:15.000Z (about 5 years ago)
- Last Synced: 2025-02-15T18:53:27.716Z (over 1 year ago)
- Language: PHP
- Size: 384 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trupal
A PHP framework to auto-generate common test cases independent of the test framework used to execute those tests.
# Installation
`composer require --dev unb-libraries/trupal`
## Trupal CLI
### Bash
Copy the following into your ```.bash_profile```
```shell
# Trupal alias
alias trupal='./vendor/unb-libraries/trupal/Console/trupal'
```
### Fish
Create a function in ```~/.config/fish/functions/trupal.fish``` with the following content:
```shell
function trupal -d "Execute Trupal commands"
./vendor/unb-libraries/trupal/Console/trupal $argv[1..-1];
end
```
# Usage
## Define a subject
A subject is a definition of a unit to be tested. Define one as follows:
```yaml
id: 'test_page'
type: 'page'
url: '/test/page/1'
public: FALSE
grant_access:
- member
```
This defines that there should be a non-public page under https://your.site.domain/test/page/1 which is expected to be accessible to any user with the user role `member` and inaccessible to anyone else.
## Generate test cases:
The easiest way to generate test cases is via the Trupal CLI:
```shell
trupal generate
```