Navigation Menu

Skip to content

Commit

Permalink
WIP: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Nov 25, 2019
1 parent 0552834 commit 7c597df
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions tests/lib/SimpleSAML/XHTML/IdPDiscoTest.php
Expand Up @@ -4,6 +4,8 @@

use PHPUnit\Framework\TestCase;
use SimpleSAML\Configuration;
use SimpleSAML\Metadata\MetaDataStorageHandler;
use SimpleSAML\XHTML\IdPDisco;

/**
* Tests for the IdPDisco class.
Expand Down Expand Up @@ -43,7 +45,7 @@ class IdPDiscoTest extends TestCase
*/
public function setUp()
{
$config = Configuration::loadFromArray($this->$config);
$config = Configuration::loadFromArray($this->config);

Configuration::setPreloadedConfig($config, 'config.php');

Expand All @@ -52,17 +54,35 @@ public function setUp()


/**
*
* @runInSeparateProcess
*/
public function testPreferredTranslation()
{
$disco = new IdPDisco(['saml20-idp-remote'], 'unittest');

$reflection = new \ReflectionClass(get_class($disco));
$method = $reflection->getMethod('getPreferredTranslations');
$method->setAccessible(true);

$idpList = $method->invokeArgs($disco, $idpList);

// Assert that result comes with the right translation based on default languages and available translations
}


/**
*
* @runInSeparateProcess
*/
public function testIdPSortingOrder()
{
$disco = new IdPDisco(['saml20-idp-remote'], 'unittest');

$reflection = new \ReflectionClass(get_class($disco));
$method = $reflection->getMethod('getPreferredTranslations');
$method->setAccessible(true);

$idpList = $method->invokeArgs($disco, $idpList);

// Assert that result comes alphabetically ordered, whatever language or translation is used
}
}

0 comments on commit 7c597df

Please sign in to comment.