Documentation

Horde_Test_Case extends TestCase
in package

Basic Horde test case helper.

Copyright 2009-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Tags
category

Horde

author

Chuck Hagenbuch chuck@horde.org

author

Jan Schneider jan@horde.org

license

http://www.horde.org/licenses/lgpl21 LGPL

link
http://www.horde.org/components/Horde_Test

Table of Contents

getConfig()  : mixed
Helper method for loading test configuration from a file.
getMockSkipConstructor()  : mixed
Useful shorthand if you are mocking a class with a private constructor

Methods

getConfig()

Helper method for loading test configuration from a file.

public static getConfig(string $env[, string $path = null ][, array<string|int, mixed> $default = array() ]) : mixed

The configuration can be specified by an environment variable. If the variable content is a file name, the configuration is loaded from the file. Otherwise it's assumed to be a json encoded configuration hash. If the environment variable is not set, the method tries to load a conf.php file from the same directory as the test case.

Parameters
$env : string

An environment variable name.

$path : string = null

The path to use.

$default : array<string|int, mixed> = array()

Some default values that are merged into the configuration if specified as a json hash.

Return values
mixed

The value of the configuration file's $conf variable, or null.

getMockSkipConstructor()

Useful shorthand if you are mocking a class with a private constructor

public getMockSkipConstructor(mixed $className[, array<string|int, mixed> $methods = array() ][, array<string|int, mixed> $arguments = array() ][, mixed $mockClassName = '' ]) : mixed
Parameters
$className : mixed
$methods : array<string|int, mixed> = array()
$arguments : array<string|int, mixed> = array()
$mockClassName : mixed = ''
Return values
mixed

Search results