Skip to content
This repository was archived by the owner on Nov 10, 2021. It is now read-only.

behat:compile

Ryan Gurnick edited this page Jul 14, 2016 · 2 revisions

#behat:compile

Example Command Syntax

php artian behat:compile <test number> <variable set number>

What it does

This command in the laravel suite will take a template file and generate a compiled feature file ready for execution using the variable and variable set system. This is mainly used as an internal command for behat:execute but it will also be implemented into the the web gui for the exporting of compiled feature files.

Process Hiercharchy

  • Get all of the variable inputs (Eg. test and set number)
  • Regex for all of the variables using the following expression /\[([a-zA-Z\/_]+)\]/
  • Foreach of the variables within the template file
    • Query the db for the variable in the variables table.
    • Uses str_replace to swap the content of the variable out for the content we define.
  • Take the content of the feature file with the variables replaced and compile a better .feature file. This is using the Gherkin Parser from the composer package "behat/gherkin": "^4.4",.
  • Write the data to a feature file

Clone this wiki locally