Skip to content

Commit

Permalink
doc block updates and timeline helper
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Sep 16, 2013
1 parent 11d6430 commit 1527cce
Show file tree
Hide file tree
Showing 17 changed files with 328 additions and 28 deletions.
2 changes: 0 additions & 2 deletions Lib/Cache/Engine/MemcachedEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Cache.Engine
* @since CakePHP(tm) v 1.2.0.4933
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
Expand All @@ -31,7 +30,6 @@
* (if memcached extension compiled with --enable-igbinary).
* Compressed keys can also be incremented/decremented.
*
* @package Cake.Cache.Engine
*/
class MemcachedEngine extends CacheEngine {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/**
* Test case for DirectAuthentication
*
* @package Cake.Test.Case.Controller.Component.Auth
*/
class DirectAuthenticateTest extends CakeTestCase {

Expand Down
1 change: 0 additions & 1 deletion Test/Case/Controller/Component/Auth/TinyAuthorizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
/**
* Test case for DirectAuthentication
*
* @package Test.Case.Controller.Component.Auth
*/
class TinyAuthorizeTest extends MyCakeTestCase {

Expand Down
4 changes: 0 additions & 4 deletions Test/Case/Controller/Component/AutoLoginComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
/**
* Short description for class.
*
* @package cake.tests
* @subpackage cake.tests.cases.libs.controller.components
*/
class AutoLoginComponentTest extends CakeTestCase {

Expand Down Expand Up @@ -98,8 +96,6 @@ public function testLogin() {
/**
* Short description for class.
*
* @package cake.tests
* @subpackage cake.tests.cases.libs.controller.components
*/
class AutoLoginTestController extends Controller {
/**
Expand Down
2 changes: 0 additions & 2 deletions Test/Case/Model/Behavior/SluggedBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18226,8 +18226,6 @@ public function testDuplicateWithLengthRestriction() {
* MessageSlugged class
*
* @uses CakeTestModel
* @package mi
* @subpackage mi.tests.cases.behaviors
*/
class MessageSlugged extends CakeTestModel {

Expand Down
2 changes: 0 additions & 2 deletions Test/Case/View/Helper/DatetimeHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
/**
* Datetime Test Case
*
* @package cake.tests
* @subpackage cake.tests.cases.libs.view.helpers
*/
class DatetimeHelperTest extends MyCakeTestCase {

Expand Down
2 changes: 0 additions & 2 deletions Test/Case/View/Helper/FormExtHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ public function testNormalize() {
/**
* Contact class
*
* @package cake
* @package Cake.Test.Case.View.Helper
*/
class ContactExt extends CakeTestModel {

Expand Down
2 changes: 0 additions & 2 deletions Test/Case/View/Helper/QrCodeHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
/**
* QrCode Test Case
*
* @package cake.tests
* @subpackage cake.tests.cases.libs.view.helpers
*/
class QrCodeHelperTest extends MyCakeTestCase {
/**
Expand Down
71 changes: 71 additions & 0 deletions Test/Case/View/Helper/TimelineHelperTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php

App::uses('TimelineHelper', 'Tools.View/Helper');
App::uses('MyCakeTestCase', 'Tools.TestSuite');
App::uses('HtmlHelper', 'View/Helper');
App::uses('View', 'View');

/**
* Timeline Helper Test Case
*/
class TimelineHelperTest extends MyCakeTestCase {

public $Timeline;

/**
* TimelineHelperTest::setUp()
*
* @return void
*/
public function setUp() {
parent::setUp();

$this->Timeline = new TimelineTestHelper(new View(null));
$this->Timeline->Html = new HtmlHelper(new View(null));
}

/**
* @return void
*/
public function testAddItem() {
$data = array(
'start' => '',
'content' => '',
);
$this->Timeline->addItem($data);
$items = $this->Timeline->items();
$this->assertSame(1, count($items));

$data = array(
array(
'start' => '',
'content' => '',
),
array(
'start' => '',
'content' => '',
)
);
$this->Timeline->addItems($data);
$items = $this->Timeline->items();
$this->assertSame(3, count($items));
}

public function tearDown() {
parent::tearDown();

unset($this->Timeline);
}

}

class TimelineTestHelper extends TimelineHelper {

/**
* @return array
*/
public function items() {
return $this->_items;
}

}
2 changes: 0 additions & 2 deletions Test/Fixture/MessageFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*
* @copyright Copyright (c) 2008, Andy Dawson
* @link www.ad7six.com
* @package mi
* @subpackage mi.tests.fixtures
* @since v 1.0
* @modifiedBy $LastChangedBy$
* @lastModified $Date$
Expand Down
2 changes: 0 additions & 2 deletions Test/Fixture/SoftDeletePostFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/**
* Short description for class.
*
* @package cake
* @subpackage cake.tests.fixtures
*/
class SoftDeletePostFixture extends CakeTestFixture {

Expand Down
1 change: 0 additions & 1 deletion View/Helper/CaptchaHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*
* @author Mark Scherer
* @link http://www.dereuromark.de
* @package tools plugin
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

Expand Down
12 changes: 11 additions & 1 deletion View/Helper/FormExtHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ public function postLink($title, $url = null, $options = array(), $confirmMessag
}

/**
* Overwrite FormHelper::create() to allow disabling browser html5 validation via configs
* Overwrite FormHelper::create() to allow disabling browser html5 validation via configs.
* It also grabs inputDefaults from your Configure if set.
* Also adds the class "form-control" to all inputs for better control over them.
*
* @param string $model
* @param array $options
Expand All @@ -102,6 +104,14 @@ public function create($model = null, $options = array()) {
if (Configure::read('Validation.browserAutoRequire') === false && !isset($options['novalidate'])) {
$options['novalidate'] = true;
}
if (!isset($options['inputDefaults'])) {
$options['inputDefaults'] = array();
}
$options['inputDefaults'] += (array)Configure::read('Form.inputDefaults');
$options['inputDefaults'] += array(
'class' => array('form-control'),
);

return parent::create($model, $options);
}

Expand Down
3 changes: 1 addition & 2 deletions View/Helper/GoogleMapV3Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*
* @author Mark Scherer
* @link http://www.dereuromark.de/2010/12/21/googlemapsv3-cakephp-helper/
* @package tools plugin
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*
* fixed brackets, spacesToTabs, indends, some improvements, supports multiple maps now.
Expand Down Expand Up @@ -481,7 +480,7 @@ public function _initialLocation() {
*
* @param array $options
* - lat and lng or address (to geocode on demand, not recommended, though)
* - title, content, icon, directions (optional)
* - title, content, icon, directions, maxWidth (optional)
* @return int $markerCount or false on failure
* @throws CakeException
* 2010-12-18 ms
Expand Down
2 changes: 0 additions & 2 deletions View/Helper/GravatarHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
*
* @copyright Copyright 2009-2010, Graham Weldon (http://grahamweldon.com)
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @package goodies
* @subpackage goodies.views.helpers
*
* hashtype now always md5
* 2010-12-21 ms
Expand Down
Loading

0 comments on commit 1527cce

Please sign in to comment.