ExamplesCest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. use Codeception\Example;
  3. class ExamplesCest
  4. {
  5. /**
  6. * @example(path=".", file="scenario.suite.yml")
  7. * @example(path=".", file="dummy.suite.yml")
  8. * @example(path=".", file="unit.suite.yml")
  9. */
  10. public function filesExistsAnnotation(ScenarioGuy $I, Example $example)
  11. {
  12. $I->amInPath($example['path']);
  13. $I->seeFileFound($example['file']);
  14. }
  15. /**
  16. * @example { "path":".", "file":"scenario.suite.yml" }
  17. * @example { "path":".", "file":"dummy.suite.yml" }
  18. * @example { "path":".", "file":"unit.suite.yml" }
  19. */
  20. public function filesExistsByJson(ScenarioGuy $I, Example $example)
  21. {
  22. $I->amInPath($example['path']);
  23. $I->seeFileFound($example['file']);
  24. }
  25. /**
  26. * @example [".", "scenario.suite.yml"]
  27. * @example [".", "dummy.suite.yml"]
  28. * @example [".", "unit.suite.yml"]
  29. */
  30. public function filesExistsByArray(ScenarioGuy $I, Example $example)
  31. {
  32. $I->amInPath($example[0]);
  33. $I->seeFileFound($example[1]);
  34. }
  35. /**
  36. * @example [{"path":".", "file":"scenario.suite.yml"}, {"path":".", "file":"dummy.suite.yml"}, {"path":".", "file":"unit.suite.yml"}]
  37. */
  38. public function filesExistsComplexJson(ScenarioGuy $I, Example $examples)
  39. {
  40. foreach ($examples as $example) {
  41. $I->amInPath($example['path']);
  42. $I->seeFileFound($example['file']);
  43. }
  44. }
  45. }