1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
class LocaleTest extends \PHPUnit\Framework\TestCase |
4
|
|
|
{ |
5
|
|
|
public function testGet() |
6
|
|
|
{ |
7
|
|
|
$settings = require dirname( dirname( __DIR__ ) ) . '/src/aimeos-default.php'; |
8
|
|
|
$settings['disableSites'] = false; |
9
|
|
|
|
10
|
|
|
$container = new \Slim\Container(); |
11
|
|
|
$container['aimeos'] = new \Aimeos\Bootstrap(); |
12
|
|
|
$container['aimeos.context'] = new \Aimeos\Slim\Base\Context( $container ); |
13
|
|
|
$container['aimeos.config'] = new \Aimeos\Slim\Base\Config( $container, $settings ); |
14
|
|
|
$container['mailer'] = new \Swift_Mailer( new \Swift_SendmailTransport() ); |
15
|
|
|
|
16
|
|
|
$context = $container['aimeos.context']->get( false, array(), 'backend' ); |
17
|
|
|
$object = new \Aimeos\Slim\Base\Locale( $container ); |
18
|
|
|
|
19
|
|
|
$this->assertInstanceOf( '\Aimeos\MShop\Locale\Item\Iface', $object->get( $context, array( 'site' => 'unittest' ) ) ); |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
|
23
|
|
|
public function testGetBackend() |
24
|
|
|
{ |
25
|
|
|
$settings = require dirname( dirname( __DIR__ ) ) . '/src/aimeos-default.php'; |
26
|
|
|
$settings['disableSites'] = false; |
27
|
|
|
|
28
|
|
|
$container = new \Slim\Container(); |
29
|
|
|
$container['aimeos'] = new \Aimeos\Bootstrap(); |
30
|
|
|
$container['aimeos.context'] = new \Aimeos\Slim\Base\Context( $container ); |
31
|
|
|
$container['aimeos.config'] = new \Aimeos\Slim\Base\Config( $container, $settings ); |
32
|
|
|
$container['mailer'] = new \Swift_Mailer( new \Swift_SendmailTransport() ); |
33
|
|
|
|
34
|
|
|
$context = $container['aimeos.context']->get( false, array(), 'backend' ); |
35
|
|
|
$object = new \Aimeos\Slim\Base\Locale( $container ); |
36
|
|
|
|
37
|
|
|
$this->assertInstanceOf( '\Aimeos\MShop\Locale\Item\Iface', $object->getBackend( $context, 'unittest' ) ); |
38
|
|
|
} |
39
|
|
|
} |
40
|
|
|
|