bytic /
controllers
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Nip\Controllers\Tests\Traits; |
||||
| 4 | |||||
| 5 | use Nip\Controllers\Tests\AbstractTest; |
||||
| 6 | use Nip\Controllers\Tests\Fixtures\Controllers\BaseControllerWithUtilityMethods; |
||||
| 7 | use Nip\Http\Response\Response; |
||||
| 8 | |||||
| 9 | /** |
||||
| 10 | * Class ControllerActionCallTest |
||||
| 11 | * @package Nip\Controllers\Tests\Traits |
||||
| 12 | */ |
||||
| 13 | class ControllerActionCallTest extends AbstractTest |
||||
| 14 | { |
||||
| 15 | public function testCallActionEmptyMethod() |
||||
| 16 | { |
||||
| 17 | $controller = new BaseControllerWithUtilityMethods(); |
||||
| 18 | |||||
| 19 | self::expectException(\Exception::class); |
||||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||||
| 20 | $controller->callAction(); |
||||
| 21 | } |
||||
| 22 | |||||
| 23 | public function testBeforeAndAfterCalls() |
||||
| 24 | { |
||||
| 25 | $controller = new BaseControllerWithUtilityMethods(); |
||||
| 26 | $response = $controller->callAction('index'); |
||||
|
0 ignored issues
–
show
'index' of type string is incompatible with the type boolean expected by parameter $method of Nip\Controllers\Tests\Fi...tyMethods::callAction().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 27 | |||||
| 28 | self::assertInstanceOf(Response::class, $response); |
||||
| 29 | // var_dump($response);die(); |
||||
| 30 | self::assertTrue($response->hasHeader('beforeAction')); |
||||
| 31 | self::assertTrue($response->hasHeader('afterAction')); |
||||
| 32 | } |
||||
| 33 | } |
||||
| 34 |