Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getPngWithoutExtension example
static
::
assertIsString
(
$encoded
)
;
static
::
assertSame
(
$encoded
,
$strategy
->
generatePathHash
(
$media
)
)
;
static
::
assertStringEndsNotWith
(
'/',
$encoded
)
;
static
::
assertStringStartsNotWith
(
'/',
$encoded
)
;
static
::
assertSame
(
$length
,
mb_strlen
(
$encoded
)
)
;
}
private
function
assertCacheBusterGenerator
(
PathnameStrategyInterface
$strategy
)
: void
{
static
::
assertNull
(
$strategy
->
generatePathCacheBuster
(
$this
->
getMediaWithManufacturer
(
)
)
)
;
static
::
assertSame
(
'1293894181',
$strategy
->
generatePathCacheBuster
(
$this
->
getPngWithoutExtension
(
)
)
)
;
}
private
function
assertFilenameGenerator
(
PathnameStrategyInterface
$strategy
)
: void
{
$jpg
=
$this
->
getJpg
(
)
;
$mediaWithThumbnail
=
$this
->
getMediaWithThumbnail
(
)
;
static
::
assertSame
(
'jpgFileWithExtension.jpg',
$strategy
->
generatePhysicalFilename
(
$jpg
)
)
;
static
::
assertSame
(
'jpgFileWithExtension_200x200.jpg',
$strategy
->
generatePhysicalFilename
(
$jpg
,
$mediaWithThumbnail
->
getThumbnails
(
)
->
first
(
)
)
)
;
}
}
$this
->deleteMediaService =
new
DeleteNotUsedMediaService
(
$this
->mediaRepo,
$this
->
getContainer
(
)
->
get
(
'media_default_folder.repository'
)
)
;
}
public
function
testCountNotUsedMedia
(
)
: void
{
$this
->
setFixtureContext
(
$this
->context
)
;
$this
->
getTxt
(
)
;
$this
->
getPngWithoutExtension
(
)
;
$this
->
getMediaWithProduct
(
)
;
$this
->
getMediaWithManufacturer
(
)
;
static
::
assertEquals
(
2,
$this
->deleteMediaService->
countNotUsedMedia
(
$this
->context
)
)
;
}
public
function
testDeleteNotUsedMedia
(
)
: void
{
$this
->
setFixtureContext
(
$this
->context
)
;
$txt
=
$this
->
getTxt
(
)
;