Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / config / Tests / Definition / Builder / ExprBuilderTest.php
index feea16f9c397bbd8c3aa4c2ed18875a2956d3e7a..99a10413768b484246394a1e16db2f1d0ef60be2 100644 (file)
@@ -145,6 +145,25 @@ class ExprBuilderTest extends TestCase
         $this->assertFinalizedValueIs(array(), $test);
     }
 
+    /**
+     * @dataProvider castToArrayValues
+     */
+    public function testcastToArrayExpression($configValue, $expectedValue)
+    {
+        $test = $this->getTestBuilder()
+            ->castToArray()
+        ->end();
+        $this->assertFinalizedValueIs($expectedValue, $test, array('key' => $configValue));
+    }
+
+    public function castToArrayValues()
+    {
+        yield array('value', array('value'));
+        yield array(-3.14, array(-3.14));
+        yield array(null, array(null));
+        yield array(array('value'), array('value'));
+    }
+
     /**
      * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
      */