2017 © Pedro Peláez
 

library codeception-dataprovider

Codeception extension for supporting data-driven tests

image

edno/codeception-dataprovider

Codeception extension for supporting data-driven tests

  • Sunday, December 4, 2016
  • by edno
  • Repository
  • 2 Watchers
  • 2 Stars
  • 491 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 8 % Grown

The README.md

Codeception DataProvider

Latest Version Dependency Status Build Status SensioLabs Insight Scrutinizer Code Quality Coverage Status GitHub license, (*1)

The Codeception extension for supporting dynamic data driven tests (CEST) using @dataprovider annotation., (*2)

:bangbang: This extension is deprecated from Codeception 2.2.7. The @dataprovider annotation is now a core feature of Codeception (see PR#3737), (*3)

:bangbang: If you are running Codeception 2.2.7, then remove this extension by deleting the corresponding line in composer.json and your codeception.yml. No update required for existing tests using @dataprovider, (*4)

Minimum Requirements

  • Codeception 2.2
  • PHP 5.4

Installation

The extension can be installed using Composer, (*5)

$ composer require edno/codeception-dataprovider

Be sure to enable the extension in codeception.yml as shown in configuration below., (*6)

Configuration

Enabling DataProvider annotation in your tests is done in codeception.yml., (*7)

extensions:
    enabled:
        - Codeception\Extension\DataProvider

Usage

Once installed you will be to use the @dataprovider annotation for defining the method to be use for fetching the test data.
Your data source must be a public static function located within your test class. The method should return data compliant with the @example annotation., (*8)

Example

<?php

class ExampleDataProviderCest
{
     /**
      * @dataprovider __myDataSource
      */
      public function testWithDataProvider(FunctionalTester $I, \Codeception\Example $example)
      {
            $expected = ["", "foo", "bar", "re"];
            $I->assertInternalType('integer', $example[0]);
            $I->assertEquals($expected[$example[0]], $example[1]);
      }

      public static function __myDataSource()
      {
          return [
              [1, "foo"],
              [2, "bar"],
              [3, "re"]
          ];
      }
}

The Versions

04/12 2016

dev-master

9999999-dev https://github.com/edno/codeception-dataprovider

Codeception extension for supporting data-driven tests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Greg Heitz

extension data dataprovider codeception

04/12 2016

0.1.2

0.1.2.0 https://github.com/edno/codeception-dataprovider

Codeception extension for supporting data-driven tests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Greg Heitz

extension data dataprovider codeception

01/08 2016

0.1.1

0.1.1.0 https://github.com/edno/codeception-dataprovider

Codeception extension for supporting data-driven tests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Greg Heitz

extension data dataprovider codeception

31/07 2016

0.1.0

0.1.0.0 https://github.com/edno/codeception-dataprovider

Codeception extension for supporting data-driven tests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Greg Heitz

extension data dataprovider codeception