Behat


Behat\Behat\Formatter\PrettyFormatter
Behat/Behat/Formatter/PrettyFormatter.php at line 42

Class PrettyFormatter

ConsoleFormatter
└─ProgressFormatter
└─PrettyFormatter
All Known Subclasses:
HtmlFormatter

public class PrettyFormatter
extends ProgressFormatter

Pretty formatter.

Author:
Konstantin Kudryashov

Method Summary
protected array

getDefaultParameters()

{@inheritdoc}

static array

getSubscribedEvents()

Returns an array of event names this subscriber wants to listen to.

void

beforeSuite(SuiteEvent event)

Listens to "suite.before" event.

void

afterSuite(SuiteEvent event)

Listens to "suite.after" event.

void

beforeFeature(FeatureEvent event)

Listens to "feature.before" event.

void

afterFeature(FeatureEvent event)

Listens to "feature.after" event.

void

beforeBackground(BackgroundEvent event)

Listens to "background.before" event.

void

afterBackground(BackgroundEvent event)

Listens to "background.after" event.

void

beforeOutline(OutlineEvent event)

Listens to "outline.before" event.

void

beforeOutlineExample(OutlineExampleEvent event)

Listens to "outline.example.before" event.

void

afterOutlineExample(OutlineExampleEvent event)

Listens to "outline.example.after" event.

void

afterOutline(OutlineEvent event)

Listens to "outline.after" event.

void

beforeScenario(ScenarioEvent event)

Listens to "scenario.before" event.

void

afterScenario(ScenarioEvent event)

Listens to "scenario.after" event.

void

afterStep(StepEvent event)

Listens to "step.after" event.

protected void

printFeatureHeader(FeatureNode feature)

Prints feature header.

protected void

printFeatureOrScenarioTags(AbstractNode node)

Prints node tags.

protected void

printFeatureName(FeatureNode feature)

Prints feature keyword and name.

protected void

printFeatureDescription(FeatureNode feature)

Prints feature description.

protected void

printFeatureFooter(FeatureNode feature)

Prints feature footer.

protected void

printScenarioName(AbstractScenarioNode scenario)

Prints scenario keyword and name.

protected void

printScenarioPath(AbstractScenarioNode scenario)

Prints scenario definition path.

protected void

printBackgroundHeader(BackgroundNode background)

Prints background header.

protected void

printBackgroundFooter(BackgroundNode background)

Prints background footer.

protected void

printOutlineHeader(OutlineNode outline)

Prints outline header.

protected void

printOutlineFooter(OutlineNode outline)

Prints outline footer.

protected void

printOutlineExampleHeader(OutlineNode outline, integer iteration)

Prints outline example header.

protected void

printOutlineExampleFooter(OutlineNode outline, integer iteration, integer result, Boolean skipped)

Prints outline example result.

protected void

printOutlineSteps(OutlineNode outline)

Prints outline steps.

protected void

printOutlineExamplesSectionHeader(TableNode examples)

Prints outline examples header.

protected void

printOutlineExampleResult(TableNode examples, integer iteration, integer result, boolean isSkipped)

Prints outline example result.

protected void

printOutlineExampleResultExceptions(TableNode examples, array events)

Prints outline example exceptions.

protected void

printScenarioHeader(ScenarioNode scenario)

Prints scenario header.

protected void

printScenarioFooter(ScenarioNode scenario)

Prints scenario footer.

protected void

printStep(StepNode step, integer result, DefinitionInterface definition, string snippet, \Exception exception)

Prints step.

protected void

printStepBlock(StepNode step, DefinitionInterface definition, string color)

Prints step block (name & definition path).

protected void

printStepName(StepNode step, DefinitionInterface definition, string color)

Prints step name.

protected void

printStepDefinitionPath(StepNode step, DefinitionInterface definition)

Prints step definition path.

protected void

printStepArguments(array arguments, string color)

Prints step arguments.

protected void

printStepException(\Exception exception, string color)

Prints step exception.

protected void

printStepSnippet(DefinitionSnippet snippet)

Prints step snippet

protected void

printStepPyStringArgument(PyStringNode pystring, string color)

Prints PyString argument.

protected void

printStepTableArgument(TableNode table, string color)

Prints table argument.

protected void

printColorizedTableRow(array row, string color)

Prints table row in color.

protected void

printSuiteHeader(LoggerDataCollector logger)

Prints suite header.

protected void

printSuiteFooter(LoggerDataCollector logger)

Prints suite footer information.

protected string

getFeatureOrScenarioName(AbstractNode node, Boolean haveBaseIndent)

Returns feature or scenario name.

protected string

colorizeDefinitionArguments(string text, DefinitionInterface definition, string color)

Returns step text with colorized arguments.

protected integer

getMaxLineLength(integer max, AbstractScenarioNode scenario)

Returns max lines size for section elements.

Methods inherited from Behat\Behat\Formatter\ProgressFormatter
afterStep, afterSuite, getDefaultParameters, getSubscribedEvents, printExceptionEvents, printFailedSteps, printPathComment, printPendingSteps, printScenariosSummary, printSnippets, printStatusesSummary, printStep, printStepPath, printStepsSummary, printSummary, printTimeSummary, printUndefinedStepsSnippets, relativizePathsInString
Methods inherited from Behat\Behat\Formatter\ConsoleFormatter
__construct, configureOutputConsole, createOutputConsole, createOutputStream, exceptionToString, flushOutputConsole, getDefaultParameters, getParameter, getResultColorCode, getWritingConsole, hasParameter, setParameter, setTranslator, translate, translateChoice, write, writeln

Method Detail

Behat/Behat/Formatter/PrettyFormatter.php at line 102

getDefaultParameters

protected array getDefaultParameters()

{@inheritdoc}


Behat/Behat/Formatter/PrettyFormatter.php at line 125

getSubscribedEvents

public static array getSubscribedEvents()

Returns an array of event names this subscriber wants to listen to.

The array keys are event names and the value can be:

* The method name to call (priority defaults to 0) * An array composed of the method name to call and the priority * An array of arrays composed of the method names to call and respective priorities, or 0 if unset

For instance:

* array('eventName' => 'methodName') * array('eventName' => array('methodName', $priority)) * array('eventName' => array(array('methodName1', $priority), array('methodName2'))

Returns:
The event names to listen to

Behat/Behat/Formatter/PrettyFormatter.php at line 143

beforeSuite

public void beforeSuite(SuiteEvent event)

Listens to "suite.before" event.

Uses:
printSuiteHeader()

Behat/Behat/Formatter/PrettyFormatter.php at line 155

afterSuite

public void afterSuite(SuiteEvent event)

Listens to "suite.after" event.

Uses:
printSuiteFooter()

Behat/Behat/Formatter/PrettyFormatter.php at line 167

beforeFeature

public void beforeFeature(FeatureEvent event)

Listens to "feature.before" event.

Uses:
printFeatureHeader()

Behat/Behat/Formatter/PrettyFormatter.php at line 180

afterFeature

public void afterFeature(FeatureEvent event)

Listens to "feature.after" event.

Uses:
printFeatureFooter()

Behat/Behat/Formatter/PrettyFormatter.php at line 192

beforeBackground

public void beforeBackground(BackgroundEvent event)

Listens to "background.before" event.

Uses:
printBackgroundHeader()

Behat/Behat/Formatter/PrettyFormatter.php at line 210

afterBackground

public void afterBackground(BackgroundEvent event)

Listens to "background.after" event.

Uses:
printBackgroundFooter()

Behat/Behat/Formatter/PrettyFormatter.php at line 236

beforeOutline

public void beforeOutline(OutlineEvent event)

Listens to "outline.before" event.

Uses:
printOutlineHeader()

Behat/Behat/Formatter/PrettyFormatter.php at line 258

beforeOutlineExample

public void beforeOutlineExample(OutlineExampleEvent event)

Listens to "outline.example.before" event.

Uses:
printOutlineExampleHeader()

Behat/Behat/Formatter/PrettyFormatter.php at line 273

afterOutlineExample

public void afterOutlineExample(OutlineExampleEvent event)

Listens to "outline.example.after" event.

Uses:
printOutlineExampleFooter()

Behat/Behat/Formatter/PrettyFormatter.php at line 289

afterOutline

public void afterOutline(OutlineEvent event)

Listens to "outline.after" event.

Uses:
printOutlineFooter()

Behat/Behat/Formatter/PrettyFormatter.php at line 301

beforeScenario

public void beforeScenario(ScenarioEvent event)

Listens to "scenario.before" event.

Uses:
printScenarioHeader()

Behat/Behat/Formatter/PrettyFormatter.php at line 321

afterScenario

public void afterScenario(ScenarioEvent event)

Listens to "scenario.after" event.

Uses:
printScenarioFooter()

Behat/Behat/Formatter/PrettyFormatter.php at line 333

afterStep

public void afterStep(StepEvent event)

Listens to "step.after" event.

Uses:
printStep()

Behat/Behat/Formatter/PrettyFormatter.php at line 363

printFeatureHeader

protected void printFeatureHeader(FeatureNode feature)

Prints feature header.

Uses:
printFeatureOrScenarioTags()
printFeatureName()
printFeatureDescription()

Behat/Behat/Formatter/PrettyFormatter.php at line 379

printFeatureOrScenarioTags

protected void printFeatureOrScenarioTags(AbstractNode node)

Prints node tags.


Behat/Behat/Formatter/PrettyFormatter.php at line 403

printFeatureName

protected void printFeatureName(FeatureNode feature)

Prints feature keyword and name.

Uses:
getFeatureOrScenarioName()

Behat/Behat/Formatter/PrettyFormatter.php at line 413

printFeatureDescription

protected void printFeatureDescription(FeatureNode feature)

Prints feature description.


Behat/Behat/Formatter/PrettyFormatter.php at line 427

printFeatureFooter

protected void printFeatureFooter(FeatureNode feature)

Prints feature footer.


Behat/Behat/Formatter/PrettyFormatter.php at line 439

printScenarioName

protected void printScenarioName(AbstractScenarioNode scenario)

Prints scenario keyword and name.

Uses:
getFeatureOrScenarioName()
printScenarioPath()

Behat/Behat/Formatter/PrettyFormatter.php at line 459

printScenarioPath

protected void printScenarioPath(AbstractScenarioNode scenario)

Prints scenario definition path.

Uses:
getFeatureOrScenarioName()
printPathComment()

Behat/Behat/Formatter/PrettyFormatter.php at line 482

printBackgroundHeader

protected void printBackgroundHeader(BackgroundNode background)

Prints background header.

Uses:
printScenarioName()
printScenarioPath()

Behat/Behat/Formatter/PrettyFormatter.php at line 494

printBackgroundFooter

protected void printBackgroundFooter(BackgroundNode background)

Prints background footer.


Behat/Behat/Formatter/PrettyFormatter.php at line 507

printOutlineHeader

protected void printOutlineHeader(OutlineNode outline)

Prints outline header.

Uses:
printFeatureOrScenarioTags()
printScenarioName()

Behat/Behat/Formatter/PrettyFormatter.php at line 520

printOutlineFooter

protected void printOutlineFooter(OutlineNode outline)

Prints outline footer.


Behat/Behat/Formatter/PrettyFormatter.php at line 531

printOutlineExampleHeader

protected void printOutlineExampleHeader(OutlineNode outline, integer iteration)

Prints outline example header.


Behat/Behat/Formatter/PrettyFormatter.php at line 547

printOutlineExampleFooter

protected void printOutlineExampleFooter(OutlineNode outline, integer iteration, integer result, Boolean skipped)

Prints outline example result.

Parameters:
outline - outline instance
iteration - example row number
result - result code
skipped - is outline example skipped
Uses:
printOutlineSteps()
printOutlineExamplesSectionHeader()
printOutlineExampleResult()

Behat/Behat/Formatter/PrettyFormatter.php at line 563

printOutlineSteps

protected void printOutlineSteps(OutlineNode outline)

Prints outline steps.


Behat/Behat/Formatter/PrettyFormatter.php at line 581

printOutlineExamplesSectionHeader

protected void printOutlineExamplesSectionHeader(TableNode examples)

Prints outline examples header.

Uses:
printColorizedTableRow()

Behat/Behat/Formatter/PrettyFormatter.php at line 603

printOutlineExampleResult

protected void printOutlineExampleResult(TableNode examples, integer iteration, integer result, boolean isSkipped)

Prints outline example result.

Parameters:
examples - examples table
iteration - example row
result - result code
isSkipped - is outline example skipped
Uses:
printColorizedTableRow()
printOutlineExampleResultExceptions()

Behat/Behat/Formatter/PrettyFormatter.php at line 638

printOutlineExampleResultExceptions

protected void printOutlineExampleResultExceptions(TableNode examples, array events)

Prints outline example exceptions.

Parameters:
examples - examples table
events - failed steps events

Behat/Behat/Formatter/PrettyFormatter.php at line 663

printScenarioHeader

protected void printScenarioHeader(ScenarioNode scenario)

Prints scenario header.

Uses:
printFeatureOrScenarioTags()
printScenarioName()

Behat/Behat/Formatter/PrettyFormatter.php at line 676

printScenarioFooter

protected void printScenarioFooter(ScenarioNode scenario)

Prints scenario footer.


Behat/Behat/Formatter/PrettyFormatter.php at line 695

printStep

protected void printStep(StepNode step, integer result, DefinitionInterface definition, string snippet, \Exception exception)

Prints step.

Parameters:
step - step node
result - result code
definition - definition (if found one)
snippet - snippet (if step is undefined)
exception - exception (if step is failed)
Uses:
printStepBlock()
printStepArguments()
printStepException()
printStepSnippet()

Behat/Behat/Formatter/PrettyFormatter.php at line 723

printStepBlock

protected void printStepBlock(StepNode step, DefinitionInterface definition, string color)

Prints step block (name & definition path).

Parameters:
step - step node
definition - definition (if found one)
color - color code
Uses:
printStepName()
printStepDefinitionPath()

Behat/Behat/Formatter/PrettyFormatter.php at line 742

printStepName

protected void printStepName(StepNode step, DefinitionInterface definition, string color)

Prints step name.

Parameters:
step - step node
definition - definition (if found one)
color - color code
Uses:
colorizeDefinitionArguments()

Behat/Behat/Formatter/PrettyFormatter.php at line 763

printStepDefinitionPath

protected void printStepDefinitionPath(StepNode step, DefinitionInterface definition)

Prints step definition path.

Parameters:
step - step node
definition - definition (if found one)
Uses:
printPathComment()

Behat/Behat/Formatter/PrettyFormatter.php at line 793

printStepArguments

protected void printStepArguments(array arguments, string color)

Prints step arguments.

Parameters:
arguments - step arguments
color - color name
Uses:
printStepPyStringArgument()
printStepTableArgument()

Behat/Behat/Formatter/PrettyFormatter.php at line 810

printStepException

protected void printStepException(\Exception exception, string color)

Prints step exception.


Behat/Behat/Formatter/PrettyFormatter.php at line 827

printStepSnippet

protected void printStepSnippet(DefinitionSnippet snippet)

Prints step snippet


Behat/Behat/Formatter/PrettyFormatter.php at line 837

printStepPyStringArgument

protected void printStepPyStringArgument(PyStringNode pystring, string color)

Prints PyString argument.

Parameters:
pystring - pystring node
color - color name

Behat/Behat/Formatter/PrettyFormatter.php at line 857

printStepTableArgument

protected void printStepTableArgument(TableNode table, string color)

Prints table argument.


Behat/Behat/Formatter/PrettyFormatter.php at line 875

printColorizedTableRow

protected void printColorizedTableRow(array row, string color)

Prints table row in color.


Behat/Behat/Formatter/PrettyFormatter.php at line 891

printSuiteHeader

protected void printSuiteHeader(LoggerDataCollector logger)

Prints suite header.

Parameters:
logger - suite logger

Behat/Behat/Formatter/PrettyFormatter.php at line 903

printSuiteFooter

protected void printSuiteFooter(LoggerDataCollector logger)

Prints suite footer information.

Parameters:
logger - suite logger
Uses:
printSummary()
printUndefinedStepsSnippets()

Behat/Behat/Formatter/PrettyFormatter.php at line 917

getFeatureOrScenarioName

protected string getFeatureOrScenarioName(AbstractNode node, Boolean haveBaseIndent)

Returns feature or scenario name.


Behat/Behat/Formatter/PrettyFormatter.php at line 943

colorizeDefinitionArguments

protected string colorizeDefinitionArguments(string text, DefinitionInterface definition, string color)

Returns step text with colorized arguments.


Behat/Behat/Formatter/PrettyFormatter.php at line 1002

getMaxLineLength

protected integer getMaxLineLength(integer max, AbstractScenarioNode scenario)

Returns max lines size for section elements.

Parameters:
max - previous max value
scenario - element for calculations

Behat