SilverStripe\MultiDomain\Tests\MultiDomainDomainTest
Synopsis
class MultiDomainDomainTest
extends SapphireTest
{
- // methods
- public void setUp()
- public void testGetHostname()
- public void testGetUrl()
- public void testIsPrimary()
- public void testIsActiveReturnsFalseWhenRequestUriIsAllowedPath()
- public void testSubdomainsAllowedInIsActiveWhenConfigured()
- public void testReturnActiveIfCurrentHostMatchesDomainsHostname()
- public void testGetNativeUrlThrowsExceptionOnPrimaryDomain()
- public void testGetNativeUrl()
- public void testGetNativeUrlReturnsInputWhenUrlIsAllowedOrForced()
- public void testGetVanityUrlReturnsInputWhenUrlIsAllowedOrIsPrimaryDomain()
- public void testGetVanityUrl()
- public void tearDown()
Hierarchy
Extends
- SilverStripe\Dev\SapphireTest
Methods
public
- setUp() — Set up some test domain data for testing
- tearDown()
- testGetHostname() — Test that a hostname defined in a constant will override the default configuration, otherwise the default configuration for the domain is returned
- testGetNativeUrl() — Test that a URL segment can be added to the domain's URL and returned as a "native URL"
- testGetNativeUrlReturnsInputWhenUrlIsAllowedOrForced() — "Allowed" and "forced" URLs should just be returned from getNativeUrl as is
- testGetNativeUrlThrowsExceptionOnPrimaryDomain() — getNativeUrl should not be used on the primary domain
- testGetUrl() — Test that the domain's "resolves to" property is returned for the URL if it is defined, otherwise null
- testGetVanityUrl() — Non-primary domains and un-allowed route matches should be returned without their URL for vanity
- testGetVanityUrlReturnsInputWhenUrlIsAllowedOrIsPrimaryDomain() — The primary domain and "allowed" route matches should be returned as it
- testIsActiveReturnsFalseWhenRequestUriIsAllowedPath() — When the request URI matches one of the allowed rules for a domain, the isActive method should return false
- testIsPrimary() — Test that a domain can be identified as the primary domain or otherwise
- testReturnActiveIfCurrentHostMatchesDomainsHostname() — The default behaviour would be that if the current host from the request matchese that of the domain model then isActive should be true
- testSubdomainsAllowedInIsActiveWhenConfigured() — When a subdomain is "allowed" and is requested, subdomains should be allowed through "isActive" as well as the primary domain