Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / dependency-injection / Tests / ParameterBag / FrozenParameterBagTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\DependencyInjection\Tests\ParameterBag;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
16
17 class FrozenParameterBagTest extends TestCase
18 {
19     public function testConstructor()
20     {
21         $parameters = array(
22             'foo' => 'foo',
23             'bar' => 'bar',
24         );
25         $bag = new FrozenParameterBag($parameters);
26         $this->assertEquals($parameters, $bag->all(), '__construct() takes an array of parameters as its first argument');
27     }
28
29     /**
30      * @expectedException \LogicException
31      */
32     public function testClear()
33     {
34         $bag = new FrozenParameterBag(array());
35         $bag->clear();
36     }
37
38     /**
39      * @expectedException \LogicException
40      */
41     public function testSet()
42     {
43         $bag = new FrozenParameterBag(array());
44         $bag->set('foo', 'bar');
45     }
46
47     /**
48      * @expectedException \LogicException
49      */
50     public function testAdd()
51     {
52         $bag = new FrozenParameterBag(array());
53         $bag->add(array());
54     }
55
56     /**
57      * @expectedException \LogicException
58      */
59     public function testRemove()
60     {
61         $bag = new FrozenParameterBag(array('foo' => 'bar'));
62         $bag->remove('foo');
63     }
64 }