Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / config / Tests / Definition / Builder / ExprBuilderTest.php
index 1b90ebfeb82bcace7bc37af959d3dfaf57e1e75c..feea16f9c397bbd8c3aa4c2ed18875a2956d3e7a 100644 (file)
@@ -76,6 +76,21 @@ class ExprBuilderTest extends TestCase
         $this->assertFinalizedValueIs('value', $test);
     }
 
+    public function testIfEmptyExpression()
+    {
+        $test = $this->getTestBuilder()
+            ->ifEmpty()
+            ->then($this->returnClosure('new_value'))
+        ->end();
+        $this->assertFinalizedValueIs('new_value', $test, array('key' => array()));
+
+        $test = $this->getTestBuilder()
+            ->ifEmpty()
+            ->then($this->returnClosure('new_value'))
+        ->end();
+        $this->assertFinalizedValueIs('value', $test);
+    }
+
     public function testIfArrayExpression()
     {
         $test = $this->getTestBuilder()