blumilksoftware / blt

Behat+Laravel toolbox. Still in progress.
https://packagist.org/packages/blumilksoftware/blt
3 stars 0 forks source link
behat hacktoberfest laravel laravel-package testing

Packagist PHP Version Support Packagist Version Packagist Downloads

🍔 blumilksoftware/blt

BLT for PHP developers: Behat+Laravel toolbox

Package is still under development.

Usage

To start using package if you don't already have Behat initialized in your project:

composer require blumilksfotware/blt --dev
php artisan blt:init

Or if you want to do that manually:

Use Composer to get package from the Packagist repository:

composer require blumilksfotware/blt --dev

Create .env.behat file in your project root directory and set up your environment variables for Behat.

cp .env.example .env.behat

Initialize Behat in your project:

php vendor/bin/behat --init

To learn more about Behat visit Behat documentation.

To use in your tests:

Bootstrap BLT in your FeatureContext file:

 public function __construct()
    {
        $bootstrapper = new LaravelBootstrapper();
        $bootstrapper->boot();
    }

If you want to include all suite of features, you can use:

use Blumilk\BLT\Features\Toolbox;
class FeatureContext extends Toolbox implements Context
{...}

Or to use selected traits:

use Blumilk\BLT\Features\Traits\Eloquent;
class FeatureContext implements Context
{
    use Eloquent;
    ...
}

Example usage in tests is available in the docs.

Development

There are scripts available for package codestyle checking and testing:

composer cs
composer csf
composer test

Docker

There is also the Docker Compose configuration available:

docker-compose up -d
docker-compose exec php php -v
docker-compose exec php composer -V

Please maintain our project guidelines: