You are here

class SilexApplicationTest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/stack/builder/tests/functional/SilexApplicationTest.php \functional\SilexApplicationTest

Hierarchy

Expanded class hierarchy of SilexApplicationTest

File

vendor/stack/builder/tests/functional/SilexApplicationTest.php, line 10

Namespace

functional
View source
class SilexApplicationTest extends \PHPUnit_Framework_TestCase {
  public function testWithAppendMiddlewares() {
    $app = new Application();
    $app
      ->get('/foo', function () {
      return 'bar';
    });
    $finished = false;
    $app
      ->finish(function () use (&$finished) {
      $finished = true;
    });
    $stack = new Builder();
    $stack
      ->push('functional\\Append', '.A')
      ->push('functional\\Append', '.B');
    $app = $stack
      ->resolve($app);
    $request = Request::create('/foo');
    $response = $app
      ->handle($request);
    $app
      ->terminate($request, $response);
    $this
      ->assertSame('bar.B.A', $response
      ->getContent());
    $this
      ->assertTrue($finished);
  }

}

Members