Skip to content
Permalink
Browse files

Trimming whitespace and adding a file header.

  • Loading branch information...
markstory committed Nov 29, 2010
1 parent 3ddff87 commit 2495b3cd4c669d18a1723bda26081c8a4399575b
Showing with 25 additions and 8 deletions.
  1. +6 −6 cake/libs/config/ini_file.php
  2. +19 −2 cake/tests/cases/libs/config/ini_file.test.php
@@ -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 @@ public function asArray() {
/**
* Part of ArrayAccess implementation.
*
* @param string $name
* @param string $name
*/
public function offsetExists($name) {
return isset($this->_values[$name]);
@@ -72,7 +72,7 @@ public function offsetExists($name) {
/**
* Part of ArrayAccess implementation.
*
* @param string $name
* @param string $name
*/
public function offsetGet($name) {
if (!isset($this->_values[$name])) {
@@ -84,7 +84,7 @@ public function offsetGet($name) {
/**
* 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 @@ public function offsetSet($name, $value) {
/**
* Part of ArrayAccess implementation.
*
* @param string $name
* @param string $name
*/
public function offsetUnset($name) {
unset($this->_values[$name]);
@@ -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 @@ function testReadingOnlyOneSection() {
function testAsArray() {
$config = new IniFile($this->file);
$content = $config->asArray();
$this->assertTrue(isset($content['admin']['groups']));
$this->assertTrue(isset($content['paul']['groups']));
}

0 comments on commit 2495b3c

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