This behat extension allows a Context
object to access the client's IP address. The IP is aquired by requesting a Url (e.g. https://api.ipify.org/).
# behat.yml
default:
extensions:
Postcon\ClientIpExtension\Extension:
url: https://api.ipify.org/
Alternatively, the IP address can be fixed configured:
# 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
.