diff --git a/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php b/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
index f01d9b81954dd149d8595e7341fe5a57e7788970..8a771354c2c12c9801b3dbcedc2ab3228d69ea1f 100644
--- a/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
+++ b/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
@@ -218,4 +218,40 @@ class Utils_MetadataTest extends PHPUnit_Framework_TestCase
         }
         $this->assertArrayNotHasKey('name', $parsed);
     }
+
+
+    /**
+     * Test \SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery().
+     */
+    public function testIsHiddenFromDiscovery()
+    {
+        // test for success
+        $metadata = array(
+            'EntityAttributes' => array(
+                \SimpleSAML\Utils\Config\Metadata::$ENTITY_CATEGORY => array(
+                    \SimpleSAML\Utils\Config\Metadata::$HIDE_FROM_DISCOVERY,
+                ),
+            ),
+        );
+        $this->assertTrue(\SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery($metadata));
+
+        // test for failures
+        $this->assertFalse(\SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery(array('foo')));
+        $this->assertFalse(\SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery(array(
+            'EntityAttributes' => 'bar',
+        )));
+        $this->assertFalse(\SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery(array(
+            'EntityAttributes' => array(),
+        )));
+        $this->assertFalse(\SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery(array(
+            'EntityAttributes' => array(
+                \SimpleSAML\Utils\Config\Metadata::$ENTITY_CATEGORY => '',
+            ),
+        )));
+        $this->assertFalse(\SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery(array(
+            'EntityAttributes' => array(
+                \SimpleSAML\Utils\Config\Metadata::$ENTITY_CATEGORY => array(),
+            ),
+        )));
+    }
 }