mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12171] Add functionality to upload attachments to submit_post() method
PHPBB3-12171
This commit is contained in:
parent
ee1c055b70
commit
b5105363db
1 changed files with 17 additions and 0 deletions
|
@ -928,6 +928,23 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
$crawler = self::request('GET', $posting_url);
|
$crawler = self::request('GET', $posting_url);
|
||||||
$this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());
|
$this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());
|
||||||
|
|
||||||
|
if (!empty($form_data['upload_files']))
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < $form_data['upload_files']; $i++)
|
||||||
|
{
|
||||||
|
$file = array(
|
||||||
|
'tmp_name' => __DIR__ . '/../functional/fixtures/files/valid.jpg',
|
||||||
|
'name' => 'valid.jpg',
|
||||||
|
'type' => 'image/jpeg',
|
||||||
|
'size' => filesize(__DIR__ . '/../functional/fixtures/files/valid.jpg'),
|
||||||
|
'error' => UPLOAD_ERR_OK,
|
||||||
|
);
|
||||||
|
|
||||||
|
$crawler = self::$client->request('POST', $posting_url, array('add_file' => $this->lang('ADD_FILE')), array('fileupload' => $file));
|
||||||
|
}
|
||||||
|
unset($form_data['upload_files']);
|
||||||
|
}
|
||||||
|
|
||||||
$hidden_fields = array(
|
$hidden_fields = array(
|
||||||
$crawler->filter('[type="hidden"]')->each(function ($node, $i) {
|
$crawler->filter('[type="hidden"]')->each(function ($node, $i) {
|
||||||
return array('name' => $node->attr('name'), 'value' => $node->attr('value'));
|
return array('name' => $node->attr('name'), 'value' => $node->attr('value'));
|
||||||
|
|
Loading…
Add table
Reference in a new issue