Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
don
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
LQDN Adminsys
don
Commits
cb111eba
Commit
cb111eba
authored
Oct 13, 2018
by
Okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finally, extract the PDF attributes from tables.
parent
3520bb48
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
15 deletions
+24
-15
db/seeds/AddressSeeder.php
db/seeds/AddressSeeder.php
+13
-0
db/seeds/CounterpartSeeder.php
db/seeds/CounterpartSeeder.php
+1
-1
db/seeds/DonationSeeder.php
db/seeds/DonationSeeder.php
+1
-1
src/LQDN/Finder/CounterpartFinder.php
src/LQDN/Finder/CounterpartFinder.php
+7
-6
tests/functional/Finder/CounterpartFinderTest.php
tests/functional/Finder/CounterpartFinderTest.php
+2
-7
No files found.
db/seeds/AddressSeeder.php
View file @
cb111eba
...
...
@@ -54,6 +54,19 @@ class AddressSeeder extends AbstractSeed
'user_id'
=>
1
,
'defaut'
=>
false
,
),
array
(
'id'
=>
5
,
'nom'
=>
'Bob address'
,
'adresse'
=>
'4 rue Ménars'
,
'adresse2'
=>
null
,
'codepostal'
=>
75003
,
'ville'
=>
'Paris'
,
'etat'
=>
null
,
'pays'
=>
'France'
,
'alias'
=>
'Third address'
,
'user_id'
=>
2
,
'defaut'
=>
false
,
),
);
$this
->
table
(
'adresses'
)
->
insert
(
$data
)
->
save
();
...
...
db/seeds/CounterpartSeeder.php
View file @
cb111eba
...
...
@@ -29,7 +29,7 @@ class CounterpartSeeder extends AbstractSeed
'datec'
=>
'2016-06-22 12:34'
,
'user_id'
=>
2
,
'quoi'
=>
'piplome'
,
// [piplome|pibag|pishirt|hoodie]
'taille'
=>
1
,
'taille'
=>
2
,
'status'
=>
1
,
'adresse_id'
=>
null
,
),
...
...
db/seeds/DonationSeeder.php
View file @
cb111eba
...
...
@@ -63,7 +63,7 @@ class DonationSeeder extends AbstractSeed
'fdnn_user'
=>
1234567890
,
'color_2'
=>
'red'
,
'cumul'
=>
1000
,
'adresse_id'
=>
1
,
'adresse_id'
=>
3
,
'user_id'
=>
2
,
'identifier'
=>
'id2'
,
),
...
...
src/LQDN/Finder/CounterpartFinder.php
View file @
cb111eba
...
...
@@ -34,19 +34,20 @@ class CounterpartFinder
// @TODO: This part is probably not working.
if
(
'piplome'
===
$counterpart
[
'quoi'
])
{
$query
=
<<<EOQ
SELECT d.id
AS
id, a.nom as pseudo, d.pdf as pdf
SELECT d.id
as
id, a.nom as pseudo, d.pdf as pdf
FROM dons d
JOIN adresses a ON a.id = d.adresse_id
WHERE d.id = :don_id
JOIN contreparties c ON c.id = d.taille
WHERE d.taille = :size
EOQ;
$pdf
=
$this
->
connection
->
fetchAssoc
(
$query
,
[
'
don_id'
=>
$counterpart
[
'
'
]
'
size'
=>
$counterpart
[
'taille
'
]
]);
if
(
false
!==
$pdf
)
{
$co
ntrepartie
[
'pdf_id'
]
=
$pdf
[
'id'
];
$co
ntrepartie
[
'pdf_nom'
]
=
$pdf
[
'pseudo'
];
$co
ntrepartie
[
'pdf_url'
]
=
$pdf
[
'pdf'
];
$co
unterpart
[
'pdf_id'
]
=
$pdf
[
'id'
];
$co
unterpart
[
'pdf_nom'
]
=
$pdf
[
'pseudo'
];
$co
unterpart
[
'pdf_url'
]
=
$pdf
[
'pdf'
];
}
}
...
...
tests/functional/Finder/CounterpartFinderTest.php
View file @
cb111eba
...
...
@@ -19,18 +19,13 @@ class CounterpartFinderTest extends FunctionalTest
'user_id'
=>
'2'
,
'datec'
=>
'2016-06-22 12:34:00'
,
'quoi'
=>
'piplome'
,
'taille'
=>
'
1
'
,
'taille'
=>
'
2
'
,
'status'
=>
'1'
,
'adresse_id'
=>
null
,
'pdf_id'
=>
'1'
,
'pdf_nom'
=>
'
bob@example.org
'
,
'pdf_nom'
=>
'
Main
'
,
'pdf_url'
=>
'pdf'
,
];
$this
->
assertEquals
(
$expectedCounterpart
,
$firstCounterpart
);
// Test the PDF attributes
$this
->
assertEquals
(
2
,
$firstCounterpart
[
'pdf_id'
]);
$this
->
assertEquals
(
'Bob'
,
$firstCounterpart
[
'pdf_nom'
]);
$this
->
assertEquals
(
'http://example.org/pdf/2'
,
$firstCounterpart
[
'pdf_url'
]);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment