PHPackages                             anlutro/l4-config-mock - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. anlutro/l4-config-mock

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

anlutro/l4-config-mock
======================

Extremely simple mock config class for testing L4 packages.

0143

Since Aug 21Pushed 12y ago1 watchersCompare

[ Source](https://github.com/anlutro/laravel-4-config-mock)[ Packagist](https://packagist.org/packages/anlutro/l4-config-mock)[ RSS](/packages/anlutro-l4-config-mock/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

\#Laravel 4 Config Mock Extremely simple class for mocking Laravel's config abilities.

Meant for use in developing and testing packages. Set the items on the config instance, and inject it into your class(es).

Example
-------

[](#example)

Here's a simple example showing how you can create a library you want to use (how you use it is not included in the example), how to implement it in a service provider and how to write a test for it where you can load your package's config file and set any config values you need to test your class.

```
class MyClass
{
	public function setConfig($config)
	{
		$this->config = $config;
	}

	public function hello()
	{
		return $this->config->get('myvendor/mypackage::hello');
	}
}

class MyClassServiceProvider
{
	protected $defer = true;

	public function register()
	{
		$this->app['myclass'] = $this->app->share(function($app) {
			$myclass = new MyClass;
			$myClass->setConfig($app['config']);
		});
	}
}

class MyClassTest extends PHPUnit_Framework_TestCase
{
	public function testHello()
	{
		$config = new anlutro\L4MockConfig\MockConfig;
		// our config file which includes 'hello' => 'my-hello'
		$config->load('/path/to/package/config.php', 'myvendor/mypackage');

		$obj = new MyClass;
		$obj->setConfig($config);

		$this->assertEquals('my-hello', $obj->hello());

		$this->config->set('myvendor/mypackage::hello', 'second-hello');
		$this->assertEquals('second-hello', $obj->hello());
	}
}
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/48f62855097c02888b96494da9a389988cd7ecb9001465f8ec30f15672fb5b5a?d=identicon)[anlutro](/maintainers/anlutro)

---

Top Contributors

[![anlutro](https://avatars.githubusercontent.com/u/163093?v=4)](https://github.com/anlutro "anlutro (5 commits)")

### Embed Badge

![Health badge](/badges/anlutro-l4-config-mock/health.svg)

```
[![Health](https://phpackages.com/badges/anlutro-l4-config-mock/health.svg)](https://phpackages.com/packages/anlutro-l4-config-mock)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
