-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests for simplesamlphp configuration.
- Loading branch information
1 parent
eae991f
commit 47ee379
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
namespace Acquia\Blt\Tests\BltProject; | ||
|
||
use Acquia\Blt\Tests\BltProjectTestBase; | ||
|
||
/** | ||
* Class SimpleSamlPhpTest. | ||
* | ||
* Verifies simplesamlphp configuration. | ||
*/ | ||
class SimpleSamlPhpTest extends BltProjectTestBase { | ||
|
||
/** | ||
* Tests simplesamlphp:config:init target. | ||
* | ||
* Ensures simplesamlphp config files were copied to project. | ||
* | ||
* @group blt-project | ||
*/ | ||
public function testSimpleSamlPhpConfigInit() { | ||
$simpleSamlPhpConfigDirectory = "{$this->projectDirectory}/simplesamlphp/config"; | ||
$simpleSamlPhpMetadataDirectory = "{$this->projectDirectory}/simplesamlphp/metadata"; | ||
|
||
$this->assertFileExists("${simpleSamlPhpConfigDirectory}/authsources.php"); | ||
$this->assertFileExists("${simpleSamlPhpConfigDirectory}/config.php"); | ||
$this->assertFileExists("${simpleSamlPhpConfigDirectory}/acquia_config.php"); | ||
|
||
$configFilePath = "${simpleSamlPhpConfigDirectory}/config.php"; | ||
if (file_exists($configFilePath)) { | ||
$configFile = file_get_contents($configFilePath); | ||
$this->assertContains("include 'acquia_config.php';", $configFile); | ||
} | ||
|
||
$this->assertFileExists("${$simpleSamlPhpMetadataDirectory}/saml20-idp-remote.php"); | ||
} | ||
|
||
/** | ||
* Tests setSimpleSamlPhpInstalled. | ||
* | ||
* Ensures project.yml was updated with simplesamlphp key. | ||
* | ||
* @group blt-project | ||
*/ | ||
public function testSetSimpleSamlPhpInstalled() { | ||
$this->assertArrayHasKey('simplesamlphp', $this->config); | ||
} | ||
|
||
/** | ||
* Tests symlinkDocrootToLibDir. | ||
* | ||
* Ensures a symlink from the docroot to web accessible lib dir was created. | ||
* | ||
* @group blt-project | ||
*/ | ||
public function testSymlinkDocrootToLibDir() { | ||
$this->assertFileExists("{$this->drupalRoot}/simplesaml/saml2"); | ||
} | ||
|
||
} |