Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
bibliossimo
opacce
Commits
399b8bf9
Commit
399b8bf9
authored
Dec 11, 2017
by
Laurent
Browse files
dev #13615 fix loans links
parent
d4b66182
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
15 deletions
+58
-15
library/ZendAfi/View/Helper/Abonne/LoansHistory.php
library/ZendAfi/View/Helper/Abonne/LoansHistory.php
+3
-3
library/ZendAfi/View/Helper/AuthorAnchor.php
library/ZendAfi/View/Helper/AuthorAnchor.php
+7
-5
tests/application/modules/opac/controllers/AbonneControllerLoansHistoryNanookTest.php
...ac/controllers/AbonneControllerLoansHistoryNanookTest.php
+36
-3
tests/library/ZendAfi/View/Helper/AuthorAnchorTest.php
tests/library/ZendAfi/View/Helper/AuthorAnchorTest.php
+12
-4
No files found.
library/ZendAfi/View/Helper/Abonne/LoansHistory.php
View file @
399b8bf9
...
...
@@ -75,11 +75,11 @@ class ZendAfi_View_Helper_Abonne_LoansHistory extends ZendAfi_View_Helper_Abonne
.
$this
->
_tag
(
'td'
,
$this
->
_renderDocTypeLabel
(
$loan
))
.
$this
->
_tag
(
'td'
,
$this
->
_renderThumbnail
(
$loan
,
[
'retour_abonne'
=>
'
prets
'
]))
$this
->
_renderThumbnail
(
$loan
,
[
'retour_abonne'
=>
'
loans-history
'
]))
.
$this
->
_tag
(
'td'
,
$this
->
_renderTitle
(
$loan
,
[
'retour_abonne'
=>
'
prets
'
]))
$this
->
_renderTitle
(
$loan
,
[
'retour_abonne'
=>
'
loans-history
'
]))
.
$this
->
_tag
(
'td'
,
$this
->
_renderAuthor
(
$loan
,
[
'retour_abonne'
=>
'
prets
'
]))
$this
->
_renderAuthor
(
$loan
,
[
'retour_abonne'
=>
'
loans-history
'
]))
.
$this
->
_tag
(
'td'
,
$loan
->
getIssueDate
())
.
$this
->
_tag
(
'td'
,
...
...
library/ZendAfi/View/Helper/AuthorAnchor.php
View file @
399b8bf9
...
...
@@ -26,11 +26,13 @@ class ZendAfi_View_Helper_AuthorAnchor extends ZendAfi_View_Helper_BaseHelper {
if
(
!
$author
)
return
''
;
if
(
$facet
=
Class_CodifAuteur
::
findWithFullName
(
$author
))
$params
=
array_merge
([
'controller'
=>
'recherche'
,
'action'
=>
'simple'
,
'facette'
=>
Class_CodifAuteur
::
CODE_FACETTE
.
$facet
->
getId
()],
$params
);
if
(
!
$facet
=
Class_CodifAuteur
::
findWithFullName
(
$author
))
return
$author
;
$params
=
array_merge
([
'controller'
=>
'recherche'
,
'action'
=>
'simple'
,
'facette'
=>
Class_CodifAuteur
::
CODE_FACETTE
.
$facet
->
getId
()],
$params
);
return
$this
->
view
->
tagAnchor
(
$this
->
view
->
url
(
$params
,
null
,
true
),
$author
);
...
...
tests/application/modules/opac/controllers/AbonneControllerLoansHistoryNanookTest.php
View file @
399b8bf9
...
...
@@ -46,7 +46,8 @@ abstract class AbonneControllerLoansHistoryNanookTestCase extends AbstractContro
$this
->
_emprunteur
=
new
Class_WebService_SIGB_Emprunteur
(
'34'
,
'faustine'
);
$faustine
->
setFicheSigb
([
'type_comm'
=>
Class_IntBib
::
COM_NANOOK
,
'fiche'
=>
$this
->
_emprunteur
]);
'fiche'
=>
$this
->
_emprunteur
,
'int_bib'
=>
$library
]);
ZendAfi_Auth
::
getInstance
()
->
logUser
(
$faustine
);
$this
->
_mock_web_client
=
$this
->
mock
();
...
...
@@ -55,6 +56,30 @@ abstract class AbonneControllerLoansHistoryNanookTestCase extends AbstractContro
$service
->
setWebClient
(
$this
->
_mock_web_client
);
$this
->
_emprunteur
->
setService
(
$service
);
$this
->
fixture
(
'Class_Notice'
,
[
'id'
=>
464732
,
'titre_principal'
=>
'La femme à droite sur la photo'
,
'auteur_principal'
=>
'Valentin Musso'
,
'type_doc'
=>
Class_TypeDoc
::
LIVRE
,
'exemplaires'
=>
[
$this
->
fixture
(
'Class_Exemplaire'
,
[
'id'
=>
5
,
'code_barres'
=>
231645
,
'id_origine'
=>
464732
,
'int_bib'
=>
$library
])]]);
$this
->
onLoaderOfModel
(
'Class_CodifAuteur'
)
->
whenCalled
(
'findWithFullName'
)
->
answers
(
null
)
->
whenCalled
(
'findWithFullName'
)
->
with
(
'Valentin Musso'
)
->
answers
(
$this
->
fixture
(
'Class_CodifAuteur'
,
[
'id'
=>
11
,
'libelle'
=>
'Valentin Musso'
,
'formes'
=>
'MUSSOxxVALENTIN'
]));
$this
->
_mock_web_client
->
whenCalled
(
'open_url'
)
->
with
(
'http://localhost/afi_Nanook/ilsdi/service/GetLoanHistory/patronId/34?pageNumber=1'
)
...
...
@@ -78,8 +103,16 @@ class AbonneControllerLoansHistoryNanookIndexTest extends AbonneControllerLoansH
}
/** @test */
public
function
pageShouldContainLoanLaFemmeADroite
()
{
$this
->
assertXPathContentContains
(
'//table'
,
'La femme à droite sur la photo'
);
public
function
pageShouldContainLoanLaFemmeADroiteLink
()
{
$this
->
assertXPathContentContains
(
'//table//a[contains(@href, "/recherche/viewnotice/page_size/2/id/464732/retour_abonne/loans-history")]'
,
'La femme à droite sur la photo'
);
}
/** @test */
public
function
valentinMussoShouldLinkToFacetA11
()
{
$this
->
assertXPathContentContains
(
'//table//a[contains(@href, "/recherche/simple/facette/A11/retour_abonne/loans-history")]'
,
'Valentin Musso'
);
}
...
...
tests/library/ZendAfi/View/Helper/AuthorAnchorTest.php
View file @
399b8bf9
...
...
@@ -38,13 +38,15 @@ class ZendAfi_View_Helper_AnchorAuthorSimpleTest extends ViewHelperTestCase {
'formes'
=>
'KONDxxMARIE'
]);
$this
->
onLoaderOfModel
(
'Class_CodifAuteur'
)
->
whenCalled
(
'findWithFullName'
)
->
answers
(
null
)
->
whenCalled
(
'find
ByLastNameFirst
Name'
)
->
with
(
'Stéphanie
'
,
'
BRISSON'
)
->
whenCalled
(
'find
WithFull
Name'
)
->
with
(
'Stéphanie
BRISSON'
)
->
answers
(
$brisson
)
->
whenCalled
(
'find
ByLastNameFirst
Name'
)
->
with
(
'Marie
'
,
'
Kondō'
)
->
whenCalled
(
'find
WithFull
Name'
)
->
with
(
'Marie
Kondō'
)
->
answers
(
$kondu
);
...
...
@@ -63,4 +65,10 @@ class ZendAfi_View_Helper_AnchorAuthorSimpleTest extends ViewHelperTestCase {
public
function
shouldReturnAnchorWithFacetA11
()
{
$this
->
assertContains
(
'/recherche/simple/facette/A11">Marie Kondō</a>'
,
$this
->
_helper
->
authorAnchor
(
'Marie Kondō'
));
}
/** @test */
public
function
withUnknownAuthorShouldNotRenderLink
()
{
$this
->
assertEquals
(
'Anonymous'
,
$this
->
_helper
->
authorAnchor
(
'Anonymous'
));
}
}
\ No newline at end of file
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