From 538f03efb058c84daf3e677a3137be8900678f2b Mon Sep 17 00:00:00 2001
From: Marc Alexander <admin@m-a-styles.de>
Date: Fri, 6 Jan 2017 23:46:34 +0100
Subject: [PATCH] [ticket/14962] Fix functional test for editing post

PHPBB3-14962
---
 tests/functional/posting_test.php | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php
index 4ed34eca31..83acefd2f3 100644
--- a/tests/functional/posting_test.php
+++ b/tests/functional/posting_test.php
@@ -92,13 +92,16 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
 	public function test_edit()
 	{
 		$this->login();
-		$this->create_topic(2, 'Test Topic 1', 'Test topic');
+		$this->create_topic(2, 'Test Topic post', 'Test topic post');
 
 		$url =  self::$client->getCrawler()->selectLink('Edit')->link()->getUri();
 		$post_id = $this->get_parameter_from_link($url, 'p');
-		$this->submit_post("posting.php?mode=edit&f=2&p={$post_id}", 'EDIT_POST', array('message' => 'Edited post'));
+		$crawler = self::request('GET', "posting.php?mode=edit&f=2&p={$post_id}&sid={$this->sid}");
+		$form = $crawler->selectButton('Submit')->form();
+		$form->setValues(array('message' => 'Edited post'));
+		$crawler = self::submit($form);
 
-		$this->assertContains('Edited post', self::$client->getCrawler()->filter("#post_content{$post_id} .content")->text());
+		$this->assertContains('Edited post', $crawler->filter("#post_content{$post_id} .content")->text());
 	}
 
 	/**