CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.10 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.10
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
      • Constraint
      • Fixture
      • Stub
    • Utility
    • Validation
    • View

Class MiddlewareDispatcher

Dispatches a request capturing the response for integration testing purposes into the Cake\Http stack.

Namespace: Cake\TestSuite

Property Summary

  • $_class protected
    string

    The application class name

  • $_constructorArgs protected
    array

    Constructor arguments for your application class.

  • $_test protected
    Cake\TestSuite\IntegrationTestCase

    The test case being run.

  • $app protected
    Cake\Core\HttpApplicationInterface|Cake\Core\ConsoleApplicationInterface

    The application that is being dispatched.

Method Summary

  • __construct() public

    Constructor

  • _createRequest() protected

    Create a PSR7 request from the request spec.

  • execute() public

    Run a request and get the response.

  • resolveRoute() protected

    Convert a URL array into a string URL via routing.

  • resolveUrl() public

    Resolve the provided URL into a string.

Method Detail

__construct() ¶ public

__construct(Cake\TestSuite\IntegrationTestCase $test, string|null $class = null, array|null $constructorArgs = null, bool $disableRouterReload = false)

Constructor

Parameters
Cake\TestSuite\IntegrationTestCase $test

The test case to run.

string|null $class optional

The application class name. Defaults to App\Application.

array|null $constructorArgs optional

The constructor arguments for your application class. Defaults to ['./config']

bool $disableRouterReload optional

Disable Router::reload() call when resolving URLs. This flag may be necessary if you are using Router methods in your test case setup, and using array URLs when doing requests in your tests.

Throws
LogicException
If it cannot load class for use in integration testing.

_createRequest() ¶ protected

_createRequest(array $spec): Psr\Http\Message\ServerRequestInterface

Create a PSR7 request from the request spec.

Parameters
array $spec

The request spec.

Returns
Psr\Http\Message\ServerRequestInterface

execute() ¶ public

execute(array $requestSpec): Psr\Http\Message\ResponseInterface

Run a request and get the response.

Parameters
array $requestSpec

The request spec to execute.

Returns
Psr\Http\Message\ResponseInterface

resolveRoute() ¶ protected

resolveRoute(array $url): string

Convert a URL array into a string URL via routing.

Parameters
array $url

The url to resolve

Returns
string

resolveUrl() ¶ public

resolveUrl(array|string $url): string

Resolve the provided URL into a string.

Parameters
array|string $url

The URL array/string to resolve.

Returns
string

Property Detail

$_class ¶ protected

The application class name

Type
string

$_constructorArgs ¶ protected

Constructor arguments for your application class.

Type
array

$_test ¶ protected

The test case being run.

Type
Cake\TestSuite\IntegrationTestCase

$app ¶ protected

The application that is being dispatched.

Type
Cake\Core\HttpApplicationInterface|Cake\Core\ConsoleApplicationInterface
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs