Trimming whitespace and adding a file header.

This commit is contained in:
Mark Story 2010-11-28 21:11:18 -05:00
parent 3ddff879b1
commit 2495b3cd4c
2 changed files with 25 additions and 8 deletions

View file

@ -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
* regards to boolean and null values.
*
@ -36,7 +36,7 @@ class IniFile implements ArrayAccess {
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.
*
* @param string $filename Full path to the file to parse.
@ -63,7 +63,7 @@ class IniFile implements ArrayAccess {
/**
* Part of ArrayAccess implementation.
*
* @param string $name
* @param string $name
*/
public function offsetExists($name) {
return isset($this->_values[$name]);
@ -72,7 +72,7 @@ class IniFile implements ArrayAccess {
/**
* Part of ArrayAccess implementation.
*
* @param string $name
* @param string $name
*/
public function offsetGet($name) {
if (!isset($this->_values[$name])) {
@ -84,7 +84,7 @@ class IniFile implements ArrayAccess {
/**
* Part of ArrayAccess implementation.
*
* @param string $name
* @param string $name
*/
public function offsetSet($name, $value) {
throw new LogicException('You cannot modify an IniFile parse result.');
@ -93,7 +93,7 @@ class IniFile implements ArrayAccess {
/**
* Part of ArrayAccess implementation.
*
* @param string $name
* @param string $name
*/
public function offsetUnset($name) {
unset($this->_values[$name]);

View file

@ -1,5 +1,22 @@
<?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');
class IniFileTest extends CakeTestCase {
@ -54,7 +71,7 @@ class IniFileTest extends CakeTestCase {
function testAsArray() {
$config = new IniFile($this->file);
$content = $config->asArray();
$this->assertTrue(isset($content['admin']['groups']));
$this->assertTrue(isset($content['paul']['groups']));
}