diff --git a/core/core.services.yml b/core/core.services.yml
index 5b0de75..2d144fe 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -1604,8 +1604,16 @@ services:
     class: Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser
     arguments: ['@module_handler']
     tags:
-      - { name: mime_type_guesser }
+      - { name: mime_type_guesser, priority: 0 }
     lazy: true
+  file.mime_type.guesser.filebinary:
+    class: Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser
+    tags:
+      - { name: mime_type_guesser, priority: 1 }
+  file.mime_type.guesser.fileinfo:
+    class: Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser
+    tags:
+      - { name: mime_type_guesser, priority: 2 }
   # Currently needs to be public as it is called by
   # \Drupal\Core\Render\Element\StatusMessages.
   # @todo Consider making this service private again after
diff --git a/core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php b/core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php
index 85d0261..213b880 100644
--- a/core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php
+++ b/core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php
@@ -85,9 +85,16 @@ public function guess($path) {
    * @return $this
    */
   public function addGuesser(MimeTypeGuesserInterface $guesser, $priority = 0) {
-    $this->guessers[$priority][] = $guesser;
-    // Mark sorted guessers for rebuild.
-    $this->sortedGuessers = NULL;
+    // Symfony's guessers has non-interfaced "isSupported" method to check that
+    // environment supports guessing mechanism. Allow all guessers define same
+    // the method for same purposes. Otherwise consider that guesser is allowed
+    // to use.
+    // @see \Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser::isSupported()
+    if (method_exists($guesser, 'isSupported') ? $guesser::isSupported() : TRUE) {
+      $this->guessers[$priority][] = $guesser;
+      // Mark sorted guessers for rebuild.
+      $this->sortedGuessers = NULL;
+    }
     return $this;
   }
 
diff --git a/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php b/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php
index 4db377d..f186f9f 100644
--- a/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php
+++ b/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php
@@ -148,7 +148,8 @@ function assertSameFile(FileInterface $file1, FileInterface $file2) {
    *
    * @param string $filepath
    *   Optional string specifying the file path. If none is provided then a
-   *   randomly named file will be created in the site's files directory.
+   *   randomly named file with the extension .txt will be created in the site's
+   *   files directory.
    * @param string $contents
    *   Optional contents to save into the file. If a NULL value is provided an
    *   arbitrary string will be used.
@@ -179,7 +180,8 @@ function createFile($filepath = NULL, $contents = NULL, $scheme = NULL) {
    *
    * @param string $filepath
    *   Optional string specifying the file path. If none is provided then a
-   *   randomly named file will be created in the site's files directory.
+   *   randomly named file with the extension .txt will be created in the site's
+   *   files directory.
    * @param string $contents
    *   Optional contents to save into the file. If a NULL value is provided an
    *   arbitrary string will be used.
@@ -199,7 +201,7 @@ function createUri($filepath = NULL, $contents = NULL, $scheme = NULL) {
     if (!isset($scheme)) {
       $scheme = file_default_scheme();
     }
-    $filepath = $scheme . '://' . $filepath;
+    $filepath = $scheme . '://' . $filepath . '.txt';;
 
     if (!isset($contents)) {
       $contents = "file_put_contents() doesn't seem to appreciate empty strings so let's put in some data.";
diff --git a/core/modules/file/tests/src/Kernel/SaveDataTest.php b/core/modules/file/tests/src/Kernel/SaveDataTest.php
index c5637d0..1bf53e7 100644
--- a/core/modules/file/tests/src/Kernel/SaveDataTest.php
+++ b/core/modules/file/tests/src/Kernel/SaveDataTest.php
@@ -22,7 +22,7 @@ function testWithoutFilename() {
     $this->assertEqual(file_default_scheme(), file_uri_scheme($result->getFileUri()), "File was placed in Drupal's files directory.");
     $this->assertEqual($result->getFilename(), drupal_basename($result->getFileUri()), "Filename was set to the file's basename.");
     $this->assertEqual($contents, file_get_contents($result->getFileUri()), 'Contents of the file are correct.');
-    $this->assertEqual($result->getMimeType(), 'application/octet-stream', 'A MIME type was set.');
+    $this->assertEqual($result->getMimeType(), 'text/plain', 'A MIME type was set.');
     $this->assertTrue($result->isPermanent(), "The file's status was set to permanent.");
 
     // Check that the correct hooks were called.
@@ -71,7 +71,7 @@ function testExistingRename() {
     $this->assertEqual('public', file_uri_scheme($result->getFileUri()), "File was placed in Drupal's files directory.");
     $this->assertEqual($result->getFilename(), $existing->getFilename(), 'Filename was set to the basename of the source, rather than that of the renamed file.');
     $this->assertEqual($contents, file_get_contents($result->getFileUri()), 'Contents of the file are correct.');
-    $this->assertEqual($result->getMimeType(), 'application/octet-stream', 'A MIME type was set.');
+    $this->assertEqual($result->getMimeType(), 'text/plain', 'A MIME type was set.');
     $this->assertTrue($result->isPermanent(), "The file's status was set to permanent.");
 
     // Check that the correct hooks were called.
@@ -99,7 +99,7 @@ function testExistingReplace() {
     $this->assertEqual('public', file_uri_scheme($result->getFileUri()), "File was placed in Drupal's files directory.");
     $this->assertEqual($result->getFilename(), $existing->getFilename(), 'Filename was set to the basename of the existing file, rather than preserving the original name.');
     $this->assertEqual($contents, file_get_contents($result->getFileUri()), 'Contents of the file are correct.');
-    $this->assertEqual($result->getMimeType(), 'application/octet-stream', 'A MIME type was set.');
+    $this->assertEqual($result->getMimeType(), 'text/plain', 'A MIME type was set.');
     $this->assertTrue($result->isPermanent(), "The file's status was set to permanent.");
 
     // Check that the correct hooks were called.
diff --git a/core/tests/Drupal/Tests/Core/File/MimeTypeGuesserTest.php b/core/tests/Drupal/Tests/Core/File/MimeTypeGuesserTest.php
index f2e9717..8f44f6c 100644
--- a/core/tests/Drupal/Tests/Core/File/MimeTypeGuesserTest.php
+++ b/core/tests/Drupal/Tests/Core/File/MimeTypeGuesserTest.php
@@ -3,21 +3,24 @@
 namespace Drupal\Tests\Core\File;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass;
 use Drupal\Core\File\MimeType\MimeTypeGuesser;
 use Drupal\Core\StreamWrapper\StreamWrapperManager;
 use Drupal\Tests\UnitTestCase;
+use Symfony\Component\DependencyInjection\Definition;
 use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser as SymfonyMimeTypeGuesser;
+use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
 
 /**
  * @coversDefaultClass \Drupal\Core\File\MimeType\MimeTypeGuesser
- * @group DrupalKernel
+ * @group File
  */
 class MimeTypeGuesserTest extends UnitTestCase {
 
   /**
    * @covers ::registerWithSymfonyGuesser
    *
-   * @see Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser
+   * @see \Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser
    */
   public function testSymfonyGuesserRegistration() {
     // Make the guessers property accessible on Symfony's MimeTypeGuesser.
@@ -29,8 +32,12 @@ public function testSymfonyGuesserRegistration() {
     if (count($guessers)) {
       $this->assertNotInstanceOf('Drupal\Core\File\MimeType\MimeTypeGuesser', $guessers[0]);
     }
+    $stream_wrapper_manager = $this
+      ->getMockBuilder(StreamWrapperManager::class)
+      ->disableOriginalConstructor()
+      ->getMock();
     $container = new ContainerBuilder();
-    $container->set('file.mime_type.guesser', new MimeTypeGuesser(new StreamWrapperManager()));
+    $container->set('file.mime_type.guesser', new MimeTypeGuesser($stream_wrapper_manager));
     MimeTypeGuesser::registerWithSymfonyGuesser($container);
     $symfony_guesser = SymfonyMimeTypeGuesser::getInstance();
     $guessers = $this->readAttribute($symfony_guesser, 'guessers');
@@ -39,7 +46,7 @@ public function testSymfonyGuesserRegistration() {
     $count = count($guessers);
 
     $container = new ContainerBuilder();
-    $container->set('file.mime_type.guesser', new MimeTypeGuesser(new StreamWrapperManager()));
+    $container->set('file.mime_type.guesser', new MimeTypeGuesser($stream_wrapper_manager));
     MimeTypeGuesser::registerWithSymfonyGuesser($container);
     $symfony_guesser = SymfonyMimeTypeGuesser::getInstance();
     $guessers = $this->readAttribute($symfony_guesser, 'guessers');
@@ -49,4 +56,84 @@ public function testSymfonyGuesserRegistration() {
     $this->assertEquals($count, $new_count, 'The count of mime type guessers remains the same after container re-init.');
   }
 
+  /**
+   * @covers ::guess
+   * @covers ::addGuesser
+   * @covers ::sortGuessers
+   */
+  public function testGuess() {
+    $stream_wrapper_manager = $this
+      ->getMockBuilder(StreamWrapperManager::class)
+      ->disableOriginalConstructor()
+      ->getMock();
+
+    $stream_wrapper_manager
+      ->expects($this->any())
+      ->method('getViaUri')
+      ->willReturn(NULL);
+
+    $mime_guesser_service = new MimeTypeGuesser($stream_wrapper_manager);
+    $guesser_1 = $this->getMock(MimeTypeGuesserInterface::class);
+
+    $guesser_1
+      ->expects($this->once())
+      ->method('guess')
+      ->with('file.txt')
+      ->willReturn('text/plain');
+
+    $mime_guesser_service->addGuesser($guesser_1);
+
+    $this->assertEquals('text/plain', $mime_guesser_service->guess('file.txt'));
+
+    $guesser_2 = $this->getMock(MimeTypeGuesserInterface::class);
+    $guesser_2
+      ->expects($this->once())
+      ->method('guess')
+      ->with('file.txt')
+      ->willReturn('text/x-diff');
+
+    $mime_guesser_service->addGuesser($guesser_2, 10);
+    $this->assertEquals('text/x-diff', $mime_guesser_service->guess('file.txt'));
+  }
+
+  /**
+   * Tests that "isSupported" method can prevent adding guesser.
+   *
+   * @covers ::addGuesser
+   */
+  public function testIsSupportedMimeTypeGuessers() {
+    $container = new ContainerBuilder();
+
+    $stream_wrapper_manager = new Definition(StreamWrapperManager::class);
+    $file_mime_type_guesser = new Definition(MimeTypeGuesser::class);
+    $file_mime_type_guesser
+      ->addArgument($stream_wrapper_manager)
+      ->addTag('service_collector', [
+        'tag' => 'mime_type_guesser',
+        'call' => 'addGuesser',
+      ]);
+
+    $container->setDefinition('stream_wrapper_manager', $stream_wrapper_manager);
+    $container->setDefinition('file.mime_type.guesser', $file_mime_type_guesser);
+
+    foreach ([
+      'supported' => SupportedMimeTypeGuesser::class,
+      'unsupported' => UnsupportedMimeTypeGuesser::class,
+    ] as $type => $class) {
+      $definition = new Definition($class);
+      $definition->addTag('mime_type_guesser');
+
+      $container->setDefinition("file.mime_type.guesser.$type", $definition);
+    }
+
+    $handler_pass = new TaggedHandlersPass();
+    $handler_pass->process($container);
+
+    $guessers = $this->readAttribute($container->get('file.mime_type.guesser'), 'guessers');
+
+    if ($this->assertCount(1, $guessers)) {
+      $this->assertContainsOnlyInstancesOf(SupportedMimeTypeGuesser::class, $guessers[0]);
+    }
+  }
+
 }
diff --git a/core/tests/Drupal/Tests/Core/File/SupportedMimeTypeGuesser.php b/core/tests/Drupal/Tests/Core/File/SupportedMimeTypeGuesser.php
new file mode 100644
index 0000000..b5f7277
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/File/SupportedMimeTypeGuesser.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace Drupal\Tests\Core\File;
+
+/**
+ * Class SupportedMimeTypeGuesser.
+ *
+ * Dummy guesser implementation to test that "isSupported" method allow it
+ * for usage.
+ */
+class SupportedMimeTypeGuesser extends UnsupportedMimeTypeGuesser {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function isSupported() {
+    return TRUE;
+  }
+
+}
diff --git a/core/tests/Drupal/Tests/Core/File/UnsupportedMimeTypeGuesser.php b/core/tests/Drupal/Tests/Core/File/UnsupportedMimeTypeGuesser.php
new file mode 100644
index 0000000..503dbb8
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/File/UnsupportedMimeTypeGuesser.php
@@ -0,0 +1,32 @@
+<?php
+
+namespace Drupal\Tests\Core\File;
+
+use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
+
+/**
+ * Class UnsupportedMimeTypeGuesser.
+ *
+ * Dummy guesser implementation to test that unsupported guesser will not
+ * be used for guessing the MIME type of file.
+ */
+class UnsupportedMimeTypeGuesser implements MimeTypeGuesserInterface {
+
+  /**
+   * Check that environment supports guessing mechanism.
+   *
+   * @return bool
+   *   Whether environment supports guessing mechanism.
+   */
+  public static function isSupported() {
+    return FALSE;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function guess($path) {
+    return NULL;
+  }
+
+}
