for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Spiral Framework.
*
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
declare(strict_types=1);
namespace Spiral\Tests\Config;
use Spiral\Config\Patch\Prepend;
class PrependTest extends BaseTest
{
public function testPatch(): void
$cf = $this->getFactory();
$this->assertEquals(['value' => 'value!'], $cf->getConfig('scope'));
$cf->modify('scope', new Prepend('.', 'other', ['a' => 'b']));
$this->assertSame([
'other' => ['a' => 'b'],
'value' => 'value!',
], $cf->getConfig('scope'));
$cf->modify('scope', new Prepend('other.', null, 'c'));
'other' => [
'c',
'a' => 'b',
],
}
* @expectedException \Spiral\Config\Exception\PatchException
public function testException(): void
$config = $cf->getConfig('scope');
$this->assertEquals(['value' => 'value!'], $config);
$cf->modify('scope', new Prepend('other', 'other', ['a' => 'b']));