Skip to content
Permalink
Browse files

Making view + helpers groups pass.

  • Loading branch information...
markstory committed Aug 28, 2010
1 parent dcb7a16 commit d8b2bcdf06cc33bacf1943c2479580d82a3fadfa
@@ -164,6 +164,7 @@ class Helper extends Object {
public function __construct(View $View, $settings = array()) {
$this->_View = $View;
$this->params = $View->params;
$this->request = $View->request;
if (!empty($this->helpers)) {
$this->_helperMap = ObjectCollection::normalizeObjectArray($this->helpers);
}
@@ -722,13 +723,13 @@ public function value($options = array(), $field = null, $key = 'value') {
$data = $this->request->data;
$entity = $this->_View->entity();
if (!empty($this->data) && !empty($entity)) {
$result = Set::extract($this->data, join('.', $entity));
if (!empty($data) && !empty($entity)) {
$result = Set::extract($data, join('.', $entity));
}
$habtmKey = $this->field();
if (empty($result) && isset($data[$habtmKey][$habtmKey])) {
$result = $this->data[$habtmKey][$habtmKey];
$result = $data[$habtmKey][$habtmKey];
} elseif (empty($result) && isset($data[$habtmKey]) && is_array($data[$habtmKey])) {
if (ClassRegistry::isKeySet($habtmKey)) {
$model =& ClassRegistry::getObject($habtmKey);
@@ -373,7 +373,7 @@ function testCacheWithNamedAndPassedArgs() {
Router::reload();
$this->Controller->cache_parsing();
$this->Controller->params = array(
$this->Controller->request->addParams(array(
'controller' => 'cache_test',
'action' => 'cache_parsing',
'url' => array(),
@@ -382,12 +382,11 @@ function testCacheWithNamedAndPassedArgs() {
'name' => 'mark',
'ice' => 'cream'
)
);
));
$this->Controller->cacheAction = array(
'cache_parsing' => 21600
);
$this->Controller->here = '/cache_test/cache_parsing/1/2/name:mark/ice:cream';
$this->Controller->action = 'cache_parsing';
$this->Controller->request->here = '/cache_test/cache_parsing/1/2/name:mark/ice:cream';
$View = new View($this->Controller);
$result = $View->render('index');
@@ -228,7 +228,8 @@ class ViewTest extends CakeTestCase {
function setUp() {
Router::reload();
$this->Controller = new Controller();
$this->PostsController = new ViewPostsController();
$request = $this->getMock('CakeRequest');
$this->PostsController = new ViewPostsController($request);
$this->PostsController->viewPath = 'posts';
$this->PostsController->index();
$this->View = new View($this->PostsController);
@@ -700,7 +701,7 @@ function testRenderLayoutWithMockCacheHelper() {
$_check = Configure::read('Cache.check');
Configure::write('Cache.check', true);
$Controller = new ViewPostsController();
$Controller = new ViewPostsController($this->getMock('CakeRequest'));
$Controller->cacheAction = '1 day';
$View = new View($Controller);
$View->helpers = array('Cache', 'Html', 'Session');

0 comments on commit d8b2bcd

Please sign in to comment.
You can’t perform that action at this time.