Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / http-foundation / Tests / Session / Attribute / NamespacedAttributeBagTest.php
index f074ce1b26261e4adc4220d0980a7553396759ac..ec4cd5ad1a146e4907cc87722fcf217d18eee946 100644 (file)
@@ -82,6 +82,17 @@ class NamespacedAttributeBagTest extends TestCase
         $this->assertEquals($exists, $this->bag->has($key));
     }
 
+    /**
+     * @dataProvider attributesProvider
+     */
+    public function testHasNoSideEffect($key, $value, $expected)
+    {
+        $expected = json_encode($this->bag->all());
+        $this->bag->has($key);
+
+        $this->assertEquals($expected, json_encode($this->bag->all()));
+    }
+
     /**
      * @dataProvider attributesProvider
      */
@@ -96,6 +107,17 @@ class NamespacedAttributeBagTest extends TestCase
         $this->assertEquals('default', $this->bag->get('user2.login', 'default'));
     }
 
+    /**
+     * @dataProvider attributesProvider
+     */
+    public function testGetNoSideEffect($key, $value, $expected)
+    {
+        $expected = json_encode($this->bag->all());
+        $this->bag->get($key);
+
+        $this->assertEquals($expected, json_encode($this->bag->all()));
+    }
+
     /**
      * @dataProvider attributesProvider
      */