Skip to content

Commit

Permalink
Trimming whitespace and adding a file header.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 29, 2010
1 parent 3ddff87 commit 2495b3c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
12 changes: 6 additions & 6 deletions cake/libs/config/ini_file.php
Expand Up @@ -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.
* *
Expand All @@ -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.
Expand All @@ -63,7 +63,7 @@ public function asArray() {
/** /**
* 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]);
Expand All @@ -72,7 +72,7 @@ public function offsetExists($name) {
/** /**
* 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])) {
Expand All @@ -84,7 +84,7 @@ public function offsetGet($name) {
/** /**
* 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.');
Expand All @@ -93,7 +93,7 @@ public function offsetSet($name, $value) {
/** /**
* 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]);
Expand Down
21 changes: 19 additions & 2 deletions cake/tests/cases/libs/config/ini_file.test.php
@@ -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 {
Expand Down Expand Up @@ -54,7 +71,7 @@ function testReadingOnlyOneSection() {
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']));
} }
Expand Down

0 comments on commit 2495b3c

Please sign in to comment.