forked from ecamp/ecamp3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: try to test the performance of our endpoints against a larger da…
…tabase This failed because it takes too long to load the fixtures n times.
- Loading branch information
Showing
6 changed files
with
53 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ App\Entity\CampCollaboration: | |
campCollaboration4invited: | ||
camp: '@camp1' | ||
inviteKey: "myInviteKey" | ||
inviteKeyHash: "sl3hC12VkIUzT89mMggYyoMmFuo=" | ||
inviteKeyHash: "<name()>" | ||
inviteEmail: "[email protected]" | ||
status: invited | ||
role: member | ||
|
@@ -54,7 +54,7 @@ App\Entity\CampCollaboration: | |
campCollaboration2invitedCampUnrelated: | ||
camp: '@campUnrelated' | ||
inviteKey: "myInviteKey2" | ||
inviteKeyHash: "oNp2IShH2P5DIgvcdBZOwCqExZ0=" | ||
inviteKeyHash: "<name()>" | ||
inviteEmail: "[email protected]" | ||
status: invited | ||
role: member | ||
|
@@ -67,7 +67,7 @@ App\Entity\CampCollaboration: | |
user: '@user6invited' | ||
camp: '@camp2' | ||
inviteKey: "myInviteKeyCamp2" | ||
inviteKeyHash: "ufVn1nkIodzMXLPB/ZI4JwNwSRg=" | ||
inviteKeyHash: "<name()>" | ||
status: invited | ||
role: member | ||
campCollaboration1campPrototype: | ||
|
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 |
---|---|---|
@@ -1,34 +1,34 @@ | ||
App\Entity\ContentType: | ||
contentTypeSafetyConcept: | ||
name: 'SafetyConcept' | ||
name: <name()> | ||
active: true | ||
entityClass: 'App\Entity\ContentNode\SingleText' | ||
contentTypeStoryContext: | ||
name: 'Storycontext' | ||
name: <name()> | ||
active: true | ||
entityClass: 'App\Entity\ContentNode\SingleText' | ||
contentTypeNotes: | ||
name: 'Notes' | ||
name: <name()> | ||
active: true | ||
entityClass: 'App\Entity\ContentNode\SingleText' | ||
contentTypeColumnLayout: | ||
name: 'ColumnLayout' | ||
name: <name()> | ||
active: true | ||
entityClass: 'App\Entity\ContentNode\ColumnLayout' | ||
contentTypeResponsiveLayout: | ||
name: 'ResponsiveLayout' | ||
name: <name()> | ||
active: true | ||
entityClass: 'App\Entity\ContentNode\ResponsiveLayout' | ||
contentTypeStoryboard: | ||
name: 'Storyboard' | ||
name: <name()> | ||
active: true | ||
entityClass: 'App\Entity\ContentNode\Storyboard' | ||
contentTypeMaterial: | ||
name: 'Material' | ||
name: <name()> | ||
active: true | ||
entityClass: 'App\Entity\ContentNode\MaterialNode' | ||
contentTypeMultiSelect: | ||
name: 'LAThematicArea' | ||
name: <name()> | ||
active: true | ||
entityClass: 'App\Entity\ContentNode\MultiSelect' | ||
jsonConfig: { items: [ 'outdoorTechnique', 'security', 'natureAndEnvironment', 'pioneeringTechnique', 'campsiteAndSurroundings', 'preventionAndIntegration' ] } |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
App\Entity\Profile: | ||
profile1manager: | ||
user: '@user1manager' | ||
email: [email protected] | ||
email: <email()> | ||
firstname: Robert | ||
surname: Baden-Powell | ||
nickname: Bi-Pi | ||
|
@@ -65,7 +65,7 @@ App\Entity\Profile: | |
roles: [ 'ROLE_USER' ] | ||
profileAdmin: | ||
user: '@admin' | ||
email: [email protected] | ||
email: <email()> | ||
firstname: Admi | ||
surname: Nistrator | ||
nickname: Administrator | ||
|
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 |
---|---|---|
|
@@ -12,10 +12,8 @@ | |
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; | ||
use ApiPlatform\Symfony\Bundle\Test\Client; | ||
use App\Entity\BaseEntity; | ||
use App\Entity\Profile; | ||
use App\Entity\User; | ||
use App\Metadata\Resource\OperationHelper; | ||
use App\Repository\ProfileRepository; | ||
use App\Util\ArrayDeepSort; | ||
use Doctrine\Bundle\DoctrineBundle\DataCollector\DoctrineDataCollector; | ||
use Doctrine\ORM\EntityManagerInterface; | ||
|
@@ -81,16 +79,9 @@ public static function deepCloneArray(array $array): mixed { | |
* @throws ServerExceptionInterface | ||
* @throws TransportExceptionInterface | ||
*/ | ||
protected static function createClientWithCredentials(?array $credentials = null, ?array $headers = null): Client { | ||
protected static function createClientWithCredentials(string $userFixtureName = 'user1manager', ?array $headers = null): Client { | ||
$client = static::createBasicClient($headers); | ||
|
||
/** @var Profile $profile */ | ||
$profile = static::getContainer()->get(ProfileRepository::class) | ||
->findOneBy( | ||
array_diff_key($credentials ?: ['email' => '[email protected]'], ['password' => '']) | ||
) | ||
; | ||
$user = $profile->user; | ||
$user = self::getFixture($userFixtureName); | ||
|
||
$jwtToken = static::getContainer()->get('lexik_jwt_authentication.jwt_manager')->create($user); | ||
$lastPeriodPosition = strrpos($jwtToken, '.'); | ||
|
@@ -111,7 +102,7 @@ protected static function createClientWithCredentials(?array $credentials = null | |
* @throws TransportExceptionInterface | ||
*/ | ||
protected static function createClientWithAdminCredentials(?array $headers = null): Client { | ||
return static::createClientWithCredentials(['email' => '[email protected]']); | ||
return static::createClientWithCredentials('user1admin', $headers); | ||
} | ||
|
||
protected static function createBasicClient(?array $headers = null): Client { | ||
|
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