Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / validator / Tests / Mapping / Factory / LazyLoadingMetadataFactoryTest.php
index b5d1a9dc84d4d670240e3f42d293dac52d5cb4e6..de6852271e17f3e1f72cefcebd1868c810965225 100644 (file)
@@ -149,6 +149,21 @@ class LazyLoadingMetadataFactoryTest extends TestCase
         $this->assertEquals($metadata, $factory->getMetadataFor(self::PARENT_CLASS));
     }
 
+    /**
+     * @expectedException \Symfony\Component\Validator\Exception\NoSuchMetadataException
+     */
+    public function testNonClassNameStringValues()
+    {
+        $testedValue = 'error@example.com';
+        $loader = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Loader\LoaderInterface')->getMock();
+        $cache = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Cache\CacheInterface')->getMock();
+        $factory = new LazyLoadingMetadataFactory($loader, $cache);
+        $cache
+            ->expects($this->never())
+            ->method('read');
+        $factory->getMetadataFor($testedValue);
+    }
+
     public function testMetadataCacheWithRuntimeConstraint()
     {
         $cache = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Cache\CacheInterface')->getMock();