Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getDownloadLocaleResponseMock example
->
expects
(
self::
once
(
)
)
->
method
(
'getItem'
)
->
with
(
self::
callback
(
function
D
$v
)
use
(
$locale
,
$domain
)
{
$this
->
assertStringStartsWith
(
$locale
.'.'.
$domain
.'.',
$v
)
;
return
true;
}
)
)
->
willReturn
(
$item
)
;
$responses
=
[
'init locales' =>
$this
->
getInitLocaleResponseMock
(
)
,
'download locale' =>
$this
->
getDownloadLocaleResponseMock
(
$domain
,
$localeId
,
$responseContent
)
,
]
;
$this
->
getLoader
(
)
->
expects
(
$this
->
once
(
)
)
->
method
(
'load'
)
->
willReturn
(
$expectedTranslatorBag
->
getCatalogue
(
$locale
)
)
;
$provider
=
$this
->
createProvider
(
httpClient:
(
new
MockHttpClient
(
$responses
)
)
->
withOptions
(
[
'base_uri' => 'https://api.phrase.com/api/v2/projects/1/',
'headers' =>
[
'Authorization' => 'token API_TOKEN',