Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addPrimaryFkField example
protected
function
tearDown
(
)
: void
{
parent::
tearDown
(
)
;
$connection
=
$this
->
getContainer
(
)
->
get
(
Connection::
class
)
;
$connection
->
rollBack
(
)
;
$connection
->
executeStatement
(
'DROP TABLE IF EXISTS `fk_field_primary`'
)
;
$connection
->
beginTransaction
(
)
;
}
public
function
testSearchByPrimaryFkKey
(
)
: void
{
$this
->
addPrimaryFkField
(
)
;
$definition
=
new
FkFieldPrimaryTestDefinition
(
)
;
$this
->productRepository =
$this
->
getContainer
(
)
->
get
(
'product.repository'
)
;
$this
->productId = Uuid::
randomHex
(
)
;
$this
->productRepository->
create
(
[
[
'id' =>
$this
->productId,
'productNumber' => Uuid::
randomHex
(
)
,
'stock' => 1,