Browse Source

TLD-543 @fixed tests + patch

raphael 3 years ago
parent
commit
e1d02dfadb

+ 29
- 0
src/Phoenix/DoctrineMigrations/Version20191209165250.php View File

@@ -0,0 +1,29 @@
1
+<?php
2
+
3
+namespace Logipro\Phoenix\DoctrineMigrations;
4
+
5
+use Doctrine\DBAL\Schema\Schema;
6
+use Symfony\Component\Finder\Finder;
7
+use Doctrine\Migrations\AbstractMigration;
8
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
9
+use Liip\ImagineBundle\Imagine\Cache\CacheManager;
10
+use Symfony\Component\DependencyInjection\ContainerInterface;
11
+
12
+final class Version20191209165250 extends AbstractMigration
13
+implements ContainerAwareInterface
14
+{
15
+    private $cacheManager;
16
+
17
+    public function setContainer(ContainerInterface $container = null)
18
+    {
19
+        $this->cacheManager = $container->get('liip_imagine.cache.manager');
20
+    }
21
+
22
+    public function up(Schema $schema): void
23
+    {
24
+        $this->cacheManager->remove();
25
+    }
26
+
27
+    public function down(Schema $schema): void
28
+    { }
29
+}

+ 44
- 0
tests/Phoenix/Controller/LearningSpace/LoginControllerTest.php View File

@@ -55,6 +55,50 @@ class LoginControllerTest extends PhxWebTestCase
55 55
         $this->assertEquals(404, $client->getResponse()->getStatusCode());
56 56
     }
57 57
 
58
+    public function testManagerLoginStatusCode()
59
+    {
60
+        $client = static::createClient();
61
+
62
+        $parameters = array();
63
+        $client->request('GET', $this->getRoutePath('ls_login'), $parameters);
64
+        $this->assertEquals(200, $client->getResponse()->getStatusCode());
65
+    }
66
+
67
+    public function testManagerLoginImageThumb()
68
+    {
69
+        $client = static::createClient();
70
+
71
+        $parameters = array();
72
+        $crawler = $client->request('GET', $this->getRoutePath('ls_login'), $parameters);
73
+
74
+        $link = $crawler->filter('img.logo')->first()->attr('src');
75
+
76
+        // test si l'url utilise une miniature
77
+        $this->assertContains('my_thumb', $link);
78
+    }
79
+
80
+    public function testManagerRecoverStatusCode()
81
+    {
82
+        $client = static::createClient();
83
+
84
+        $parameters = array();
85
+        $client->request('GET', $this->getRoutePath('ls_password_recover'), $parameters);
86
+        $this->assertEquals(200, $client->getResponse()->getStatusCode());
87
+    }
88
+
89
+    public function testManagerRecoverImageThumb()
90
+    {
91
+        $client = static::createClient();
92
+
93
+        $parameters = array();
94
+        $crawler = $client->request('GET', $this->getRoutePath('ls_password_recover'), $parameters);
95
+
96
+        $link = $crawler->filter('img.logo')->first()->attr('src');
97
+
98
+        // test si l'url utilise une miniature
99
+        $this->assertContains('my_thumb', $link);
100
+    }
101
+
58 102
 
59 103
     /**
60 104
      * sera développé quand on aura les fixtures de dev dans cette branche

Loading…
Cancel
Save