2017 © Pedro Peláez
 

library behat-table-parser

image

adamquaile/behat-table-parser

  • Sunday, February 22, 2015
  • by adamquaile
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Behat table parser

More fluent API for behat TableNodes., (*1)

Experimental. Need to implement sensible way of better integrating into context classes., (*2)

Usage

Tables used for single entities or key-value pairs:, (*3)

Given there is a table like this:
| Key1 | Value1 |
| Key2 | Value2 |

And a context method like this:, (*4)

public function thereIsATableLikeThis(TableNode $table)
{
    $table = (new SingleEntryTable($table))
        ->requires('Key1')
    ;
    $table->get('Key1');
}

(To be implemented next) Tables used for multiple entities:, (*5)

Given there is a table like this:
| Key1          | Key 2         | Key 3         |
| 1st Value 1   | 1st Value 2   | 1st Value 3   |
| 2nd Value 1   | 2nd Value 2   | 2nd Value 3   |
| 3rd Value 1   | 3rd Value 2   | 3rd Value 3   |

And a context method like this:, (*6)

public function thereIsATableLikeThis(TableNode $table)
{
    $table = (new MultipleEntityTable($table))
        ->requires('Key1')
        ->requires('Key2')
    ;
    $table->each(function() { ... });
    $table->row(0)->get('Key1')
}

The Versions

22/02 2015

dev-master

9999999-dev

  Sources   Download

The Requires

 

The Development Requires