function AcquiaLiftsWebTest::testLiftCredentials in Acquia Lift Connector 7.3
Test credentials are output for Lift.
File
- tests/
acquia_lift.test, line 300 - Tests for Acquia Lift Profiles module.
Class
- AcquiaLiftsWebTest
- Tests Acquia Lift functionality.
Code
function testLiftCredentials() {
// Lift not configured then no credentials
$this
->drupalGet('/');
$this
->assertNoLift();
$this
->assertNoLiftMetaTag('account_id');
$this
->assertNoLiftMetaTag('site_id');
$this
->assertNoLiftMetaTag('liftAssetsURL');
$this
->assertNoLiftMetaTag('liftDecisionAPIURL');
$this
->assertNoLiftMetaTag('context_language');
$this
->assertNoLiftMetaTag('authEndpoint');
$this
->assertNoLiftMetaTag('bootstrapMode');
$this
->assertNoLiftMetaTag('contentReplacementMode');
$this
->assertNoLiftMetaTag('contentOrigin');
$this
->assertNoLiftMetaTag('userAccess');
$this
->configureLift();
// Sets up the account id, site id, and assets url.
$this
->drupalGet('/');
$this
->assertLift();
$this
->assertLiftMetaTag('account_id');
$this
->assertLiftMetaTag('site_id');
$this
->assertLiftMetaTag('context_language', 'en');
$this
->assertLiftMetaTag('liftAssetsURL');
$this
->assertNoLiftMetaTag('liftDecisionAPIURL');
$this
->assertNoLiftMetaTag('authEndpoint');
$this
->assertLiftMetaTag('bootstrapMode', 'auto');
$this
->assertLiftMetaTag('contentReplacementMode', 'untrusted');
$this
->assertLiftMetaTag('contentOrigin', '');
$this
->assertLiftMetaTag('userAccess', '');
// Manually set all the configuration variables and confirm meta tags.
variable_set('acquia_lift_account_id', 'MY_ACCOUNT');
variable_set('acquia_lift_site_id', 'MY_SITE');
variable_set('acquia_lift_context_language', 'en');
variable_set('acquia_lift_assets_url', 'https://example.com/assets/stable');
variable_set('acquia_lift_decision_api_url', 'https://example.com/decisionapi');
variable_set('acquia_lift_oauth_url', 'https://example.com/authorize');
variable_set('acquia_lift_bootstrap_mode', 'manual');
variable_set('acquia_lift_content_replacement_mode', 'trusted');
variable_set('acquia_lift_content_origin', '08c93130-2e45-45f6-af6d-7c02de8cd90c');
variable_set('acquia_lift_user_access', 'test-user-access');
$this
->drupalGet('/');
$this
->assertLift();
$this
->assertLiftMetaTag('account_id', 'MY_ACCOUNT');
$this
->assertLiftMetaTag('site_id', 'MY_SITE');
$this
->assertLiftMetaTag('context_language', 'en');
$this
->assertLiftMetaTag('liftAssetsURL', 'https://example.com/assets/stable');
$this
->assertLiftMetaTag('liftDecisionAPIURL', 'https://example.com/decisionapi');
$this
->assertLiftMetaTag('authEndpoint', 'https://example.com/authorize');
$this
->assertLiftMetaTag('bootstrapMode', 'manual');
$this
->assertLiftMetaTag('contentReplacementMode', 'trusted');
$this
->assertLiftMetaTag('contentOrigin', '08c93130-2e45-45f6-af6d-7c02de8cd90c');
$this
->assertLiftMetaTag('userAccess', 'test-user-access');
}