Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
thumbnailSizesIds example
class
Migration1687462843ProductManufacturerMediaThumbnailsTest
extends
TestCase
{
use
KernelTestBehaviour;
public
function
testUpdate
(
)
: void
{
/** @var Connection $con */
$con
=
$this
->
getContainer
(
)
->
get
(
Connection::
class
)
;
if
(
\
count
(
$this
->
thumbnailSizesIds
(
$con
)
)
> 1
)
{
$this
->
revertMigration
(
$con
)
;
}
// 1920px is already registered
static
::
assertCount
(
1,
$this
->
thumbnailSizesIds
(
$con
)
)
;
$productManufacturerFolderConfigurationId
=
$this
->
getProductManufacturerFolderConfigurationId
(
$con
)
;
static
::
assertNotNull
(
$productManufacturerFolderConfigurationId
)
;
static
::
assertCount
(
0,
$this
->
getConfiguredThumbnailSizeIds
(
$con
,
$productManufacturerFolderConfigurationId
)
)
;
class
Migration1687463180ProductMediaThumbnailsTest
extends
TestCase
{
use
KernelTestBehaviour;
public
function
testUpdate
(
)
: void
{
/** @var Connection $con */
$con
=
$this
->
getContainer
(
)
->
get
(
Connection::
class
)
;
if
(
$this
->
thumbnailSizesIds
(
$con
)
!==
[
]
)
{
$this
->
revertMigration
(
$con
)
;
}
static
::
assertCount
(
0,
$this
->
thumbnailSizesIds
(
$con
)
)
;
$productManufacturerFolderConfigurationId
=
$this
->
getProductFolderConfigurationId
(
$con
)
;
static
::
assertNotNull
(
$productManufacturerFolderConfigurationId
)
;
$beforeConfiguredThumbnailSizeIds
=
$this
->
getConfiguredThumbnailSizeIds
(
$con
,
$productManufacturerFolderConfigurationId
)
;