PHP code example of edno / codeception-dataprovider
1. Go to this page and download the library: Download edno/codeception-dataprovider library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
edno / codeception-dataprovider example snippets
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"]
];
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.