Router Actions

Centum\Codeception\Actions\RouterActions

grabRouter

Grab the Router from the Container.

grabRouter(): Centum\Interfaces\Router\RouterInterface

makeRouterGroup

Make a new group of Routes with an optional middleware.

makeRouterGroup(
    Centum\Interfaces\Router\MiddlewareInterface $middleware = null
): Centum\Interfaces\Router\GroupInterface

addRouterExceptionHandler

Add an Exception Handler to the Router.

addRouterExceptionHandler(
    class-string<Centum\Interfaces\Router\ExceptionHandlerInterface> $exceptionHandlerClass
): void

startFollowingRedirects

startFollowingRedirects(): void

stopFollowingRedirects

stopFollowingRedirects(): void

seeRouteExists

seeRouteExists(
    Centum\Interfaces\Http\RequestInterface $request
): void

seeRouteNotFound

seeRouteNotFound(
    Centum\Interfaces\Http\RequestInterface $request
): void

amOnPage

amOnPage(
    string $uri,
    array<non-empty-string, mixed> $params = []
): void

handleRequest

handleRequest(
    Centum\Interfaces\Http\RequestInterface $request
): Centum\Interfaces\Http\ResponseInterface

followRedirect

followRedirect(): Centum\Interfaces\Http\ResponseInterface

grabCurrentUri

grabCurrentUri(): string

seeCurrentUriEquals

seeCurrentUriEquals(
    string $expectedUri
): void

grabResponse

Grab the Response last created.

grabResponse(): Centum\Interfaces\Http\ResponseInterface

grabResponseContent

Grab the content from the Response last created.

grabResponseContent(): string

seeResponseContentEquals

seeResponseContentEquals(
    string $expectedContent
): void

seeResponseContentContains

seeResponseContentContains(
    string $expectedContent
): void

grabResponseCode

Grab the HTTP response code from the Response last created.

grabResponseCode(): positive-int

seeResponseCodeIs

See if the HTTP response code is an expected value.

seeResponseCodeIs(
    positive-int $expectedCode
): void

seeResponseCodeIsNot

See if the HTTP response code is NOT an expected value.

seeResponseCodeIsNot(
    positive-int $expectedCode
): void

seeResponseCodeIsSuccessful

See if the HTTP response code is 2xx.

seeResponseCodeIsSuccessful(): void

seeResponseCodeIsServerError

See if the HTTP response code is 5xx.

seeResponseCodeIsServerError(): void

seePageNotFound

See if the HTTP response code is 404.

seePageNotFound(): void