Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
9c75b997
Commit
9c75b997
authored
May 10, 2021
by
Thomas Löffler
Browse files
Fix unit tests
parent
1f5e994f
Pipeline
#11350
passed with stages
in 5 minutes and 49 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
extensions/ter_fe2/Classes/Service/ExtensionIndexService.php
View file @
9c75b997
...
@@ -119,13 +119,7 @@ class ExtensionIndexService implements LoggerAwareInterface
...
@@ -119,13 +119,7 @@ class ExtensionIndexService implements LoggerAwareInterface
$dom
=
new
\
DOMDocument
(
'1.0'
,
'utf-8'
);
$dom
=
new
\
DOMDocument
(
'1.0'
,
'utf-8'
);
$dom
->
formatOutput
=
true
;
$dom
->
formatOutput
=
true
;
$extensionsObj
=
$dom
->
appendChild
(
new
\
DOMElement
(
'extensions'
));
$extensionsObj
=
$dom
->
appendChild
(
new
\
DOMElement
(
'extensions'
));
$distributionBaseUrl
=
implode
(
$distributionBaseUrl
=
$this
->
getDistributionBaseUrl
();
''
,
[
(
string
)
GeneralUtility
::
makeInstance
(
SiteFinder
::
class
)
->
getSiteByIdentifier
(
'extensions'
)
->
getBase
()
.
'/'
,
ResourceFactory
::
getInstance
()
->
getDefaultStorage
()
->
getFolder
(
'ter'
)
->
getPublicUrl
()
]
);
// Create the nested XML structure:
// Create the nested XML structure:
foreach
(
$extensionsAndVersionsArr
as
$extensionKey
=>
$extensionVersionsArr
)
{
foreach
(
$extensionsAndVersionsArr
as
$extensionKey
=>
$extensionVersionsArr
)
{
...
@@ -260,4 +254,15 @@ class ExtensionIndexService implements LoggerAwareInterface
...
@@ -260,4 +254,15 @@ class ExtensionIndexService implements LoggerAwareInterface
?
(
string
)
serialize
(
json_decode
(
$dependencies
,
true
))
?
(
string
)
serialize
(
json_decode
(
$dependencies
,
true
))
:
''
;
:
''
;
}
}
protected
function
getDistributionBaseUrl
():
string
{
return
implode
(
''
,
[
(
string
)
GeneralUtility
::
makeInstance
(
SiteFinder
::
class
)
->
getSiteByIdentifier
(
'extensions'
)
->
getBase
()
.
'/'
,
GeneralUtility
::
makeInstance
(
ResourceFactory
::
class
)
->
getDefaultStorage
()
->
getFolder
(
'ter'
)
->
getPublicUrl
()
]
);
}
}
}
extensions/ter_fe2/Tests/Unit/Service/ExtensionIndexServiceTest.php
View file @
9c75b997
...
@@ -134,7 +134,18 @@ class ExtensionIndexServiceTest extends UnitTestCase
...
@@ -134,7 +134,18 @@ class ExtensionIndexServiceTest extends UnitTestCase
</extension>
</extension>
</extensions>
</extensions>
'
;
'
;
$subject
=
new
ExtensionIndexService
(
Environment
::
getVarPath
()
.
'/tests-extensions-xml'
);
$subject
=
self
::
getAccessibleMock
(
ExtensionIndexService
::
class
,
[
'getDistributionBaseUrl'
],
[
Environment
::
getVarPath
()
.
'/tests-extensions-xml'
],
''
,
false
);
$subject
->
expects
(
self
::
once
())
->
method
(
'getDistributionBaseUrl'
)
->
willReturn
(
'https://ter.local/fileadmin/ter/'
);
$extensions
=
[
$extensions
=
[
'acme'
=>
[
'acme'
=>
[
'downloads'
=>
13
,
'downloads'
=>
13
,
...
...
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