Passed
Branch master (c225ea)
by Aimeos
05:57
created

BootstrapTest::testSetup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 12
nc 1
nop 0
dl 0
loc 16
rs 9.8666
c 3
b 0
f 0
1
<?php
2
3
class BootstrapTest extends \PHPUnit\Framework\TestCase
4
{
5
	public function testSetup()
6
	{
7
		$app = new \Slim\App();
8
		$c = $app->getContainer();
9
10
		$boot = new \Aimeos\Slim\Bootstrap( $app, array( 'apc_enabled' => true ) );
11
		$boot->setup( '.' );
12
13
		$this->assertInstanceOf( '\Aimeos\Bootstrap', $c['aimeos'] );
14
		$this->assertInstanceOf( '\Aimeos\Slim\Base\Config', $c['aimeos.config'] );
15
		$this->assertInstanceOf( '\Aimeos\Slim\Base\Context', $c['aimeos.context'] );
16
		$this->assertInstanceOf( '\Aimeos\Slim\Base\Locale', $c['aimeos.locale'] );
17
		$this->assertInstanceOf( '\Aimeos\Slim\Base\I18n', $c['aimeos.i18n'] );
18
		$this->assertInstanceOf( '\Aimeos\Slim\Base\View', $c['aimeos.view'] );
19
		$this->assertInstanceOf( '\Aimeos\Slim\Base\Shop', $c['shop'] );
20
		$this->assertInstanceOf( '\Swift_Mailer', $c['mailer'] );
21
	}
22
23
24
	public function testRoutes()
25
	{
26
		$app = new \Slim\App();
27
28
		$boot = new \Aimeos\Slim\Bootstrap( $app, array() );
29
		$result = $boot->routes( dirname( __DIR__ ) . '/src/aimeos-routes.php' );
30
31
		$this->assertInstanceOf( '\Aimeos\Slim\Bootstrap', $result );
32
	}
33
34
35
	public function testGetVersion()
36
	{
37
		$result = \Aimeos\Slim\Bootstrap::getVersion();
38
39
		$this->assertInternalType( 'string', $result );
40
	}
41
}
42