ResolveControllerTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 37
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testCategory() 0 8 1
A getEnvironmentSetUp() 0 5 1
A testProduct() 0 8 1
A testNotFound() 0 5 1
1
<?php
2
3
class ResolveControllerTest extends AimeosTestAbstract
4
{
5
	public function testCategory()
6
	{
7
		View::addLocation( dirname( __DIR__ ) . '/fixtures/views' );
8
9
		$response = $this->action( 'GET', '\Aimeos\Shop\Controller\ResolveController@indexAction', ['site' => 'unittest', 'path' => 'tee'] );
10
11
		$this->assertResponseOk();
12
		$this->assertStringContainsString( '<div class="section aimeos catalog-filter', $response->getContent() );
13
	}
14
15
16
	public function testProduct()
17
	{
18
		View::addLocation( dirname( __DIR__ ) . '/fixtures/views' );
19
20
		$response = $this->action( 'GET', '\Aimeos\Shop\Controller\ResolveController@indexAction', ['site' => 'unittest', 'path' => 'Cafe_Noire_Cappuccino'] );
21
22
		$this->assertResponseOk();
23
		$this->assertStringContainsString( '<div class="aimeos catalog-detail', $response->getContent() );
24
	}
25
26
27
	public function testNotFound()
28
	{
29
		$response = $this->action( 'GET', '\Aimeos\Shop\Controller\ResolveController@indexAction', ['site' => 'unittest', 'path' => 'invalid'] );
30
31
		$response->assertStatus( 404 );
32
	}
33
34
35
	protected function getEnvironmentSetUp( $app )
36
	{
37
		parent::getEnvironmentSetUp( $app );
38
39
		$app['config']->set( 'shop.client.html.catalog.detail.url.target', 'aimeos_resolve' );
40
	}
41
}