Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / http-foundation / Tests / Session / Flash / AutoExpireFlashBagTest.php
index 4eb200afa3bdf54688ac00733e8f9080505e9e29..fa8626ab923b7b365a3ee4df035a29bfc962c829 100644 (file)
@@ -26,9 +26,6 @@ class AutoExpireFlashBagTest extends TestCase
      */
     private $bag;
 
-    /**
-     * @var array
-     */
     protected $array = array();
 
     protected function setUp()
@@ -62,7 +59,7 @@ class AutoExpireFlashBagTest extends TestCase
 
     public function testGetStorageKey()
     {
-        $this->assertEquals('_sf2_flashes', $this->bag->getStorageKey());
+        $this->assertEquals('_symfony_flashes', $this->bag->getStorageKey());
         $attributeBag = new FlashBag('test');
         $this->assertEquals('test', $attributeBag->getStorageKey());
     }
@@ -153,4 +150,12 @@ class AutoExpireFlashBagTest extends TestCase
     {
         $this->assertEquals(array('notice' => array('A previous flash message')), $this->bag->clear());
     }
+
+    public function testDoNotRemoveTheNewFlashesWhenDisplayingTheExistingOnes()
+    {
+        $this->bag->add('success', 'Something');
+        $this->bag->all();
+
+        $this->assertEquals(array('new' => array('success' => array('Something')), 'display' => array()), $this->array);
+    }
 }