You are here

public function BuilderTest::unshiftMiddlewareShouldPutMiddlewareBeforePushed in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/stack/builder/tests/unit/Stack/BuilderTest.php \Stack\BuilderTest::unshiftMiddlewareShouldPutMiddlewareBeforePushed()

@test

File

vendor/stack/builder/tests/unit/Stack/BuilderTest.php, line 89

Class

BuilderTest
@covers Stack\Builder

Namespace

Stack

Code

public function unshiftMiddlewareShouldPutMiddlewareBeforePushed() {
  $app = $this
    ->getHttpKernelMock(new Response('ok'));
  $stack = new Builder();
  $stack
    ->push('Stack\\Append', '2.');
  $stack
    ->unshift('Stack\\Append', '1.');
  $resolved = $stack
    ->resolve($app);
  $request = Request::create('/');
  $response = $resolved
    ->handle($request);
  $this
    ->assertSame('ok2.1.', $response
    ->getContent());
}