Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / config / Tests / Loader / FileLoaderTest.php
index e1d23e45fa6d17fe45c795fa3759a5f12740cbd8..c6e283c74919b75b226a8b5a5f2ba394a5f9b906 100644 (file)
@@ -12,6 +12,7 @@
 namespace Symfony\Component\Config\Tests\Loader;
 
 use PHPUnit\Framework\TestCase;
+use Symfony\Component\Config\FileLocator;
 use Symfony\Component\Config\Loader\FileLoader;
 use Symfony\Component\Config\Loader\LoaderResolver;
 
@@ -66,6 +67,29 @@ class FileLoaderTest extends TestCase
             $this->assertInstanceOf('Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException', $e, '->import() throws a FileLoaderImportCircularReferenceException if the resource is already loading');
         }
     }
+
+    public function testImportWithGlobLikeResource()
+    {
+        $locatorMock = $this->getMockBuilder('Symfony\Component\Config\FileLocatorInterface')->getMock();
+        $loader = new TestFileLoader($locatorMock);
+
+        $this->assertSame('[foo]', $loader->import('[foo]'));
+    }
+
+    public function testImportWithNoGlobMatch()
+    {
+        $locatorMock = $this->getMockBuilder('Symfony\Component\Config\FileLocatorInterface')->getMock();
+        $loader = new TestFileLoader($locatorMock);
+
+        $this->assertNull($loader->import('./*.abc'));
+    }
+
+    public function testImportWithSimpleGlob()
+    {
+        $loader = new TestFileLoader(new FileLocator(__DIR__));
+
+        $this->assertSame(__FILE__, strtr($loader->import('FileLoaderTest.*'), '/', DIRECTORY_SEPARATOR));
+    }
 }
 
 class TestFileLoader extends FileLoader