Download the PHP package jamesst20/kahlan-laravel without Composer

On this page you can find all versions of the php package jamesst20/kahlan-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kahlan-laravel

Jamesst20/kahlan-laravel

Kahlan is a full-featured Unit & BDD test framework a la RSpec/JSpec which uses a describe-it syntax and moves testing in PHP one step forward.

Why do I need this package

While it's true that you can use the vanilla Kahlan library, you cannot access to any of the Laravel TestCase helpers method.

Compatibility

Only Laravel 5.8 is currently supported because this library relies on phpdotenv v3.0 shipped with Laravel. It also only supports the latest Kahlan version (v4.6 as of now) because it is depedent on the new afterEach behavior deployed on v4.6.

Installation

Usage

Getting the application instance : $this->app, $this->laravel->app, app() are all equivalent ways and will return the same instance.

In a vanilla Laravel TestCase, we can access helpers by doing $this->insertHelperMethod such as $this->assertDatabaseHas('users', ['email' => '[email protected]']);

In a kahlan environment, it is as simple as prefixing the method with $this->laravel->insertHelperMethod.

Please note that $this->laraveland $this->app is not accessible in beforeAll, afterAll callback but is as soon as in beforeEach.

Example

Vanilla Laravel TestCase (PHPUnit)

Kahlan

Laravel Traits

The recommended way of enabling Laravel traits in Kahlan-Laravel is by passing an array of traits in the beforeAll() closure.

Currently supported traits RefreshDatabase, WithoutMiddleware, WithoutEvents, WithFaker

Environment

Environment variables are read in .env.testing and are also overriden by .env.kahlan

During initialization, before Kahlan is even loaded, if .env.testing exists, only this file is loaded. .env.kahlan is loaded a little later and will override .env.testing variables in case of collisions.

Please note that kahlan will raise an error if it is not executed in the testing environment.

Executing

There is currently 3 ways to execute kahlan but I am currently only supporting 2 officially.

Using artisan :

Using the binary

The difference between the 2 is that the binary will automatically read the APP_ENV from .env.testing or .env.kahlan before bootstraping.

Due to the current implementation of Laravel, there is no clean way to avoid the need to specify the APP_ENV=testing before the Artisan command. Laravel automatically loads .env if APP_ENV is undefined, otherwise .env.{environment}. While it would be possible to override .env with the testing ones, there could be some production variables that have no override candidate in the testing environment files.

What is missing

You tell me :) !

Credits

To all contributors of Laravel, Symfony and Kahlan.

This library was inspired by Sofa/laravel-kohlan and also elephantly/kahlan-bundle.


All versions of kahlan-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
laravel/framework Version ~5.8.0
kahlan/kahlan Version ^4.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jamesst20/kahlan-laravel contains the following files

Loading the files please wait ....