Skip to content
Permalink
Browse files

Remove the context class.

It is really not warranted at this time. The input classes are even simpler if they have all their pre-requisite
data supplied to their render method.
  • Loading branch information...
markstory committed Jan 7, 2014
1 parent 013b62c commit b7839662560f55937afcff1e2085c30d89fbe697
Showing with 5 additions and 50 deletions.
  1. +0 −38 Cake/View/Input/Context.php
  2. +1 −4 Cake/View/Input/SelectBox.php
  3. +4 −8 Test/TestCase/View/Input/SelectBoxTest.php

This file was deleted.

Oops, something went wrong.
@@ -14,7 +14,6 @@
*/
namespace Cake\View\Input;
use Cake\View\Input\Context;
use Cake\View\StringTemplate;
/**
@@ -48,11 +47,9 @@ class SelectBox {
protected $_minimizedAttributeFormat = '%s="%s"';
protected $_templates;
protected $_context;
public function __construct($templates, $context) {
public function __construct($templates) {
$this->_templates = $templates;
$this->_context = $context;
}
public function render($data) {
@@ -15,7 +15,6 @@
namespace Cake\Test\TestCase\View\Input;
use Cake\TestSuite\TestCase;
use Cake\View\Input\Context;
use Cake\View\Input\SelectBox;
use Cake\View\StringTemplate;
@@ -43,8 +42,7 @@ public function setUp() {
* @return void
*/
public function testRenderNoOptions() {
$context = new Context();
$select = new SelectBox($this->templates, $context);
$select = new SelectBox($this->templates);
$data = [
'id' => 'BirdName',
'name' => 'Birds[name]',
@@ -64,8 +62,7 @@ public function testRenderNoOptions() {
* @return void
*/
public function testRenderSimple() {
$context = new Context();
$select = new SelectBox($this->templates, $context);
$select = new SelectBox($this->templates);
$data = [
'id' => 'BirdName',
'name' => 'Birds[name]',
@@ -87,8 +84,7 @@ public function testRenderSimple() {
* @return void
*/
public function testRenderSelected() {
$context = new Context();
$select = new SelectBox($this->templates, $context);
$select = new SelectBox($this->templates);
$data = [
'id' => 'BirdName',
'name' => 'Birds[name]',
@@ -175,7 +171,7 @@ public function testRenderDisabled() {
* @return void
*/
public function testRenderEmptyOption() {
$select = new SelectBox($this->templates, $context);
$select = new SelectBox($this->templates);
$data = [
'id' => 'BirdName',
'name' => 'Birds[name]',

0 comments on commit b783966

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