diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-06-23 09:18:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-23 09:18:18 +0200 |
commit | d37bb05c881bfdbeb1144b327edd4dcc2cbb163f (patch) | |
tree | 1b90f7e733a83af4741a8cb7f49edf3e303f8677 /src/Wallabag/CoreBundle/Tests/Controller/DeveloperControllerTest.php | |
parent | 891a026e31ad54ca90b70f6026f23260cfadb7fd (diff) | |
parent | 99451fe4b76051d61922a6beb7ee9e79cc6e7893 (diff) | |
download | wallabag-d37bb05c881bfdbeb1144b327edd4dcc2cbb163f.tar.gz wallabag-d37bb05c881bfdbeb1144b327edd4dcc2cbb163f.tar.zst wallabag-d37bb05c881bfdbeb1144b327edd4dcc2cbb163f.zip |
Merge pull request #2132 from wallabag/sf3.1
Jump to Symfony 3.1
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/DeveloperControllerTest.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/DeveloperControllerTest.php | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/DeveloperControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/DeveloperControllerTest.php deleted file mode 100644 index fc220b85..00000000 --- a/src/Wallabag/CoreBundle/Tests/Controller/DeveloperControllerTest.php +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Tests\Controller; | ||
4 | |||
5 | use Wallabag\CoreBundle\Tests\WallabagCoreTestCase; | ||
6 | |||
7 | class DeveloperControllerTest extends WallabagCoreTestCase | ||
8 | { | ||
9 | public function testCreateClient() | ||
10 | { | ||
11 | $this->logInAs('admin'); | ||
12 | $client = $this->getClient(); | ||
13 | $em = $client->getContainer()->get('doctrine.orm.entity_manager'); | ||
14 | $nbClients = $em->getRepository('WallabagApiBundle:Client')->findAll(); | ||
15 | |||
16 | $crawler = $client->request('GET', '/developer/client/create'); | ||
17 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
18 | |||
19 | $form = $crawler->filter('button[type=submit]')->form(); | ||
20 | |||
21 | $client->submit($form); | ||
22 | |||
23 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
24 | |||
25 | $newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll(); | ||
26 | $this->assertGreaterThan(count($nbClients), count($newNbClients)); | ||
27 | } | ||
28 | |||
29 | public function testListingClient() | ||
30 | { | ||
31 | $this->logInAs('admin'); | ||
32 | $client = $this->getClient(); | ||
33 | $em = $client->getContainer()->get('doctrine.orm.entity_manager'); | ||
34 | $nbClients = $em->getRepository('WallabagApiBundle:Client')->findAll(); | ||
35 | |||
36 | $crawler = $client->request('GET', '/developer'); | ||
37 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
38 | $this->assertEquals(count($nbClients), $crawler->filter('ul[class=collapsible] li')->count()); | ||
39 | } | ||
40 | |||
41 | public function testDeveloperHowto() | ||
42 | { | ||
43 | $this->logInAs('admin'); | ||
44 | $client = $this->getClient(); | ||
45 | |||
46 | $crawler = $client->request('GET', '/developer/howto/first-app'); | ||
47 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
48 | } | ||
49 | |||
50 | public function testRemoveClient() | ||
51 | { | ||
52 | $this->logInAs('admin'); | ||
53 | $client = $this->getClient(); | ||
54 | $em = $client->getContainer()->get('doctrine.orm.entity_manager'); | ||
55 | $nbClients = $em->getRepository('WallabagApiBundle:Client')->findAll(); | ||
56 | |||
57 | $crawler = $client->request('GET', '/developer'); | ||
58 | |||
59 | $link = $crawler | ||
60 | ->filter('div[class=collapsible-body] p a') | ||
61 | ->eq(0) | ||
62 | ->link() | ||
63 | ; | ||
64 | |||
65 | $client->click($link); | ||
66 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | ||
67 | |||
68 | $newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll(); | ||
69 | $this->assertGreaterThan(count($newNbClients), count($nbClients)); | ||
70 | } | ||
71 | } | ||