Download the PHP package brunty/kahlan-mink without Composer
On this page you can find all versions of the php package brunty/kahlan-mink. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brunty/kahlan-mink
More information about brunty/kahlan-mink
Files in brunty/kahlan-mink
Package kahlan-mink
Short Description Allows the use of Mink inside Kahlan
License MIT
Informations about the package kahlan-mink
Kahlan Mink
🌍 Provides functionality to work with Mink within Kahlan. Also provides a way to boot a PHP web server when tests run.
Inspired and based on this: http://radify.io/blog/end-to-end-functional-testing-with-kahan/ - many thanks to Simon JAILLET for not only Kahlan, but the blog post on end to end testing in Kahlan.
Requirements
- PHP >= 7.1
- Kahlan ^3.0
- Mink ^1.7
- Mink Goutte Driver ^1.2
Installation & Usage
composer require brunty/kahlan-mink --dev
Once required, setup your configuration file kahlan-config.php
to register mink with Kahlan (making sure to pass through $this
to the method):
If you want to start a PHP server when your tests start and stop it when test execution finishes then register the PhpServer with Kahlan as well:
If you want to use the url()
helper function, register a base URL in your config file under the brunty.kahlan-mink.base-url
key. All URLs via the url()
function will be appended to this.
Based on the above, calling url('my-page')
will return http://localhost:8888/my-page
Once that's done, you can use the functions to access things via Mink:
\Brunty\Kahlan\Mink\browser(string $sessionName = 'default'): Session
returns the instance of Mink inside our test suite.\Brunty\Kahlan\Mink\page($sessionName = 'default'): DocumentElement
returns the page we're currently accessing.\Brunty\Kahlan\Mink\element($locator = 'body', Element $parent = null): Element
find an element on the page we're browsing.
Contributing
This started as a small personal project.
Although this project is small, openness and inclusivity are taken seriously. To that end a code of conduct (listed in the contributing guide) has been adopted.
Contributor Guide