Browse Source

Merge remote-tracking branch 'origin/2.6' into 3.0

Conflicts:
	lib/Cake/Cache/Engine/RedisEngine.php
	lib/Cake/Controller/Component/Acl/AclInterface.php
	lib/Cake/Controller/Component/Acl/DbAcl.php
	lib/Cake/Controller/Component/Acl/IniAcl.php
	lib/Cake/Controller/Component/Acl/PhpAcl.php
	lib/Cake/Core/App.php
	lib/Cake/Model/Behavior/AclBehavior.php
	lib/Cake/Model/Behavior/TranslateBehavior.php
	lib/Cake/Model/Behavior/TreeBehavior.php
	lib/Cake/Model/BehaviorCollection.php
	lib/Cake/Model/Datasource/CakeSession.php
	lib/Cake/Model/Datasource/Database/Mysql.php
	lib/Cake/Model/Datasource/Database/Postgres.php
	lib/Cake/Model/Datasource/Database/Sqlserver.php
	lib/Cake/Model/Model.php
	lib/Cake/Test/Case/Model/ModelWriteTest.php
	lib/Cake/TestSuite/CakeTestLoader.php
	lib/Cake/TestSuite/CakeTestRunner.php
	lib/Cake/TestSuite/CakeTestSuiteCommand.php
	lib/Cake/TestSuite/ControllerTestCase.php
	lib/Cake/TestSuite/Coverage/BaseCoverageReport.php
	lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php
	lib/Cake/TestSuite/Fixture/CakeTestModel.php
	lib/Cake/TestSuite/Reporter/CakeBaseReporter.php
	lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
	lib/Cake/Utility/Sanitize.php
	lib/Cake/Utility/Set.php
	lib/Cake/View/Helper/FormHelper.php
	src/Auth/BasicAuthenticate.php
	src/Network/Email/AbstractTransport.php
	src/Network/Email/Email.php
	src/Network/Email/SmtpTransport.php
	src/TestSuite/TestCase.php
	src/Utility/String.php
	src/View/Helper/HtmlHelper.php
	tests/TestCase/View/Helper/HtmlHelperTest.php
mark_story 11 years ago
parent
commit
e96a39d1ca

+ 15 - 7
src/Auth/BasicAuthenticate.php

@@ -1,6 +1,5 @@
 <?php
 /**
- *
  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  *
@@ -23,10 +22,9 @@ use Cake\Network\Response;
 /**
  * Basic Authentication adapter for AuthComponent.
  *
- * Provides Basic HTTP authentication support for AuthComponent. Basic Auth will authenticate users
- * against the configured userModel and verify the username and passwords match. Clients using Basic Authentication
- * must support cookies. Since AuthComponent identifies users based on Session contents, clients using Basic
- * Auth must support cookies.
+ * Provides Basic HTTP authentication support for AuthComponent. Basic Auth will
+ * authenticate users against the configured userModel and verify the username
+ * and passwords match.
  *
  * ### Using Basic auth
  *
@@ -39,8 +37,18 @@ use Cake\Network\Response;
  *	);
  * }}}
  *
- * In your login function just call `$this->Auth->login()` without any checks for POST data. This
- * will send the authentication headers, and trigger the login dialog in the browser/client.
+ * You should also set `AuthComponent::$sessionKey = false;` in your AppController's
+ * beforeFilter() to prevent CakePHP from sending a session cookie to the client.
+ *
+ * Since HTTP Basic Authentication is stateless you don't need a login() action
+ * in your controller. The user credentials will be checked on each request. If
+ * valid credentials are not provided, required authentication headers will be sent
+ * by this authentication provider which triggers the login dialog in the browser/client.
+ *
+ * You may also want to use `$this->Auth->unauthorizedRedirect = false;`.
+ * By default unauthorized user is redirected to the referrer URL or
+ * AuthComponent::$loginAction or '/'. If unauthorizedRedirect is set to false a
+ * ForbiddenException exception is thrown instead of redirecting.
  */
 class BasicAuthenticate extends BaseAuthenticate {
 

+ 1 - 1
src/Core/App.php

@@ -38,7 +38,7 @@ use Cake\Utility\Inflector;
  *
  * ### Locating plugins
  *
- * Plugins can be located with App as well. Using App::pluginPath('DebugKit') for example, will
+ * Plugins can be located with App as well. Using Plugin::path('DebugKit') for example, will
  * give you the full path to the DebugKit plugin.
  *
  * ### Inspecting known objects

+ 1 - 1
src/Network/Email/AbstractTransport.php

@@ -42,7 +42,7 @@ abstract class AbstractTransport {
 /**
  * Constructor
  *
- * @param array $config The configuration data for the transport.
+ * @param array $config Configuration options.
  */
 	public function __construct($config = []) {
 		$this->config($config);

+ 67 - 48
src/Network/Email/Email.php

@@ -368,8 +368,9 @@ class Email {
 /**
  * From
  *
- * @param string|array $email
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return array|\Cake\Network\Email\Email
  * @throws \Cake\Network\Error\SocketException
  */
@@ -383,8 +384,9 @@ class Email {
 /**
  * Sender
  *
- * @param string|array $email
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return array|\Cake\Network\Email\Email
  * @throws \Cake\Network\Error\SocketException
  */
@@ -398,8 +400,9 @@ class Email {
 /**
  * Reply-To
  *
- * @param string|array $email
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return array|\Cake\Network\Email\Email
  * @throws \Cake\Network\Error\SocketException
  */
@@ -413,8 +416,9 @@ class Email {
 /**
  * Read Receipt (Disposition-Notification-To header)
  *
- * @param string|array $email
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return array|\Cake\Network\Email\Email
  * @throws \Cake\Network\Error\SocketException
  */
@@ -428,8 +432,9 @@ class Email {
 /**
  * Return Path
  *
- * @param string|array $email
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return array|\Cake\Network\Email\Email
  * @throws \Cake\Network\Error\SocketException
  */
@@ -443,8 +448,9 @@ class Email {
 /**
  * To
  *
- * @param string|array $email Null to get, String with email, Array with email as key, name as value or email as value (without name)
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return array|\Cake\Network\Email\Email
  */
 	public function to($email = null, $name = null) {
@@ -457,8 +463,9 @@ class Email {
 /**
  * Add To
  *
- * @param string|array $email String with email, Array with email as key, name as value or email as value (without name)
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return \Cake\Network\Email\Email $this
  */
 	public function addTo($email, $name = null) {
@@ -468,8 +475,9 @@ class Email {
 /**
  * Cc
  *
- * @param string|array $email String with email, Array with email as key, name as value or email as value (without name)
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return array|\Cake\Network\Email\Email
  */
 	public function cc($email = null, $name = null) {
@@ -482,8 +490,9 @@ class Email {
 /**
  * Add Cc
  *
- * @param string|array $email String with email, Array with email as key, name as value or email as value (without name)
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return \Cake\Network\Email\Email $this
  */
 	public function addCc($email, $name = null) {
@@ -493,8 +502,9 @@ class Email {
 /**
  * Bcc
  *
- * @param string|array $email String with email, Array with email as key, name as value or email as value (without name)
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return array|\Cake\Network\Email\Email
  */
 	public function bcc($email = null, $name = null) {
@@ -507,8 +517,9 @@ class Email {
 /**
  * Add Bcc
  *
- * @param string|array $email String with email, Array with email as key, name as value or email as value (without name)
- * @param string $name
+ * @param string|array $email Null to get, String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return \Cake\Network\Email\Email $this
  */
 	public function addBcc($email, $name = null) {
@@ -518,8 +529,8 @@ class Email {
 /**
  * Charset setter/getter
  *
- * @param string $charset
- * @return string this->charset
+ * @param string $charset Character set.
+ * @return string $this->charset
  */
 	public function charset($charset = null) {
 		if ($charset === null) {
@@ -535,8 +546,8 @@ class Email {
 /**
  * HeaderCharset setter/getter
  *
- * @param string $charset
- * @return string this->charset
+ * @param string $charset Character set.
+ * @return string $this->charset
  */
 	public function headerCharset($charset = null) {
 		if ($charset === null) {
@@ -562,9 +573,10 @@ class Email {
 /**
  * Set email
  *
- * @param string $varName
- * @param string|array $email
- * @param string $name
+ * @param string $varName Property name
+ * @param string|array $email String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return \Cake\Network\Email\Email $this
  * @throws \Cake\Network\Error\SocketException
  */
@@ -609,10 +621,11 @@ class Email {
 /**
  * Set only 1 email
  *
- * @param string $varName
- * @param string|array $email
- * @param string $name
- * @param string $throwMessage
+ * @param string $varName Property name
+ * @param string|array $email String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
+ * @param string $throwMessage Exception message
  * @return \Cake\Network\Email\Email $this
  * @throws \Cake\Network\Error\SocketException
  */
@@ -629,9 +642,10 @@ class Email {
 /**
  * Add email
  *
- * @param string $varName
- * @param string|array $email
- * @param string $name
+ * @param string $varName Property name
+ * @param string|array $email String with email,
+ *   Array with email as key, name as value or email as value (without name)
+ * @param string $name Name
  * @return \Cake\Network\Email\Email $this
  * @throws \Cake\Network\Error\SocketException
  */
@@ -659,7 +673,7 @@ class Email {
 /**
  * Get/Set Subject.
  *
- * @param string $subject
+ * @param string $subject Subject string.
  * @return string|\Cake\Network\Email\Email
  */
 	public function subject($subject = null) {
@@ -688,8 +702,8 @@ class Email {
 /**
  * Add header for the message
  *
- * @param array $headers
- * @return object this
+ * @param array $headers Headers to set.
+ * @return object $this
  * @throws \Cake\Network\Error\SocketException
  */
 	public function addHeaders($headers) {
@@ -714,14 +728,19 @@ class Email {
  * - `bcc`
  * - `subject`
  *
- * @param array $include
+ * @param array $include List of headers.
  * @return array
  */
 	public function getHeaders(array $include = array()) {
 		if ($include == array_values($include)) {
 			$include = array_fill_keys($include, true);
 		}
-		$defaults = array_fill_keys(array('from', 'sender', 'replyTo', 'readReceipt', 'returnPath', 'to', 'cc', 'bcc', 'subject'), false);
+		$defaults = array_fill_keys(
+			array(
+				'from', 'sender', 'replyTo', 'readReceipt', 'returnPath',
+				'to', 'cc', 'bcc', 'subject'),
+			false
+		);
 		$include += $defaults;
 
 		$headers = array();
@@ -793,7 +812,7 @@ class Email {
  * be quoted as characters like `:` and `,` are known to cause issues
  * in address header fields.
  *
- * @param array $address
+ * @param array $address Addresses to format.
  * @return array
  */
 	protected function _formatAddress($address) {
@@ -836,7 +855,7 @@ class Email {
 /**
  * View class for render
  *
- * @param string $viewClass
+ * @param string $viewClass View class name.
  * @return string|\Cake\Network\Email\Email
  */
 	public function viewRender($viewClass = null) {
@@ -850,7 +869,7 @@ class Email {
 /**
  * Variables to be set on render
  *
- * @param array $viewVars
+ * @param array $viewVars Variables to set for view.
  * @return array|\Cake\Network\Email\Email
  */
 	public function viewVars($viewVars = null) {
@@ -864,7 +883,7 @@ class Email {
 /**
  * Theme to use when rendering
  *
- * @param string $theme
+ * @param string $theme Theme name.
  * @return string|\Cake\Network\Email\Email
  */
 	public function theme($theme = null) {
@@ -878,7 +897,7 @@ class Email {
 /**
  * Helpers to be used in render
  *
- * @param array $helpers
+ * @param array $helpers Helpers list.
  * @return array|\Cake\Network\Email\Email
  */
 	public function helpers($helpers = null) {
@@ -892,7 +911,7 @@ class Email {
 /**
  * Email format
  *
- * @param string $format
+ * @param string $format Formatting string.
  * @return string|\Cake\Network\Email\Email
  * @throws \Cake\Network\Error\SocketException
  */
@@ -1262,7 +1281,7 @@ class Email {
 /**
  * Apply the config to an instance
  *
- * @param string|array $config
+ * @param string|array $config Configuration options.
  * @return void
  * @throws \Cake\Error\Exception When using a configuration that doesn't exist.
  */

+ 1 - 1
src/Network/Email/SmtpTransport.php

@@ -116,7 +116,7 @@ class SmtpTransport extends AbstractTransport {
 /**
  * Parses and stores the reponse lines in `'code' => 'message'` format.
  *
- * @param array $responseLines Response to parse.
+ * @param array $responseLines Response lines to parse.
  * @return void
  */
 	protected function _bufferResponseLines(array $responseLines) {

+ 27 - 28
src/TestSuite/TestCase.php

@@ -1,7 +1,5 @@
 <?php
 /**
- * Cake TestCase file
- *
  * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
  * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  *
@@ -129,6 +127,8 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
 /**
  * Chooses which fixtures to load for a given test
  *
+ * Each parameter is a model name that corresponds to a fixture, i.e. 'Post', 'Author', etc.
+ *
  * @return void
  * @see \Cake\TestSuite\TestCase::$autoFixtures
  * @throws \Exception when no fixture manager is available.
@@ -177,9 +177,9 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
  * Asserts that a string starts with a given prefix, ignoring differences in newlines.
  * Helpful for doing cross platform tests of blocks of text.
  *
- * @param string $prefix
- * @param string $string
- * @param string $message
+ * @param string $prefix The prefix to check for.
+ * @param string $string The string to search in.
+ * @param string $message The message to use for failure.
  * @return void
  */
 	public function assertTextStartsWith($prefix, $string, $message = '') {
@@ -192,9 +192,9 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
  * Asserts that a string starts not with a given prefix, ignoring differences in newlines.
  * Helpful for doing cross platform tests of blocks of text.
  *
- * @param string $prefix
- * @param string $string
- * @param string $message
+ * @param string $prefix The prefix to not find.
+ * @param string $string The string to search.
+ * @param string $message The message to use for failure.
  * @return void
  */
 	public function assertTextStartsNotWith($prefix, $string, $message = '') {
@@ -207,9 +207,9 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
  * Asserts that a string ends with a given prefix, ignoring differences in newlines.
  * Helpful for doing cross platform tests of blocks of text.
  *
- * @param string $suffix
- * @param string $string
- * @param string $message
+ * @param string $suffix The suffix to find.
+ * @param string $string The string to search.
+ * @param string $message The message to use for failure.
  * @return void
  */
 	public function assertTextEndsWith($suffix, $string, $message = '') {
@@ -222,9 +222,9 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
  * Asserts that a string ends not with a given prefix, ignoring differences in newlines.
  * Helpful for doing cross platform tests of blocks of text.
  *
- * @param string $suffix
- * @param string $string
- * @param string $message
+ * @param string $suffix The suffix to not find.
+ * @param string $string The string to search.
+ * @param string $message The message to use for failure.
  * @return void
  */
 	public function assertTextEndsNotWith($suffix, $string, $message = '') {
@@ -237,10 +237,10 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
  * Assert that a string contains another string, ignoring differences in newlines.
  * Helpful for doing cross platform tests of blocks of text.
  *
- * @param string $needle
- * @param string $haystack
- * @param string $message
- * @param bool $ignoreCase
+ * @param string $needle The string to search for.
+ * @param string $haystack The string to search through.
+ * @param string $message The message to display on failure.
+ * @param boolean $ignoreCase Whether or not the search should be case-sensitive.
  * @return void
  */
 	public function assertTextContains($needle, $haystack, $message = '', $ignoreCase = false) {
@@ -253,10 +253,10 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
  * Assert that a text doesn't contain another text, ignoring differences in newlines.
  * Helpful for doing cross platform tests of blocks of text.
  *
- * @param string $needle
- * @param string $haystack
- * @param string $message
- * @param bool $ignoreCase
+ * @param string $needle The string to search for.
+ * @param string $haystack The string to search through.
+ * @param string $message The message to display on failure.
+ * @param boolean $ignoreCase Whether or not the search should be case-sensitive.
  * @return void
  */
 	public function assertTextNotContains($needle, $haystack, $message = '', $ignoreCase = false) {
@@ -304,9 +304,8 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
  *
  * @param string $string An HTML/XHTML/XML string
  * @param array $expected An array, see above
- * @param bool $fullDebug Whether to debug the generated regex and subject in case of a
- *  matching failure.
- * @return bool
+ * @param string $fullDebug Whether or not more verbose output should be used.
+ * @return void
  */
 	public function assertTags($string, $expected, $fullDebug = false) {
 		$regex = array();
@@ -529,9 +528,9 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
 /**
  * Mock a model, maintain fixtures and table association
  *
- * @param string $alias
- * @param array $methods
- * @param array $options
+ * @param string $model The model to get a mock for.
+ * @param mixed $methods The list of methods to mock
+ * @param array $config The config data for the mock's constructor.
  * @throws \Cake\ORM\Error\MissingTableClassException
  * @return Model
  */

+ 2 - 2
src/Utility/String.php

@@ -251,8 +251,8 @@ class String {
  * is to replace all whitespace and unneeded markup around placeholders that did not get replaced
  * by String::insert().
  *
- * @param string $str String to clean
- * @param array $options Options
+ * @param string $str String to clean.
+ * @param array $options Options list.
  * @return string
  * @see String::insert()
  */

+ 14 - 5
src/View/Helper/HtmlHelper.php

@@ -87,11 +87,11 @@ class HtmlHelper extends Helper {
 	protected $_crumbs = array();
 
 /**
- * Names of script files that have been included once
+ * Names of script & css files that have been included once
  *
  * @var array
  */
-	protected $_includedScripts = array();
+	protected $_includedAssets = array();
 
 /**
  * Options for the currently opened script block buffer if any.
@@ -377,6 +377,9 @@ class HtmlHelper extends Helper {
  *
  * - `block` Set to true to append output to view block "css" or provide
  *   custom block name.
+ * - `once` Whether or not the css file should be checked for uniqueness. If true css
+ *   files  will only be included once, use false to allow the same
+ *   css to be included more than once per request.
  * - `plugin` False value will prevent parsing path as a plugin
  * - `rel` Defaults to 'stylesheet'. If equal to 'import' the stylesheet will be imported.
  * - `fullBase` If true the URL will get a full address for the css file.
@@ -389,7 +392,7 @@ class HtmlHelper extends Helper {
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::css
  */
 	public function css($path, array $options = array()) {
-		$options += array('block' => null, 'rel' => 'stylesheet');
+		$options += array('once' => true, 'block' => null, 'rel' => 'stylesheet');
 
 		if (is_array($path)) {
 			$out = '';
@@ -402,6 +405,12 @@ class HtmlHelper extends Helper {
 			return;
 		}
 
+		if ($options['once'] && isset($this->_includedAssets[$path])) {
+			return '';
+		}
+		unset($options['once']);
+		$this->_includedAssets[$path] = true;
+
 		if (strpos($path, '//') !== false) {
 			$url = $path;
 		} else {
@@ -480,10 +489,10 @@ class HtmlHelper extends Helper {
 			}
 			return null;
 		}
-		if ($options['once'] && isset($this->_includedScripts[$url])) {
+		if ($options['once'] && isset($this->_includedAssets[$url])) {
 			return null;
 		}
-		$this->_includedScripts[$url] = true;
+		$this->_includedAssets[$url] = true;
 
 		if (strpos($url, '//') === false) {
 			$url = $this->assetUrl($url, $options + array('pathPrefix' => Configure::read('App.jsBaseUrl'), 'ext' => '.js'));

+ 42 - 16
tests/TestCase/View/Helper/HtmlHelperTest.php

@@ -549,8 +549,8 @@ class HtmlHelperTest extends TestCase {
 		$expected['link']['href'] = 'preg:/.*example\.com\/css\/cake\.generic\.css/';
 		$this->assertTags($result, $expected);
 
-		$result = explode("\n", trim($this->Html->css(array('cake.generic', 'vendor.generic'))));
-		$expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css/';
+		$result = explode("\n", trim($this->Html->css(array('cake', 'vendor.generic'))));
+		$expected['link']['href'] = 'preg:/.*css\/cake\.css/';
 		$this->assertTags($result[0], $expected);
 		$expected['link']['href'] = 'preg:/.*css\/vendor\.generic\.css/';
 		$this->assertTags($result[1], $expected);
@@ -570,16 +570,39 @@ class HtmlHelperTest extends TestCase {
 		$result = $this->Html->css('more_css_in_head', array('block' => true));
 		$this->assertNull($result);
 
-		$result = $this->Html->css('screen', array('rel' => 'import'));
+		$result = $this->Html->css('import-screen', array('rel' => 'import'));
 		$expected = array(
 			'<style',
-			'preg:/@import url\(.*css\/screen\.css\);/',
+			'preg:/@import url\(.*css\/import-screen\.css\);/',
 			'/style'
 		);
 		$this->assertTags($result, $expected);
 	}
 
 /**
+ * Test css() with once option.
+ *
+ * @return void
+ */
+	public function testCssLinkOnce() {
+		$result = $this->Html->css('screen', array('once' => true));
+		$expected = array(
+			'link' => array('rel' => 'stylesheet', 'href' => 'preg:/.*css\/screen\.css/')
+		);
+		$this->assertTags($result, $expected);
+
+		// Default is once=true
+		$result = $this->Html->css('screen');
+		$this->assertEquals('', $result);
+
+		$result = $this->Html->css('screen', ['once' => false]);
+		$expected = array(
+			'link' => array('rel' => 'stylesheet', 'href' => 'preg:/.*css\/screen\.css/')
+		);
+		$this->assertTags($result, $expected);
+	}
+
+/**
  * testCssWithFullBase method
  *
  * @return void
@@ -609,7 +632,7 @@ class HtmlHelperTest extends TestCase {
 		);
 		$this->assertTags($result, $expected);
 
-		$result = $this->Html->css('TestPlugin.test_plugin_asset.css');
+		$result = $this->Html->css('TestPlugin.test_plugin_asset.css', ['once' => false]);
 		$this->assertTags($result, $expected);
 
 		$result = $this->Html->css('TestPlugin.my.css.library');
@@ -620,7 +643,10 @@ class HtmlHelperTest extends TestCase {
 		$expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css\?1234/';
 		$this->assertTags($result, $expected);
 
-		$result = explode("\n", trim($this->Html->css(array('TestPlugin.test_plugin_asset', 'TestPlugin.vendor.generic'))));
+		$result = explode("\n", trim($this->Html->css(
+			['TestPlugin.test_plugin_asset', 'TestPlugin.vendor.generic'],
+			['once' => false]
+		)));
 		$expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css/';
 		$this->assertTags($result[0], $expected);
 		$expected['link']['href'] = 'preg:/.*test_plugin\/css\/vendor\.generic\.css/';
@@ -643,29 +669,29 @@ class HtmlHelperTest extends TestCase {
 			'link' => array('rel' => 'stylesheet', 'href' => '')
 		);
 
-		$result = $this->Html->css('cake.generic');
+		$result = $this->Html->css('cake.generic', ['once' => false]);
 		$expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css\?[0-9]+/';
 		$this->assertTags($result, $expected);
 
 		Configure::write('debug', false);
 
-		$result = $this->Html->css('cake.generic');
+		$result = $this->Html->css('cake.generic', ['once' => false]);
 		$expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css/';
 		$this->assertTags($result, $expected);
 
 		Configure::write('Asset.timestamp', 'force');
 
-		$result = $this->Html->css('cake.generic');
+		$result = $this->Html->css('cake.generic', ['once' => false]);
 		$expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css\?[0-9]+/';
 		$this->assertTags($result, $expected);
 
 		$this->Html->request->webroot = '/testing/';
-		$result = $this->Html->css('cake.generic');
+		$result = $this->Html->css('cake.generic', ['once' => false]);
 		$expected['link']['href'] = 'preg:/\/testing\/css\/cake\.generic\.css\?[0-9]+/';
 		$this->assertTags($result, $expected);
 
 		$this->Html->request->webroot = '/testing/longer/';
-		$result = $this->Html->css('cake.generic');
+		$result = $this->Html->css('cake.generic', ['once' => false]);
 		$expected['link']['href'] = 'preg:/\/testing\/longer\/css\/cake\.generic\.css\?[0-9]+/';
 		$this->assertTags($result, $expected);
 	}
@@ -685,29 +711,29 @@ class HtmlHelperTest extends TestCase {
 			'link' => array('rel' => 'stylesheet', 'href' => '')
 		);
 
-		$result = $this->Html->css('TestPlugin.test_plugin_asset');
+		$result = $this->Html->css('TestPlugin.test_plugin_asset', ['once' => false]);
 		$expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/';
 		$this->assertTags($result, $expected);
 
 		Configure::write('debug', false);
 
-		$result = $this->Html->css('TestPlugin.test_plugin_asset');
+		$result = $this->Html->css('TestPlugin.test_plugin_asset', ['once' => false]);
 		$expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css/';
 		$this->assertTags($result, $expected);
 
 		Configure::write('Asset.timestamp', 'force');
 
-		$result = $this->Html->css('TestPlugin.test_plugin_asset');
+		$result = $this->Html->css('TestPlugin.test_plugin_asset', ['once' => false]);
 		$expected['link']['href'] = 'preg:/.*test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/';
 		$this->assertTags($result, $expected);
 
 		$this->Html->request->webroot = '/testing/';
-		$result = $this->Html->css('TestPlugin.test_plugin_asset');
+		$result = $this->Html->css('TestPlugin.test_plugin_asset', ['once' => false]);
 		$expected['link']['href'] = 'preg:/\/testing\/test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/';
 		$this->assertTags($result, $expected);
 
 		$this->Html->request->webroot = '/testing/longer/';
-		$result = $this->Html->css('TestPlugin.test_plugin_asset');
+		$result = $this->Html->css('TestPlugin.test_plugin_asset', ['once' => false]);
 		$expected['link']['href'] = 'preg:/\/testing\/longer\/test_plugin\/css\/test_plugin_asset\.css\?[0-9]+/';
 		$this->assertTags($result, $expected);