mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/17508] Fix PHP warning on custom profile fields edit
PHPBB-17508
This commit is contained in:
@@ -69,4 +69,32 @@ class phpbb_functional_acp_profile_field_test extends phpbb_functional_test_case
|
||||
|
||||
$this->assertContainsLang('ADDED_PROFILE_FIELD', $crawler->text());
|
||||
}
|
||||
|
||||
public function test_edit_profile_fields()
|
||||
{
|
||||
// Custom profile fields page
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_profile&mode=profile&sid=' . $this->sid);
|
||||
|
||||
// Get all profile fields edit URLs
|
||||
$edits = $crawler->filter('td.actions a')
|
||||
->reduce(
|
||||
function ($node, $i) {
|
||||
$url = $node->attr('href');
|
||||
return ((bool) strpos($url, 'action=edit'));
|
||||
})
|
||||
->each(
|
||||
function ($node, $i) {
|
||||
$url = $node->attr('href');
|
||||
return ($url);
|
||||
});
|
||||
|
||||
foreach ($edits as $edit_url)
|
||||
{
|
||||
$crawler = self::request('GET', 'adm/' . $edit_url . '&sid=' . $this->sid);
|
||||
$form = $crawler->selectButton('Save')->form();
|
||||
$crawler= self::submit($form);
|
||||
|
||||
$this->assertContainsLang('CHANGED_PROFILE_FIELD', $crawler->text());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user