Passed
Push — master ( 1867a1...d9aba3 )
by Aimeos
04:17
created

ResolveControllerTest::testProduct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
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
}