mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Trimming whitespace and adding a file header.
This commit is contained in:
parent
3ddff879b1
commit
2495b3cd4c
2 changed files with 25 additions and 8 deletions
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ini file configuration parser. Since IniFile uses parse_ini_file underneath,
|
* Ini file configuration parser. Since IniFile uses parse_ini_file underneath,
|
||||||
* you should be aware that this class shares the same behavior, especially with
|
* you should be aware that this class shares the same behavior, especially with
|
||||||
* regards to boolean and null values.
|
* regards to boolean and null values.
|
||||||
*
|
*
|
||||||
|
@ -36,7 +36,7 @@ class IniFile implements ArrayAccess {
|
||||||
protected $_values = array();
|
protected $_values = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build and construct a new ini file parser, the parser will be a representation of the ini
|
* Build and construct a new ini file parser, the parser will be a representation of the ini
|
||||||
* file as an object.
|
* file as an object.
|
||||||
*
|
*
|
||||||
* @param string $filename Full path to the file to parse.
|
* @param string $filename Full path to the file to parse.
|
||||||
|
@ -63,7 +63,7 @@ class IniFile implements ArrayAccess {
|
||||||
/**
|
/**
|
||||||
* Part of ArrayAccess implementation.
|
* Part of ArrayAccess implementation.
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*/
|
*/
|
||||||
public function offsetExists($name) {
|
public function offsetExists($name) {
|
||||||
return isset($this->_values[$name]);
|
return isset($this->_values[$name]);
|
||||||
|
@ -72,7 +72,7 @@ class IniFile implements ArrayAccess {
|
||||||
/**
|
/**
|
||||||
* Part of ArrayAccess implementation.
|
* Part of ArrayAccess implementation.
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*/
|
*/
|
||||||
public function offsetGet($name) {
|
public function offsetGet($name) {
|
||||||
if (!isset($this->_values[$name])) {
|
if (!isset($this->_values[$name])) {
|
||||||
|
@ -84,7 +84,7 @@ class IniFile implements ArrayAccess {
|
||||||
/**
|
/**
|
||||||
* Part of ArrayAccess implementation.
|
* Part of ArrayAccess implementation.
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*/
|
*/
|
||||||
public function offsetSet($name, $value) {
|
public function offsetSet($name, $value) {
|
||||||
throw new LogicException('You cannot modify an IniFile parse result.');
|
throw new LogicException('You cannot modify an IniFile parse result.');
|
||||||
|
@ -93,7 +93,7 @@ class IniFile implements ArrayAccess {
|
||||||
/**
|
/**
|
||||||
* Part of ArrayAccess implementation.
|
* Part of ArrayAccess implementation.
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*/
|
*/
|
||||||
public function offsetUnset($name) {
|
public function offsetUnset($name) {
|
||||||
unset($this->_values[$name]);
|
unset($this->_values[$name]);
|
||||||
|
|
|
@ -1,5 +1,22 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* IniFileTest
|
||||||
|
*
|
||||||
|
* PHP 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||||
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
|
*
|
||||||
|
* Licensed under The MIT License
|
||||||
|
* Redistributions of files must retain the above copyright notice
|
||||||
|
*
|
||||||
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
|
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||||
|
* @package cake
|
||||||
|
* @subpackage cake.tests.cases
|
||||||
|
* @since CakePHP(tm) v 2.0
|
||||||
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
|
*/
|
||||||
App::import('Core', 'config/IniFile');
|
App::import('Core', 'config/IniFile');
|
||||||
|
|
||||||
class IniFileTest extends CakeTestCase {
|
class IniFileTest extends CakeTestCase {
|
||||||
|
@ -54,7 +71,7 @@ class IniFileTest extends CakeTestCase {
|
||||||
function testAsArray() {
|
function testAsArray() {
|
||||||
$config = new IniFile($this->file);
|
$config = new IniFile($this->file);
|
||||||
$content = $config->asArray();
|
$content = $config->asArray();
|
||||||
|
|
||||||
$this->assertTrue(isset($content['admin']['groups']));
|
$this->assertTrue(isset($content['admin']['groups']));
|
||||||
$this->assertTrue(isset($content['paul']['groups']));
|
$this->assertTrue(isset($content['paul']['groups']));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue