https://github.com/postcon/clientipextension
https://github.com/postcon/clientipextension
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/postcon/clientipextension
- Owner: Postcon
- License: mit
- Created: 2016-02-01T07:40:22.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-02T21:08:11.000Z (over 10 years ago)
- Last Synced: 2025-10-02T04:38:46.352Z (9 months ago)
- Language: PHP
- Size: 9.77 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ClientIpExtension
This behat extension allows a [`Context`](https://github.com/Behat/Behat/blob/master/src/Behat/Behat/Context/Context.php) object to access the client's IP address. The IP is aquired by requesting a Url (e.g. https://api.ipify.org/).
```yaml
# behat.yml
default:
extensions:
Postcon\ClientIpExtension\Extension:
url: https://api.ipify.org/
```
Alternatively, the IP address can be fixed configured:
```yaml
# behat.yml
default:
extensions:
Postcon\ClientIpExtension\Extension:
value: 1.2.3.4
```
To access the client's IP address, the behat Context class needs to implement [`Postcon\ClientIpExtension\ClientIpInterface`](lib/ClientIpInterface).