public function testAddPhoto($I) { $model = new UserProfile(); $file = $model->createFile('photo', Yii::getAlias('@tests/_data/files/300x300.png'), '300x300.png'); $I->click('user-2'); $I->click('Profile'); $I->submitForm($this->formId, [$this->formName . '[photo]' => $file->id]); $I->expectTo('see success'); $I->see('Saved successfully'); $I->seeInField($this->formName . '[photo]', $model->fileUrl('photo', $file)); }