diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-05-02 21:14:23 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-05-02 21:14:23 +0200 |
commit | c4c062cce00d8358b9a9c836aadcd8997f2fb069 (patch) | |
tree | d9f56d7fbac51fc49c10d8450dc5ddf6e5b09158 /src | |
parent | d6a9e139dc53eee6a5afdbad7f66829e8c78b0d8 (diff) | |
download | wallabag-c4c062cce00d8358b9a9c836aadcd8997f2fb069.tar.gz wallabag-c4c062cce00d8358b9a9c836aadcd8997f2fb069.tar.zst wallabag-c4c062cce00d8358b9a9c836aadcd8997f2fb069.zip |
Add test to check reading time filter
Diffstat (limited to 'src')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php index 1aa1a7ed..db38d865 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | |||
@@ -60,6 +60,43 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
60 | $this->assertContains('flashes.config.notice.config_saved', $alert[0]); | 60 | $this->assertContains('flashes.config.notice.config_saved', $alert[0]); |
61 | } | 61 | } |
62 | 62 | ||
63 | public function testChangeReadingSpeed() | ||
64 | { | ||
65 | $this->logInAs('admin'); | ||
66 | $client = $this->getClient(); | ||
67 | |||
68 | $crawler = $client->request('GET', '/unread/list'); | ||
69 | $form = $crawler->filter('button[id=submit-filter]')->form(); | ||
70 | $dataFilters = [ | ||
71 | 'entry_filter[readingTime][right_number]' => 22, | ||
72 | 'entry_filter[readingTime][left_number]' => 22, | ||
73 | ]; | ||
74 | $crawler = $client->submit($form, $dataFilters); | ||
75 | $this->assertCount(1, $crawler->filter('div[class=entry]')); | ||
76 | |||
77 | // Change reading speed | ||
78 | $crawler = $client->request('GET', '/config'); | ||
79 | $form = $crawler->filter('button[id=config_save]')->form(); | ||
80 | $data = [ | ||
81 | 'config[reading_speed]' => '2', | ||
82 | ]; | ||
83 | $client->submit($form, $data); | ||
84 | |||
85 | // Is the entry still available via filters? | ||
86 | $crawler = $client->request('GET', '/unread/list'); | ||
87 | $form = $crawler->filter('button[id=submit-filter]')->form(); | ||
88 | $crawler = $client->submit($form, $dataFilters); | ||
89 | $this->assertCount(0, $crawler->filter('div[class=entry]')); | ||
90 | |||
91 | // Restore old configuration | ||
92 | $crawler = $client->request('GET', '/config'); | ||
93 | $form = $crawler->filter('button[id=config_save]')->form(); | ||
94 | $data = [ | ||
95 | 'config[reading_speed]' => '0.5', | ||
96 | ]; | ||
97 | $client->submit($form, $data); | ||
98 | } | ||
99 | |||
63 | public function dataForUpdateFailed() | 100 | public function dataForUpdateFailed() |
64 | { | 101 | { |
65 | return [ | 102 | return [ |