Download the PHP package austp/peridot-gherkin-plugin without Composer

On this page you can find all versions of the php package austp/peridot-gherkin-plugin. 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 peridot-gherkin-plugin

peridot-gherkin-plugin

A Peridot plugin that adds a Gherkin style DSL.

Gherkin Style Tests

This is an example of a feature written in the Gherkin language. It looks nice but how do you convert this into a PHP test? This plugin will help you do that.

This plugin adds a DSL wrapper around Peridot so you can write your tests in a PHP-version of the Gherkin language. Here is an example for the above feature:

This is the output for the above test:

DSL

This plugin adds 6 primary functions: feature, background, scenario, isolatedScenario, stories, and isolatedStories and 2 secondary functions: focusNextStory and skipNextStory.

feature

Other available methods:
xfeature - Marks the feature as pending.
ffeature - Focuses the feature.

background

Note: It is possible to call background without supplying any strings to just add setup / teardown functions.

scenario

The scenario function is what determines what actually gets tested. Any string followed by a callable will be a "test". So in the above example, we had 2 tests. When something happens and Then something else happens because they were followed by a callable.

Notice that in the output, Given something had a check by it. This plugin assumes that if no callable is given after a string, the logic for the string will be handled in the next callable. (You could have a callable after the Given something argument, but oftentimes the logic is just a variable assignment which is untestable.)

If you fail to include a callable after including string arguments, they will be marked as pending tests.

Other available methods:
xscenario - Marks the scenario as pending.
fscenario - Focuses the scenario.

isolatedScenario

This behaves exactly as scenario except for one key difference. This scenario will run in a separate blocking process. This allows the tests defined in the scenario to be isolated from the rest of the tests.

An example use case for using isolatedScenario is when using Mockery to mock/spy a static method. The only way to accomplish this, is by making an alias. As long as the class hasn't been autoloaded yet, Mockery will load a fake class.

If you need access to the real class later on in your tests, there is no way to load it because Mockery has already loaded a class with the same name. But by running your tests in isolation, Mockery will load the fake class in a separate process. This leaves you free to load the real class when the time comes.

Here is an example to illustrate this use case. Assume we have a class named SomeClass that has a static method named makeSomethingElseHappen:

In the above example, the first scenario is run in isolation. This allows us to test the makeSomethingElseHappen method later on in our tests. (Note: Each feature call should be in its own file).

Other available methods:
xisolatedScenario - Marks the scenario as pending.
fisolatedScenario - Focuses the scenario.

stories

Although they don't fit in as nicely into the Gherkin language as scenarios do, sometimes it is helpful to define tests as stories rather than scenarios. This function will help you do that. It behaves identically to scenario except for the fact that it doesn't require a title argument as it's first parameter.

Other available methods:
xstories - Marks the stories as pending.
fstories - Focuses the stories.

isolatedStories

This behaves exactly as stories except it will run in a separate process. See isolatedScenario for more details about running in a separate process.

Other available methods:
xisolatedStories - Marks the stories as pending.
fisolatedStories - Focuses the stories.

focusNextStory

Sometimes it's useful to focus a single story in a collection of stories.

skipNextStory()

This is similar to focusNextStory, except it marks the next test to be skipped.

Installation / Setup

To install:

In your peridot.php file:

This will configure Peridot to:


All versions of peridot-gherkin-plugin with dependencies

PHP Build Version
Package Version
Requires peridot-php/peridot Version ^1.19
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 austp/peridot-gherkin-plugin contains the following files

Loading the files please wait ....