Skip to content

Commit

Permalink
Fixing most of the strict errors in the helper test suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 13, 2010
1 parent f3445cd commit 017385d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 27 deletions.
3 changes: 2 additions & 1 deletion cake/libs/view/helpers/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,8 @@ function label($fieldName = null, $text = null, $options = array()) {

if ($text === null) {
if (strpos($fieldName, '.') !== false) {
$text = array_pop(explode('.', $fieldName));
$fieldElements = explode('.', $fieldName);
$text = array_pop($fieldElements);
} else {
$text = $fieldName;
}
Expand Down
15 changes: 0 additions & 15 deletions cake/libs/view/helpers/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,6 @@ public function __call($method, $params) {
trigger_error(__('JsHelper:: Missing Method %s is undefined', $method), E_USER_WARNING);
}

/**
* Workaround for Object::Object() existing. Since Object::object exists, it does not
* fall into call__ and is not passed onto the engine helper. See JsBaseEngineHelper::object() for
* more information on this method.
*
* @param mixed $data Data to convert into JSON
* @param array $options Options to use for encoding JSON. See JsBaseEngineHelper::object() for more details.
* @return string encoded JSON
* @deprecated Remove when support for PHP4 and Object::object are removed.
*/
public function object($data = array(), $options = array()) {
return $this->{$this->__engineName}->object($data, $options);
}

/**
* Overwrite inherited Helper::value()
* See JsBaseEngineHelper::value() for more information on this method.
Expand Down Expand Up @@ -203,7 +189,6 @@ function value($val, $quoteString = true) {
*/
public function writeBuffer($options = array()) {
$domReady = $this->request->is('ajax');
// $domReady = isset($this->params['isAjax']) ? !$this->params['isAjax'] : true;
$defaults = array(
'onDomReady' => $domReady, 'inline' => true,
'cache' => false, 'clear' => true, 'safe' => true
Expand Down
8 changes: 4 additions & 4 deletions cake/tests/cases/libs/view/helper.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class HelperTestPost extends Model {
* @access public
* @return void
*/
function schema() {
function schema($field = false) {
$this->_schema = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
'title' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'),
Expand Down Expand Up @@ -85,7 +85,7 @@ class HelperTestComment extends Model {
* @access public
* @return void
*/
function schema() {
function schema($field = false) {
$this->_schema = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
'author_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
Expand Down Expand Up @@ -120,7 +120,7 @@ class HelperTestTag extends Model {
* @access public
* @return void
*/
function schema() {
function schema($field = false) {
$this->_schema = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
'name' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'),
Expand Down Expand Up @@ -153,7 +153,7 @@ class HelperTestPostsTag extends Model {
* @access public
* @return void
*/
function schema() {
function schema($field = false) {
$this->_schema = array(
'helper_test_post_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
'helper_test_tag_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
Expand Down
10 changes: 5 additions & 5 deletions cake/tests/cases/libs/view/helpers/form.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class ContactNonStandardPk extends Contact {
* @access public
* @return void
*/
function schema() {
function schema($field = false) {
$this->_schema = parent::schema();
$this->_schema['pk'] = $this->_schema['id'];
unset($this->_schema['id']);
Expand Down Expand Up @@ -389,7 +389,7 @@ class OpenidUrl extends CakeTestModel {
* @access public
* @return void
*/
function beforeValidate() {
function beforeValidate($options = array()) {
$this->invalidate('openid_not_registered');
return true;
}
Expand Down Expand Up @@ -458,7 +458,7 @@ class ValidateUser extends CakeTestModel {
* @access public
* @return void
*/
function beforeValidate() {
function beforeValidate($options = array()) {
$this->invalidate('email');
return false;
}
Expand Down Expand Up @@ -537,7 +537,7 @@ class ValidateProfile extends CakeTestModel {
* @access public
* @return void
*/
function beforeValidate() {
function beforeValidate($options = array()) {
$this->invalidate('full_name');
$this->invalidate('city');
return false;
Expand Down Expand Up @@ -607,7 +607,7 @@ class ValidateItem extends CakeTestModel {
* @access public
* @return void
*/
function beforeValidate() {
function beforeValidate($options = array()) {
$this->invalidate('description');
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions cake/tests/cases/libs/view/helpers/rss.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function testChannel() {
'title',
'/title',
'<link',
RssHelper::url('/', true),
$this->Rss->url('/', true),
'/link',
'<description',
'content',
Expand Down Expand Up @@ -462,7 +462,7 @@ function testItemCdata() {
'<description',
'<![CDATA[descriptive words]]',
'/description',
'enclosure' => array('url' => RssHelper::url('/test.flv', true)),
'enclosure' => array('url' => $this->Rss->url('/test.flv', true)),
'<pubDate',
date('r', strtotime('2008-05-31 12:00:00')),
'/pubDate',
Expand Down

0 comments on commit 017385d

Please sign in to comment.