Completed
Push — master ( 9317e0...4e97b4 )
by Aimeos
06:46
created
lib/custom/tests/TestHelper.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 
19 19
 		$includepaths = $aimeos->getIncludePaths();
20 20
 		$includepaths[] = get_include_path();
21
-		set_include_path( implode( PATH_SEPARATOR, $includepaths ) );
21
+		set_include_path(implode(PATH_SEPARATOR, $includepaths));
22 22
 	}
23 23
 
24 24
 
25
-	public static function getContext( $site = 'unittest' )
25
+	public static function getContext($site = 'unittest')
26 26
 	{
27
-		if( !isset( self::$context[$site] ) ) {
28
-			self::$context[$site] = self::createContext( $site );
27
+		if (!isset(self::$context[$site])) {
28
+			self::$context[$site] = self::createContext($site);
29 29
 		}
30 30
 
31 31
 		return clone self::$context[$site];
@@ -34,58 +34,58 @@  discard block
 block discarded – undo
34 34
 
35 35
 	private static function getAimeos()
36 36
 	{
37
-		if( !isset( self::$aimeos ) )
37
+		if (!isset(self::$aimeos))
38 38
 		{
39 39
 			require_once 'Bootstrap.php';
40
-			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
40
+			spl_autoload_register('Aimeos\\Bootstrap::autoload');
41 41
 
42
-			$extdir = dirname( dirname( dirname( __DIR__ ) ) );
43
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false );
42
+			$extdir = dirname(dirname(dirname(__DIR__)));
43
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false);
44 44
 		}
45 45
 
46 46
 		return self::$aimeos;
47 47
 	}
48 48
 
49 49
 
50
-	private static function createContext( $site )
50
+	private static function createContext($site)
51 51
 	{
52 52
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
53 53
 		$aimeos = self::getAimeos();
54 54
 
55 55
 
56
-		$paths = $aimeos->getConfigPaths( 'mysql' );
57
-		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
56
+		$paths = $aimeos->getConfigPaths('mysql');
57
+		$paths[] = __DIR__.DIRECTORY_SEPARATOR.'config';
58 58
 
59
-		$conf = new \Aimeos\MW\Config\PHPArray( [], $paths );
60
-		$ctx->setConfig( $conf );
59
+		$conf = new \Aimeos\MW\Config\PHPArray([], $paths);
60
+		$ctx->setConfig($conf);
61 61
 
62 62
 
63
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
64
-		$ctx->setDatabaseManager( $dbm );
63
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
64
+		$ctx->setDatabaseManager($dbm);
65 65
 
66 66
 
67
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
68
-		$ctx->setLogger( $logger );
67
+		$logger = new \Aimeos\MW\Logger\File($site.'.log', \Aimeos\MW\Logger\Base::DEBUG);
68
+		$ctx->setLogger($logger);
69 69
 
70 70
 
71 71
 		$cache = new \Aimeos\MW\Cache\None();
72
-		$ctx->setCache( $cache );
72
+		$ctx->setCache($cache);
73 73
 
74 74
 
75
-		$i18n = new \Aimeos\MW\Translation\None( 'de' );
76
-		$ctx->setI18n( array( 'de' => $i18n ) );
75
+		$i18n = new \Aimeos\MW\Translation\None('de');
76
+		$ctx->setI18n(array('de' => $i18n));
77 77
 
78 78
 
79 79
 		$session = new \Aimeos\MW\Session\None();
80
-		$ctx->setSession( $session );
80
+		$ctx->setSession($session);
81 81
 
82 82
 
83
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
84
-		$localeItem = $localeManager->bootstrap( $site, '', '', false );
83
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx);
84
+		$localeItem = $localeManager->bootstrap($site, '', '', false);
85 85
 
86
-		$ctx->setLocale( $localeItem );
86
+		$ctx->setLocale($localeItem);
87 87
 
88
-		$ctx->setEditor( 'ai-slim:unittest' );
88
+		$ctx->setEditor('ai-slim:unittest');
89 89
 
90 90
 		return $ctx;
91 91
 	}
Please login to merge, or discard this patch.
lib/custom/tests/MW/View/Helper/Url/SlimTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -17,40 +17,40 @@
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		if( !class_exists( 'Slim\Router', false ) ) {
21
-			$this->markTestSkipped( '\Slim\Router is not available' );
20
+		if (!class_exists('Slim\Router', false)) {
21
+			$this->markTestSkipped('\Slim\Router is not available');
22 22
 		}
23 23
 
24 24
 		$view = new \Aimeos\MW\View\Standard();
25 25
 		$this->router = new \Aimeos\Slim\Router();
26
-		$this->object = new \Aimeos\MW\View\Helper\Url\Slim( $view, $this->router, array( 'site' => 'default' ) );
26
+		$this->object = new \Aimeos\MW\View\Helper\Url\Slim($view, $this->router, array('site' => 'default'));
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		unset( $this->object, $this->router );
32
+		unset($this->object, $this->router);
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testTransform()
37 37
 	{
38
-		$this->router->map( array( 'GET' ), 'shop/{site}', null )->setName( 'route' );
39
-		$result = $this->object->transform( 'route', 'catalog', 'lists', array( 'key' => 'value' ) );
38
+		$this->router->map(array('GET'), 'shop/{site}', null)->setName('route');
39
+		$result = $this->object->transform('route', 'catalog', 'lists', array('key' => 'value'));
40 40
 
41
-		$this->assertEquals( 'shop/default?key=value', $result );
41
+		$this->assertEquals('shop/default?key=value', $result);
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testTransformAbsolute()
46 46
 	{
47
-		$config = array( 'absoluteUri' => true );
47
+		$config = array('absoluteUri' => true);
48 48
 
49
-		$this->router->setBasePath( 'https://localhost/' );
50
-		$this->router->map( array( 'GET' ), 'shop/{site}', null )->setName( 'route' );
49
+		$this->router->setBasePath('https://localhost/');
50
+		$this->router->map(array('GET'), 'shop/{site}', null)->setName('route');
51 51
 
52
-		$result = $this->object->transform( 'route', 'catalog', 'lists', array( 'key' => 'value' ), [], $config );
52
+		$result = $this->object->transform('route', 'catalog', 'lists', array('key' => 'value'), [], $config);
53 53
 
54
-		$this->assertEquals( 'https://localhost/shop/default?key=value', $result );
54
+		$this->assertEquals('https://localhost/shop/default?key=value', $result);
55 55
 	}
56 56
 }
Please login to merge, or discard this patch.
lib/custom/src/MW/View/Helper/Url/Slim.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 	 * @param \Slim\Router $router Slim router object
33 33
 	 * @param array Associative list of fixed parameters that should be available for all routes
34 34
 	 */
35
-	public function __construct( \Aimeos\MW\View\Iface $view, \Slim\Router $router, array $fixed )
35
+	public function __construct(\Aimeos\MW\View\Iface $view, \Slim\Router $router, array $fixed)
36 36
 	{
37
-		parent::__construct( $view );
37
+		parent::__construct($view);
38 38
 
39 39
 		$this->router = $router;
40 40
 		$this->fixed = $fixed;
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
 	 * @param array $config Additional configuration parameter per URL
53 53
 	 * @return string Complete URL that can be used in the template
54 54
 	 */
55
-	public function transform( $target = null, $controller = null, $action = null, array $params = [], array $trailing = [], array $config = [] )
55
+	public function transform($target = null, $controller = null, $action = null, array $params = [], array $trailing = [], array $config = [])
56 56
 	{
57
-		$params = $this->sanitize( $params );
57
+		$params = $this->sanitize($params);
58 58
 
59
-		if( isset( $config['absoluteUri'] ) && (bool) $config['absoluteUri'] === true ) {
60
-			return $this->router->pathFor( $target, $this->fixed + $params );
59
+		if (isset($config['absoluteUri']) && (bool) $config['absoluteUri'] === true) {
60
+			return $this->router->pathFor($target, $this->fixed + $params);
61 61
 		}
62 62
 
63
-		return $this->router->relativePathFor( $target, $params + $this->fixed );
63
+		return $this->router->relativePathFor($target, $params + $this->fixed);
64 64
 	}
65 65
 }
66 66
\ No newline at end of file
Please login to merge, or discard this patch.