Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
assertTriggerNotExists example
public
function
testColumnDoesNotExist
(
)
: void
{
$migration
=
new
Migration1671003201RemoveDeprecatedColumns
(
)
;
$migration
->
updateDestructive
(
$this
->connection
)
;
// can execute two times
$migration
->
updateDestructive
(
$this
->connection
)
;
$this
->
assertColumnNotExists
(
'user_access_key', 'write_access'
)
;
$this
->
assertColumnNotExists
(
'country', 'tax_free'
)
;
$this
->
assertTriggerNotExists
(
'country_tax_free_insert'
)
;
$this
->
assertTriggerNotExists
(
'country_tax_free_update'
)
;
$this
->
assertColumnNotExists
(
'country', 'company_tax_free'
)
;
$this
->
assertColumnNotExists
(
'app_action_button', 'open_new_tab'
)
;
}
private
function
assertColumnNotExists
(
string
$table
, string
$column
)
: void
{
$exists
=
$this
->
getColumnInfo
(
$table
,
$column
)
;