PageRenderTime 53ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/cake/tests/test_app/controllers/tests_apps_posts_controller.php

https://github.com/hardsshah/bookmarks
PHP | 70 lines | 30 code | 3 blank | 37 comment | 0 complexity | 62d4a269fc1a2537e39ed30b6cb8028c MD5 | raw file
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * Short description for 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.test_app.plugins.test_plugin.views.helpers
  21. * @since CakePHP(tm) v 1.2.0.4206
  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. class TestsAppsPostsController extends AppController {
  28. var $name = 'TestsAppsPosts';
  29. var $uses = array('Post');
  30. var $viewPath = 'tests_apps';
  31. function add() {
  32. $data = array(
  33. 'Post' => array(
  34. 'title' => 'Test article',
  35. 'body' => 'Body of article.'
  36. )
  37. );
  38. $this->Post->save($data);
  39. $this->set('posts', $this->Post->find('all'));
  40. $this->render('index');
  41. }
  42. /**
  43. * check url params
  44. *
  45. */
  46. function url_var() {
  47. $this->set('params', $this->params);
  48. $this->render('index');
  49. }
  50. /**
  51. * post var testing
  52. *
  53. */
  54. function post_var() {
  55. $this->set('data', $this->data);
  56. $this->render('index');
  57. }
  58. /**
  59. * Fixturized action for testAction()
  60. *
  61. */
  62. function fixtured() {
  63. $this->set('posts', $this->Post->find('all'));
  64. $this->render('index');
  65. }
  66. }
  67. ?>