Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
don
Commits
fd678f60
Commit
fd678f60
authored
Nov 08, 2018
by
Okhin
Browse files
N'interdire la suppression que si une contrepartie en statut 1 est associée à l'adresse
parent
7cfc2e76
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
db/seeds/CounterpartSeeder.php
View file @
fd678f60
...
...
@@ -30,7 +30,7 @@ class CounterpartSeeder extends AbstractSeed
'user_id'
=>
2
,
'quoi'
=>
'piplome'
,
// [piplome|pibag|pishirt|hoodie]
'taille'
=>
2
,
'status'
=>
1
,
'status'
=>
2
,
'adresse_id'
=>
null
,
),
);
...
...
src/LQDN/Handler/AddressHandler.php
View file @
fd678f60
...
...
@@ -92,7 +92,7 @@ EOF;
private
function
addressUsed
(
$addressId
)
{
$count
=
(
int
)
$this
->
connection
->
fetchColumn
(
"SELECT count(1) FROM contreparties, dons WHERE contreparties.adresse_id = :id
OR dons.adresse_id = :id
"
,
"SELECT count(1) FROM contreparties, dons WHERE contreparties.adresse_id = :id
AND contreparties.status = 1;
"
,
[
'id'
=>
$addressId
,
],
...
...
tests/functional/Finder/CounterpartFinderTest.php
View file @
fd678f60
...
...
@@ -20,7 +20,7 @@ class CounterpartFinderTest extends FunctionalTest
'datec'
=>
'2016-06-22 12:34:00'
,
'quoi'
=>
'piplome'
,
'taille'
=>
'2'
,
'status'
=>
'
1
'
,
'status'
=>
'
2
'
,
'adresse_id'
=>
null
,
'pdf_id'
=>
'1'
,
'pdf_nom'
=>
'Main'
,
...
...
tests/functional/Handler/AddressHandlerTest.php
View file @
fd678f60
...
...
@@ -16,6 +16,10 @@ class AddressHandlerTest extends FunctionalTest
$this
->
setExpectedException
(
'LQDN\Exception\AddressUsedException'
);
$this
->
container
[
'command_handler'
]
->
handle
(
new
AddressDeleteCommand
(
1
,
1
));
$this
->
container
[
'command_handler'
]
->
handle
(
new
AddressDeleteCommand
(
2
,
1
));
$this
->
assertFalse
(
$this
->
addressExists
(
2
));
}
public
function
testAdressDelete
()
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment