From 63c62f86ee225c9e4088411e84947272e359049e Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Thu, 29 May 2014 11:48:48 +0200 Subject: [ticket/8610] Add functional test when two topics are merged PHPBB3-8610 --- tests/functional/visibility_softdelete_test.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/functional/visibility_softdelete_test.php') diff --git a/tests/functional/visibility_softdelete_test.php b/tests/functional/visibility_softdelete_test.php index 3d44476ff0..9ed8406160 100644 --- a/tests/functional/visibility_softdelete_test.php +++ b/tests/functional/visibility_softdelete_test.php @@ -591,8 +591,14 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'], ), 'before merging #1'); + $this->add_lang('viewtopic'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #2']}&sid={$this->sid}"); + $bookmark_tag = $crawler->filterXPath('//div/ul/li/a[contains(., "Bookmark topic")]'); + $bookmark_link = $bookmark_tag->attr('href'); + $crawler_bookmark = self::request('GET', $bookmark_link); + $this->assertContainsLang('BOOKMARK_ADDED', $crawler_bookmark->text()); + $this->add_lang('mcp'); $form = $crawler->selectButton('Go')->eq(1)->form(); $form['action']->select('merge_topic'); @@ -609,6 +615,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text()); $this->assertContainsLang('POST_DELETED_ACTION', $crawler->filter('body')->text()); + $this->assertContainsLang('BOOKMARK_TOPIC_REMOVE', $crawler->filter('body')->text()); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, -- cgit v1.2.1 From 7c4bd8cc76e9a0511b54752e88f18c3ee4be2ec6 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sat, 31 May 2014 00:29:42 +0200 Subject: [ticket/8610] Use css selector instead of xPath PHPBB3-8610 --- tests/functional/visibility_softdelete_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/functional/visibility_softdelete_test.php') diff --git a/tests/functional/visibility_softdelete_test.php b/tests/functional/visibility_softdelete_test.php index 9ed8406160..d92ff7425d 100644 --- a/tests/functional/visibility_softdelete_test.php +++ b/tests/functional/visibility_softdelete_test.php @@ -594,7 +594,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->add_lang('viewtopic'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #2']}&sid={$this->sid}"); - $bookmark_tag = $crawler->filterXPath('//div/ul/li/a[contains(., "Bookmark topic")]'); + $bookmark_tag = $crawler->filter('a.bookmark-link'); + $this->assertContainsLang('BOOKMARK_TOPIC', $bookmark_tag->text()); $bookmark_link = $bookmark_tag->attr('href'); $crawler_bookmark = self::request('GET', $bookmark_link); $this->assertContainsLang('BOOKMARK_ADDED', $crawler_bookmark->text()); -- cgit v1.2.1