| 1 | <?php |
||
| 7 | class SiteControllerTest extends \Codeception\Test\Unit |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var \andmemasin\emailsvalidator\UnitTester |
||
| 11 | */ |
||
| 12 | protected $tester; |
||
| 13 | |||
| 14 | /** @var SiteController */ |
||
| 15 | public $model; |
||
| 16 | |||
| 17 | protected function _before() |
||
| 25 | |||
| 26 | protected function _after() |
||
| 29 | |||
| 30 | // tests |
||
| 31 | public function testActionIndex() |
||
| 36 | } |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: