Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Comptoir du Libre v3 - Upcoming version
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Comptoir
Comptoir du Libre v3 - Upcoming version
Commits
16e4a0f3
Commit
16e4a0f3
authored
1 week ago
by
Fabrice Gangler
Browse files
Options
Downloads
Patches
Plain Diff
test(fixture): add i18n organization description
parent
9259fd7a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webapp/src/DataFixtures/AppOrganizationFixtures.php
+32
-2
32 additions, 2 deletions
webapp/src/DataFixtures/AppOrganizationFixtures.php
webapp/tests/Functional/Organization/FunctionalTestOrganizationPagesTest.php
+1
-1
1 addition, 1 deletion
...onal/Organization/FunctionalTestOrganizationPagesTest.php
with
33 additions
and
3 deletions
webapp/src/DataFixtures/AppOrganizationFixtures.php
+
32
−
2
View file @
16e4a0f3
...
...
@@ -22,6 +22,7 @@
namespace
App\DataFixtures
;
use
App\Entity\Organization
;
use
App\Entity\OrganizationI18n
;
use
App\Entity\OrganizationType
;
use
Doctrine\Bundle\FixturesBundle\Fixture
;
use
Doctrine\Persistence\ObjectManager
;
...
...
@@ -33,14 +34,31 @@ class AppOrganizationFixtures extends Fixture
];
public
const
ORGANIZATIONS
=
[
[
1
=>
[
'id'
=>
1
,
// must be identical to array key
'createdAt'
=>
'2016-06-19 13:31:24'
,
'updatedAt'
=>
'2025-01-25 14:22:05'
,
'type'
=>
'no_profit'
,
'name'
=>
"ADULLACT"
,
'slug'
=>
'adullact'
,
'website'
=>
'https://adullact.org'
,
'oldComptoirId'
=>
999
,
'description'
=>
[
'fr'
=>
"Association **des** ...
\n
"
.
"- logiciel libre
\n
- numrérique libre"
,
'en'
=>
'No **profit** organization...'
,
],
],
2
=>
[
'id'
=>
2
,
// must be identical to array key
'createdAt'
=>
'2022-06-19 13:31:24'
,
'updatedAt'
=>
'2022-07-25 14:22:05'
,
'type'
=>
'public_sector'
,
'name'
=>
"Mairie d'Abbeville"
,
'slug'
=>
'mairie-d-abbeville'
,
],
[
3
=>
[
'id'
=>
3
,
// must be identical to array key
'createdAt'
=>
'2023-06-19 13:31:24'
,
'updatedAt'
=>
'2023-07-25 14:22:05'
,
'type'
=>
'public_sector'
,
...
...
@@ -80,6 +98,18 @@ public function load(ObjectManager $manager): void
}
$manager
->
persist
(
$organization
);
$manager
->
flush
();
if
(
isset
(
$data
[
'description'
]))
{
foreach
(
$data
[
'description'
]
as
$locale
=>
$text
)
{
$organizationI18n
=
new
OrganizationI18n
();
$organizationI18n
->
setOrganization
(
$organization
);
$organizationI18n
->
setLocale
(
$locale
);
$organizationI18n
->
setType
(
1
);
$organizationI18n
->
setText
(
$text
);
$manager
->
persist
(
$organizationI18n
);
$manager
->
flush
();
}
}
}
}
}
This diff is collapsed.
Click to expand it.
webapp/tests/Functional/Organization/FunctionalTestOrganizationPagesTest.php
+
1
−
1
View file @
16e4a0f3
...
...
@@ -76,7 +76,7 @@ public function testOneOrganizationPageAllowToTruncateUrlToRedirectToAllOrganiza
public
function
testOneOrganizationPageAllowToChangeLocaleInUrl
():
void
{
$organizationId
=
AppOrganizationFixtures
::
ORGANIZATIONS
[
2
][
'id'
];
$organizationId
=
AppOrganizationFixtures
::
ORGANIZATIONS
[
3
][
'id'
];
$organizationSlug
=
AppOrganizationFixtures
::
ORGANIZATIONS
[
$organizationId
][
'slug'
];
$client
=
static
::
createClient
();
$this
->
checkRedirectionToNewUrl
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment