Boilerplate to use a Directus Instance to Build a Custom Website, Content will be Manage by Directus
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
940 B

5 years ago
  1. <?php
  2. /**
  3. * Flight: An extensible micro-framework.
  4. *
  5. * @copyright Copyright (c) 2012, Mike Cao <mike@mikecao.com>
  6. * @license MIT, http://flightphp.com/license
  7. */
  8. require_once 'vendor/autoload.php';
  9. require_once __DIR__.'/../flight/Flight.php';
  10. class RenderTest extends PHPUnit_Framework_TestCase
  11. {
  12. /**
  13. * @var \flight\Engine
  14. */
  15. private $app;
  16. function setUp() {
  17. $this->app = new \flight\Engine();
  18. $this->app->set('flight.views.path', __DIR__.'/views');
  19. }
  20. // Render a view
  21. function testRenderView(){
  22. $this->app->render('hello', array('name' => 'Bob'));
  23. $this->expectOutputString('Hello, Bob!');
  24. }
  25. // Renders a view into a layout
  26. function testRenderLayout(){
  27. $this->app->render('hello', array('name' => 'Bob'), 'content');
  28. $this->app->render('layouts/layout');
  29. $this->expectOutputString('<html>Hello, Bob!</html>');
  30. }
  31. }