| 1 | <?php |
||
| 8 | class OAuth2MiddlewareTest extends \Codeception\TestCase\Test |
||
| 9 | { |
||
| 10 | use \Codeception\Specify; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var \UnitTester |
||
| 14 | */ |
||
| 15 | protected $tester; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var MockApplication |
||
| 19 | */ |
||
| 20 | protected $app; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @inheritdoc |
||
| 24 | */ |
||
| 25 | protected function setup() |
||
| 31 | |||
| 32 | /** |
||
| 33 | * |
||
| 34 | */ |
||
| 35 | public function testAssertValidAccessToken() |
||
| 45 | |||
| 46 | /** |
||
| 47 | * |
||
| 48 | */ |
||
| 49 | public function testAssertInvalidAccessToken() |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return \Illuminate\Http\Request |
||
| 63 | */ |
||
| 64 | private function createRequest() |
||
| 72 | } |
||
| 73 |
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: