2008-08-23 17:28:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Short description for file.
|
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
|
|
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
2010-01-26 19:18:20 +00:00
|
|
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-08-23 17:28:08 +00:00
|
|
|
*
|
|
|
|
* Licensed under The Open Group Test Suite License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2010-01-26 19:18:20 +00:00
|
|
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-10-30 17:30:26 +00:00
|
|
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
2009-03-19 21:10:13 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers
|
|
|
|
* @since CakePHP(tm) v 1.2.0.4206
|
|
|
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
2008-08-23 17:28:08 +00:00
|
|
|
*/
|
|
|
|
class TestsAppsPostsController extends AppController {
|
|
|
|
var $name = 'TestsAppsPosts';
|
|
|
|
var $uses = array('Post');
|
|
|
|
var $viewPath = 'tests_apps';
|
|
|
|
|
|
|
|
function add() {
|
|
|
|
$data = array(
|
|
|
|
'Post' => array(
|
|
|
|
'title' => 'Test article',
|
2009-07-24 16:29:18 +00:00
|
|
|
'body' => 'Body of article.',
|
|
|
|
'author_id' => 1
|
2008-09-24 11:52:29 +00:00
|
|
|
)
|
2008-08-23 17:28:08 +00:00
|
|
|
);
|
|
|
|
$this->Post->save($data);
|
2008-09-24 11:52:29 +00:00
|
|
|
|
2008-08-23 17:28:08 +00:00
|
|
|
$this->set('posts', $this->Post->find('all'));
|
|
|
|
$this->render('index');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-17 16:39:39 +00:00
|
|
|
/**
|
|
|
|
* check url params
|
|
|
|
*
|
|
|
|
*/
|
2008-09-09 16:48:52 +00:00
|
|
|
function url_var() {
|
|
|
|
$this->set('params', $this->params);
|
|
|
|
$this->render('index');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-17 16:39:39 +00:00
|
|
|
/**
|
|
|
|
* post var testing
|
|
|
|
*
|
|
|
|
*/
|
2008-09-09 16:48:52 +00:00
|
|
|
function post_var() {
|
|
|
|
$this->set('data', $this->data);
|
|
|
|
$this->render('index');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-10-17 16:39:39 +00:00
|
|
|
/**
|
|
|
|
* Fixturized action for testAction()
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function fixtured() {
|
|
|
|
$this->set('posts', $this->Post->find('all'));
|
|
|
|
$this->render('index');
|
|
|
|
}
|
2008-08-23 17:28:08 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
?>
|