Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
SqlitePlatform example
$ulid
= Ulid::
fromString
(
self::DUMMY_ULID
)
;
$expected
=
$ulid
->
toRfc4122
(
)
;
$this
->
assertEquals
(
$expected
,
$actual
)
;
}
public
function
testNotSupportedTypeConversionForDatabaseValue
(
)
{
$this
->
expectException
(
ConversionException::
class
)
;
$this
->type->
convertToDatabaseValue
(
new
\
stdClass
(
)
,
new
SqlitePlatform
(
)
)
;
}
public
function
testNullConversionForDatabaseValue
(
)
{
$this
->
assertNull
(
$this
->type->
convertToDatabaseValue
(
null,
new
SqlitePlatform
(
)
)
)
;
}
public
function
testUlidInterfaceConvertsToPHPValue
(
)
{
$ulid
=
$this
->
createMock
(
AbstractUid::
class
)
;
$actual
=
$this
->type->
convertToPHPValue
(
$ulid
,
new
SqlitePlatform
(
)
)
;
public
function
testUuidStringConvertsToDatabaseValue
(
)
{
$actual
=
$this
->type->
convertToDatabaseValue
(
self::DUMMY_UUID,
new
PostgreSQLPlatform
(
)
)
;
$this
->
assertEquals
(
self::DUMMY_UUID,
$actual
)
;
}
public
function
testNotSupportedTypeConversionForDatabaseValue
(
)
{
$this
->
expectException
(
ConversionException::
class
)
;
$this
->type->
convertToDatabaseValue
(
new
\
stdClass
(
)
,
new
SqlitePlatform
(
)
)
;
}
public
function
testNullConversionForDatabaseValue
(
)
{
$this
->
assertNull
(
$this
->type->
convertToDatabaseValue
(
null,
new
SqlitePlatform
(
)
)
)
;
}
public
function
testUuidInterfaceConvertsToPHPValue
(
)
{
$uuid
=
$this
->
createMock
(
AbstractUid::
class
)
;
$actual
=
$this
->type->
convertToPHPValue
(
$uuid
,
new
SqlitePlatform
(
)
)
;