Skip to content
Permalink
Browse files

Fixing most of the strict errors in the helper test suite.

  • Loading branch information...
markstory committed Dec 13, 2010
1 parent f3445cd commit 017385d61c6059f3e546a2da6cb6957a2b34461d
@@ -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;
}
@@ -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.
@@ -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
@@ -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'),
@@ -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'),
@@ -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'),
@@ -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'),
@@ -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']);
@@ -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;
}
@@ -458,7 +458,7 @@ class ValidateUser extends CakeTestModel {
* @access public
* @return void
*/
function beforeValidate() {
function beforeValidate($options = array()) {
$this->invalidate('email');
return false;
}
@@ -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;
@@ -607,7 +607,7 @@ class ValidateItem extends CakeTestModel {
* @access public
* @return void
*/
function beforeValidate() {
function beforeValidate($options = array()) {
$this->invalidate('description');
return false;
}
@@ -108,7 +108,7 @@ function testChannel() {
'title',
'/title',
'<link',
RssHelper::url('/', true),
$this->Rss->url('/', true),
'/link',
'<description',
'content',
@@ -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',

0 comments on commit 017385d

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