/usr/share/php/kohana3.1/system/tests/kohana/Config/File/ReaderTest.php is in libkohana3.1-core-php 3.1.5-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | <?php defined('SYSPATH') OR die('Kohana bootstrap needs to be included before tests run');
/**
* Tests the Config file reader that's shipped with kohana
*
* @group kohana
* @group kohana.config
*
* @package Unittest
* @author Kohana Team
* @author Jeremy Bush <contractfrombelow@gmail.com>
* @author Matt Button <matthew@sigswitch.com>
* @copyright (c) 2008-2010 Kohana Team
* @license http://kohanaphp.com/license
*/
class Kohana_Config_File_ReaderTest extends Kohana_Unittest_TestCase {
/**
* If we don't pass a directory to the reader then it should assume
* that we want to search the dir 'config' by default
*
* @test
* @covers Kohana_Config_File_Reader
*/
public function test_default_search_dir_is_config()
{
$reader = new Kohana_Config_File_Reader;
$this->assertAttributeSame('config', '_directory', $reader);
}
/**
* If we pass a directory to the constructor of the file reader it
* should change the search directory
*
* @test
* @covers Kohana_Config_File_Reader
*/
public function test_constructor_sets_search_dir_from_param()
{
$reader = new Kohana_Config_File_Reader('gafloog');
$this->assertAttributeSame('gafloog', '_directory', $reader);
}
/**
* If the config dir does not exist then the function should just
* return an empty array
*
* @test
* @covers Kohana_Config_File_Reader::load
*/
public function test_load_returns_empty_array_if_conf_dir_dnx()
{
$config = new Kohana_Config_File_Reader('gafloogle');
$this->assertSame(array(), $config->load('values'));
}
/**
* If the requested config group does not exist then the reader
* should return an empty array
*
* @test
* @covers Kohana_Config_File_Reader::load
*/
public function test_load_returns_empty_array_if_conf_dnx()
{
$config = new Kohana_Config_File_Reader;
$this->assertSame(array(), $config->load('gafloogle'));
}
/**
* Test that the load() function is actually loading the
* configuration from the files.
*
* @test
* @covers Kohana_Config_File_Reader::load
*/
public function test_loads_config_from_files()
{
$config = new Kohana_Config_File_Reader;
$values = $config->load('inflector');
// Due to the way the cascading filesystem works there could be
// any number of modifications to the system config in the
// actual output. Therefore to increase compatability we just
// check that we've got an array and that it's not empty
$this->assertNotSame(array(), $values);
$this->assertInternalType('array', $values);
}
}
|