|
|
@@ -47,7 +47,6 @@ class TestableShopService extends ShopService
|
|
|
parent::sendRequestValidationLink($shopRequest);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public function handleNewStructureArtistPremiumTrialRequest(string $token): void
|
|
|
{
|
|
|
parent::handleNewStructureArtistPremiumTrialRequest($token);
|
|
|
@@ -70,8 +69,8 @@ class TestableShopService extends ShopService
|
|
|
|
|
|
public function createOrganizationCreationRequestFromTrialRequest(
|
|
|
NewStructureArtistPremiumTrialRequest $trialRequest,
|
|
|
- bool $forValidationOnly = false
|
|
|
- ): \App\ApiResources\Organization\OrganizationCreationRequest {
|
|
|
+ bool $forValidationOnly = false,
|
|
|
+ ): OrganizationCreationRequest {
|
|
|
return parent::createOrganizationCreationRequestFromTrialRequest($trialRequest, $forValidationOnly);
|
|
|
}
|
|
|
}
|
|
|
@@ -305,7 +304,6 @@ class ShopServiceTest extends TestCase
|
|
|
$shopService->sendRequestValidationLink($shopRequest);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* Test handleNewStructureArtistPremiumTrialRequest method.
|
|
|
*/
|
|
|
@@ -412,33 +410,6 @@ class ShopServiceTest extends TestCase
|
|
|
$this->assertSame($organization, $result);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Test generateSubdomain method.
|
|
|
- */
|
|
|
- public function testGenerateSubdomain(): void
|
|
|
- {
|
|
|
- $shopService = $this->getShopServiceMockFor('generateSubdomain');
|
|
|
-
|
|
|
- // Test with a simple name
|
|
|
- $this->assertEquals('test-structure', $shopService->generateSubdomain('Test Structure'));
|
|
|
-
|
|
|
- // Test with accents and special characters
|
|
|
- $this->assertEquals('ecole-de-musique', $shopService->generateSubdomain('École de Musique'));
|
|
|
-
|
|
|
- // Test with multiple spaces and special characters
|
|
|
- $this->assertEquals('conservatoire-regional', $shopService->generateSubdomain('Conservatoire Régional!@#'));
|
|
|
-
|
|
|
- // Test with a very long name (should be truncated to 30 characters)
|
|
|
- $longName = 'This is a very long name that should be truncated';
|
|
|
- $this->assertEquals('this-is-a-very-long-name-that', $shopService->generateSubdomain($longName));
|
|
|
-
|
|
|
- // Test with leading and trailing hyphens (should be trimmed)
|
|
|
- $this->assertEquals('trimmed', $shopService->generateSubdomain('--Trimmed--'));
|
|
|
-
|
|
|
- // Test with consecutive special characters (should be replaced with a single hyphen)
|
|
|
- $this->assertEquals('multiple-hyphens', $shopService->generateSubdomain('Multiple!!!Hyphens'));
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Test validateNewStructureArtistPremiumTrialRequest method with valid data.
|
|
|
*/
|
|
|
@@ -526,11 +497,7 @@ class ShopServiceTest extends TestCase
|
|
|
$trialRequest->method('getStructureType')->willReturn(PrincipalTypeEnum::ARTISTIC_EDUCATION_ONLY);
|
|
|
$trialRequest->method('getLegalStatus')->willReturn(LegalEnum::ASSOCIATION_LAW_1901);
|
|
|
$trialRequest->method('getSiren')->willReturn('123456789');
|
|
|
-
|
|
|
- $shopService->expects(self::once())
|
|
|
- ->method('generateSubdomain')
|
|
|
- ->with('Test Structure')
|
|
|
- ->willReturn('test-structure');
|
|
|
+ $trialRequest->method('getStructureIdentifier')->willReturn('test-structure');
|
|
|
|
|
|
// Set a fake date for testing
|
|
|
$fakeDate = '2023-05-15 10:30:00';
|