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 2w ago

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 18% 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

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14228.7M346](/packages/dms-phpunit-arraysubset-asserts)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

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