diff options
Diffstat (limited to 'src/Wallabag')
-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 [ |