SimpleWithDependencyInjectionCest.php 981 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace simpleDI {
  3. use \simpleDIHelpers\NeededHelper as Needed;
  4. class LoadedTestWithDependencyInjectionCest
  5. {
  6. public $a;
  7. public function __construct($optional = 'abc') {}
  8. public function _inject(Needed $a) { $this->a = $a; }
  9. public function testOne() {}
  10. public function testTwo() {}
  11. }
  12. abstract class SkippedAbstractCest
  13. {
  14. public function testNothing() {}
  15. }
  16. class SkippedWithPrivateConstructorCest
  17. {
  18. private function __construct() {}
  19. public function testNothing() {}
  20. }
  21. class AnotherCest
  22. {
  23. public function testSome() {}
  24. }
  25. }
  26. namespace simpleDIHelpers {
  27. class NeededHelper
  28. {
  29. public function _inject(AnotherHelper $a, YetAnotherHelper $b, $optionalParam = 123) {}
  30. }
  31. class AnotherHelper
  32. {
  33. public function __construct() {}
  34. }
  35. class YetAnotherHelper
  36. {
  37. public function __construct() {}
  38. }
  39. }