summaryrefslogtreecommitdiffstats
path: root/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/SimpleSAML/Utils/Config/MetadataTest.php')
-rw-r--r--tests/lib/SimpleSAML/Utils/Config/MetadataTest.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php b/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
index f01d9b8..8a77135 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(),
+ ),
+ )));
+ }
}