123456789101112131415161718192021222324252627282930 |
- <?php
- class SimpleWithDataProviderArrayCest
- {
- /**
- * @dataProvider getTestData
- *
- * @example ["fizz", "buzz"]
- * @example [null, "test"]
- */
- public function helloWorld(\CodeGuy $I, \Codeception\Example $example) {
- $I->execute(function($example) {
- if (!is_array($example)) {
- return false;
- }
- return count($example);
- })->seeResultEquals(2);
- }
- protected function getTestData()
- {
- return [
- ['foo', 'bar'],
- [1, 2],
- [true, false],
- ];
- }
- }
|