1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Aimeos\ShopBundle\Tests\Controller; |
4
|
|
|
|
5
|
|
|
use Symfony\Component\HttpFoundation\Response; |
6
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; |
7
|
|
|
|
8
|
|
|
|
9
|
|
|
class AccountControllerTest extends WebTestCase |
10
|
|
|
{ |
11
|
|
|
protected function setUp() |
12
|
|
|
{ |
13
|
|
|
\Aimeos\MShop::cache( false ); |
14
|
|
|
\Aimeos\Controller\Frontend::cache( false ); |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
|
18
|
|
|
public function testAccount() |
19
|
|
|
{ |
20
|
|
|
$client = static::createClient(); |
21
|
|
|
$client->request( 'GET', '/unittest/de/EUR/myaccount/' ); |
22
|
|
|
|
23
|
|
|
$this->assertContains( 'aimeos account-profile', $client->getResponse()->getContent() ); |
24
|
|
|
$this->assertContains( 'aimeos account-history', $client->getResponse()->getContent() ); |
25
|
|
|
$this->assertContains( 'aimeos account-favorite', $client->getResponse()->getContent() ); |
26
|
|
|
$this->assertContains( 'aimeos account-watch', $client->getResponse()->getContent() ); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
|
30
|
|
|
public function testDownload() |
31
|
|
|
{ |
32
|
|
|
$client = static::createClient(); |
33
|
|
|
$client->request( 'GET', '/unittest/de/EUR/myaccount/download/0' ); |
34
|
|
|
|
35
|
|
|
$this->assertEquals( 401, $client->getResponse()->getStatusCode() ); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
|
39
|
|
|
public function testFavoriteComponent() |
40
|
|
|
{ |
41
|
|
|
$client = static::createClient(); |
42
|
|
|
$client->request( 'GET', '/unittest/de/EUR/test/accountfavoritecomponent' ); |
43
|
|
|
|
44
|
|
|
$this->assertEquals( 200, $client->getResponse()->getStatusCode() ); |
45
|
|
|
$this->assertContains( 'aimeos account-favorite', $client->getResponse()->getContent() ); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
|
49
|
|
|
public function testHistoryComponent() |
50
|
|
|
{ |
51
|
|
|
$client = static::createClient(); |
52
|
|
|
$client->request( 'GET', '/unittest/de/EUR/test/accounthistorycomponent' ); |
53
|
|
|
|
54
|
|
|
$this->assertEquals( 200, $client->getResponse()->getStatusCode() ); |
55
|
|
|
$this->assertContains( 'aimeos account-history', $client->getResponse()->getContent() ); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
|
59
|
|
|
public function testProfileComponent() |
60
|
|
|
{ |
61
|
|
|
$client = static::createClient(); |
62
|
|
|
$client->request( 'GET', '/unittest/de/EUR/test/accountprofilecomponent' ); |
63
|
|
|
|
64
|
|
|
$this->assertEquals( 200, $client->getResponse()->getStatusCode() ); |
65
|
|
|
$this->assertContains( 'aimeos account-profile', $client->getResponse()->getContent() ); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
|
69
|
|
|
public function testWatchComponent() |
70
|
|
|
{ |
71
|
|
|
$client = static::createClient(); |
72
|
|
|
$client->request( 'GET', '/unittest/de/EUR/test/accountwatchcomponent' ); |
73
|
|
|
|
74
|
|
|
$this->assertEquals( 200, $client->getResponse()->getStatusCode() ); |
75
|
|
|
$this->assertContains( 'aimeos account-watch', $client->getResponse()->getContent() ); |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|