Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
saveUserPicture example
}
/** * Tests creation, display, and deletion of user pictures. */
public
function
testCreateDeletePicture
(
)
{
$this
->
drupalLogin
(
$this
->webUser
)
;
// Save a new picture.
$image
=
current
(
$this
->
drupalGetTestFiles
(
'image'
)
)
;
$file
=
$this
->
saveUserPicture
(
$image
)
;
// Verify that the image is displayed on the user account page.
$this
->
drupalGet
(
'user'
)
;
$this
->
assertSession
(
)
->
responseContains
(
StreamWrapperManager::
getTarget
(
$file
->
getFileUri
(
)
)
)
;
// Delete the picture.
$edit
=
[
]
;
$this
->
drupalGet
(
'user/' .
$this
->webUser->
id
(
)
. '/edit'
)
;
$this
->
submitForm
(
$edit
, 'Remove'
)
;
$this
->
submitForm
(
[
]
, 'Save'
)
;