1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
class CatalogControllerTest extends AimeosTestAbstract |
4
|
|
|
{ |
5
|
|
|
public function testCountAction() |
6
|
|
|
{ |
7
|
|
|
View::addLocation(dirname(__DIR__).'/fixtures/views'); |
8
|
|
|
|
9
|
|
|
$response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@countAction', ['site' => 'unittest']); |
10
|
|
|
|
11
|
|
|
$this->assertResponseOk(); |
12
|
|
|
$this->assertContains('.catalog-filter-count', $response->getContent()); |
13
|
|
|
$this->assertContains('.catalog-filter-attribute', $response->getContent()); |
14
|
|
|
} |
15
|
|
|
|
16
|
|
|
|
17
|
|
|
public function testDetailAction() |
18
|
|
|
{ |
19
|
|
|
View::addLocation(dirname(__DIR__).'/fixtures/views'); |
20
|
|
|
|
21
|
|
|
$response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@detailAction', ['site' => 'unittest', 'pin_action' => 'add', 'pin_id' => 0]); |
22
|
|
|
|
23
|
|
|
$this->assertResponseOk(); |
24
|
|
|
$this->assertContains('<section class="aimeos catalog-stage"', $response->getContent()); |
25
|
|
|
$this->assertContains('<section class="aimeos catalog-detail"', $response->getContent()); |
26
|
|
|
$this->assertContains('<section class="aimeos catalog-session"', $response->getContent()); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
|
30
|
|
|
public function testListAction() |
31
|
|
|
{ |
32
|
|
|
View::addLocation(dirname(__DIR__).'/fixtures/views'); |
33
|
|
|
|
34
|
|
|
$response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@listAction', ['site' => 'unittest']); |
35
|
|
|
|
36
|
|
|
$this->assertResponseOk(); |
37
|
|
|
$this->assertContains('<section class="aimeos catalog-filter"', $response->getContent()); |
38
|
|
|
$this->assertContains('<section class="aimeos catalog-list"', $response->getContent()); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
|
42
|
|
|
public function testStockAction() |
43
|
|
|
{ |
44
|
|
|
View::addLocation(dirname(__DIR__).'/fixtures/views'); |
45
|
|
|
|
46
|
|
|
$response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@stockAction', ['site' => 'unittest']); |
47
|
|
|
|
48
|
|
|
$this->assertResponseOk(); |
49
|
|
|
$this->assertContains('.aimeos .product .stock', $response->getContent()); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
|
53
|
|
|
public function testSuggestAction() |
54
|
|
|
{ |
55
|
|
|
View::addLocation(dirname(__DIR__).'/fixtures/views'); |
56
|
|
|
|
57
|
|
|
$response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@suggestAction', ['site' => 'unittest'], ['f_search' => 'Cafe']); |
58
|
|
|
|
59
|
|
|
$this->assertResponseOk(); |
60
|
|
|
$this->assertRegexp('/[{.*}]/', $response->getContent()); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
|
64
|
|
|
public function testTreeAction() |
65
|
|
|
{ |
66
|
|
|
View::addLocation(dirname(__DIR__).'/fixtures/views'); |
67
|
|
|
|
68
|
|
|
$response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@treeAction', ['site' => 'unittest', 'f_catid' => 1, 'f_name' => 'test']); |
69
|
|
|
|
70
|
|
|
$this->assertResponseOk(); |
71
|
|
|
$this->assertContains('<section class="aimeos catalog-filter', $response->getContent()); |
72
|
|
|
$this->assertContains('<section class="aimeos catalog-stage', $response->getContent()); |
73
|
|
|
$this->assertContains('<section class="aimeos catalog-list', $response->getContent()); |
74
|
|
|
} |
75
|
|
|
} |