PageRenderTime 47ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/cake/tests/cases/libs/controller/pages_controller.test.php

https://github.com/hardsshah/bookmarks
PHP | 59 lines | 20 code | 2 blank | 37 comment | 0 complexity | 39fdd4b59feb5ddc22970200f8b584f5 MD5 | raw file
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * PagesControllerTest file
  5. *
  6. * Long description for file
  7. *
  8. * PHP versions 4 and 5
  9. *
  10. * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
  11. * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
  12. *
  13. * Licensed under The Open Group Test Suite License
  14. * Redistributions of files must retain the above copyright notice.
  15. *
  16. * @filesource
  17. * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
  18. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
  19. * @package cake
  20. * @subpackage cake.tests.cases.libs.controller
  21. * @since CakePHP(tm) v 1.2.0.5436
  22. * @version $Revision$
  23. * @modifiedby $LastChangedBy$
  24. * @lastmodified $Date$
  25. * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
  26. */
  27. App::import('Core', array('Controller', 'AppController', 'PagesController'));
  28. /**
  29. * PagesControllerTest class
  30. *
  31. * @package cake
  32. * @subpackage cake.tests.cases.libs.controller
  33. */
  34. class PagesControllerTest extends CakeTestCase {
  35. /**
  36. * testDisplay method
  37. *
  38. * @access public
  39. * @return void
  40. */
  41. function testDisplay() {
  42. Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS));
  43. $Pages =& new PagesController();
  44. $Pages->viewPath = 'posts';
  45. $Pages->display('index');
  46. $this->assertPattern('/posts index/', $Pages->output);
  47. $this->assertEqual($Pages->viewVars['page'], 'index');
  48. $this->assertEqual($Pages->pageTitle, 'Index');
  49. $Pages->viewPath = 'themed';
  50. $Pages->display('test_theme', 'posts', 'index');
  51. $this->assertPattern('/posts index themed view/', $Pages->output);
  52. $this->assertEqual($Pages->viewVars['page'], 'test_theme');
  53. $this->assertEqual($Pages->viewVars['subpage'], 'posts');
  54. $this->assertEqual($Pages->pageTitle, 'Index');
  55. }
  56. }
  57. ?>