Completed
Push — master ( 472f62...3952e3 )
by Aimeos
09:50
created
lib/custom/src/MW/Session/Symfony2.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 *
28 28
 	 * @param Symfony\Component\HttpFoundation\Session\SessionInterface $object Symfony2 session object
29 29
 	 */
30
-	public function __construct( \Symfony\Component\HttpFoundation\Session\SessionInterface $object )
30
+	public function __construct(\Symfony\Component\HttpFoundation\Session\SessionInterface $object)
31 31
 	{
32 32
 		$this->object = $object;
33 33
 	}
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 * @param mixed $default Value returned if requested key isn't found
43 43
 	 * @return mixed Value associated to the requested key
44 44
 	 */
45
-	public function get( $name, $default = null )
45
+	public function get($name, $default = null)
46 46
 	{
47
-		return $this->object->get( $name, $default );
47
+		return $this->object->get($name, $default);
48 48
 	}
49 49
 
50 50
 
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 	 * @param mixed $value Value that should be associated with the given key
58 58
 	 * @return void
59 59
 	 */
60
-	public function set( $name, $value )
60
+	public function set($name, $value)
61 61
 	{
62
-		$this->object->set( $name, $value );
62
+		$this->object->set($name, $value);
63 63
 	}
64 64
 }
Please login to merge, or discard this patch.
lib/custom/tests/MW/Session/Symfony2Test.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	protected function setUp()
27 27
 	{
28
-		if( class_exists( 'Symfony\Component\HttpFoundation\Session\Session' ) === false ) {
29
-			$this->markTestSkipped( 'Class Symfony\Component\HttpFoundation\Session\Session not found' );
28
+		if (class_exists('Symfony\Component\HttpFoundation\Session\Session') === false) {
29
+			$this->markTestSkipped('Class Symfony\Component\HttpFoundation\Session\Session not found');
30 30
 		}
31 31
 
32 32
 		$storage = new \Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage();
33
-		$session = new \Symfony\Component\HttpFoundation\Session\Session( $storage );
34
-		$this->object = new \Aimeos\MW\Session\Symfony2( $session );
33
+		$session = new \Symfony\Component\HttpFoundation\Session\Session($storage);
34
+		$this->object = new \Aimeos\MW\Session\Symfony2($session);
35 35
 	}
36 36
 
37 37
 
@@ -43,26 +43,26 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	protected function tearDown()
45 45
 	{
46
-		unset( $this->object );
46
+		unset($this->object);
47 47
 	}
48 48
 
49 49
 
50 50
 	public function testGetDefault()
51 51
 	{
52
-		$this->assertEquals( null, $this->object->get( 'notexist' ) );
52
+		$this->assertEquals(null, $this->object->get('notexist'));
53 53
 	}
54 54
 
55 55
 
56 56
 	public function testGetSet()
57 57
 	{
58
-		$this->object->set( 'key', 'value' );
59
-		$this->assertEquals( 'value', $this->object->get( 'key' ) );
58
+		$this->object->set('key', 'value');
59
+		$this->assertEquals('value', $this->object->get('key'));
60 60
 	}
61 61
 
62 62
 
63 63
 	public function testGetSetArray()
64 64
 	{
65
-		$this->object->set( 'key', array( 'value' ) );
66
-		$this->assertEquals( array( 'value' ), $this->object->get( 'key' ) );
65
+		$this->object->set('key', array('value'));
66
+		$this->assertEquals(array('value'), $this->object->get('key'));
67 67
 	}
68 68
 }
Please login to merge, or discard this patch.
lib/custom/tests/MW/View/Helper/Url/_testfiles/routing.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
 $collection = new RouteCollection();
13 13
 
14
-$route = new Route( '/{site}/lists', array( '_controller' => 'AimeosShopBundle:Catalog:list' ) );
15
-$collection->add( 'catalog_list', $route );
14
+$route = new Route('/{site}/lists', array('_controller' => 'AimeosShopBundle:Catalog:list'));
15
+$collection->add('catalog_list', $route);
16 16
 
17 17
 return $collection;
Please login to merge, or discard this patch.
lib/custom/tests/bootstrap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * Set error reporting to maximum
10 10
  */
11 11
 error_reporting( -1 );
12
-ini_set( 'display_errors', '1' );
12
+ini_set('display_errors', '1');
13 13
 
14 14
 date_default_timezone_set('UTC');
15 15
 
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 /*
18 18
  * Set locale settings to reasonable defaults
19 19
  */
20
-setlocale( LC_ALL, 'en_US.UTF-8' );
21
-setlocale( LC_CTYPE, 'en_US.UTF-8' );
22
-setlocale( LC_NUMERIC, 'POSIX' );
23
-setlocale( LC_TIME, 'POSIX' );
24
-date_default_timezone_set( 'UTC' );
20
+setlocale(LC_ALL, 'en_US.UTF-8');
21
+setlocale(LC_CTYPE, 'en_US.UTF-8');
22
+setlocale(LC_NUMERIC, 'POSIX');
23
+setlocale(LC_TIME, 'POSIX');
24
+date_default_timezone_set('UTC');
25 25
 
26 26
 require_once 'TestHelper.php';
27 27
 TestHelper::bootstrap();
Please login to merge, or discard this patch.
lib/custom/src/MW/View/Helper/Response/Symfony2.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
 	 *
27 27
 	 * @param \Aimeos\MW\View\Iface $view View instance with registered view helpers
28 28
 	 */
29
-	public function __construct( \Aimeos\MW\View\Iface $view )
29
+	public function __construct(\Aimeos\MW\View\Iface $view)
30 30
 	{
31
-		parent::__construct( $view, new \Zend\Diactoros\Response() );
31
+		parent::__construct($view, new \Zend\Diactoros\Response());
32 32
 	}
33 33
 }
Please login to merge, or discard this patch.
lib/custom/tests/MW/View/Helper/Response/Symfony2Test.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,23 +17,23 @@
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		if( !class_exists( '\Zend\Diactoros\Response' ) ) {
21
-			$this->markTestSkipped( '\Zend\Diactoros\Response is not available' );
20
+		if (!class_exists('\Zend\Diactoros\Response')) {
21
+			$this->markTestSkipped('\Zend\Diactoros\Response is not available');
22 22
 		}
23 23
 
24 24
 		$view = new \Aimeos\MW\View\Standard();
25
-		$this->object = new \Aimeos\MW\View\Helper\Response\Symfony2( $view );
25
+		$this->object = new \Aimeos\MW\View\Helper\Response\Symfony2($view);
26 26
 	}
27 27
 
28 28
 
29 29
 	public function testTransform()
30 30
 	{
31
-		$this->assertInstanceOf( '\Aimeos\MW\View\Helper\Response\Symfony2', $this->object->transform() );
31
+		$this->assertInstanceOf('\Aimeos\MW\View\Helper\Response\Symfony2', $this->object->transform());
32 32
 	}
33 33
 
34 34
 
35 35
 	public function testCreateStream()
36 36
 	{
37
-		$this->assertInstanceOf( '\Psr\Http\Message\StreamInterface', $this->object->createStream( __FILE__ ) );
37
+		$this->assertInstanceOf('\Psr\Http\Message\StreamInterface', $this->object->createStream(__FILE__));
38 38
 	}
39 39
 }
Please login to merge, or discard this patch.
lib/custom/tests/MW/View/Helper/Url/Symfony2Test.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -25,17 +25,17 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	protected function setUp()
27 27
 	{
28
-		if( !class_exists( '\Symfony\Component\Routing\Router' ) ) {
29
-			$this->markTestSkipped( 'Symfony\Component\Routing\Router is not available' );
28
+		if (!class_exists('\Symfony\Component\Routing\Router')) {
29
+			$this->markTestSkipped('Symfony\Component\Routing\Router is not available');
30 30
 		}
31 31
 
32 32
 		$view = new \Aimeos\MW\View\Standard();
33 33
 
34
-		$loc = new \Symfony\Component\Config\FileLocator( array( __DIR__ . DIRECTORY_SEPARATOR . '_testfiles' ) );
35
-		$loader = new \Symfony\Component\Routing\Loader\PhpFileLoader( $loc );
36
-		$router = new \Symfony\Component\Routing\Router( $loader, 'routing.php' );
34
+		$loc = new \Symfony\Component\Config\FileLocator(array(__DIR__.DIRECTORY_SEPARATOR.'_testfiles'));
35
+		$loader = new \Symfony\Component\Routing\Loader\PhpFileLoader($loc);
36
+		$router = new \Symfony\Component\Routing\Router($loader, 'routing.php');
37 37
 
38
-		$this->object = new \Aimeos\MW\View\Helper\Url\Symfony2( $view, $router, array( 'site' => 'unittest' ) );
38
+		$this->object = new \Aimeos\MW\View\Helper\Url\Symfony2($view, $router, array('site' => 'unittest'));
39 39
 	}
40 40
 
41 41
 
@@ -53,26 +53,26 @@  discard block
 block discarded – undo
53 53
 
54 54
 	public function testTransform()
55 55
 	{
56
-		$this->assertEquals( '/unittest/lists', $this->object->transform( 'catalog_list' ) );
56
+		$this->assertEquals('/unittest/lists', $this->object->transform('catalog_list'));
57 57
 	}
58 58
 
59 59
 
60 60
 	public function testTransformArrays()
61 61
 	{
62
-		$this->assertEquals( '/unittest/lists?test%5B0%5D=a&test%5B1%5D=b', $this->object->transform( 'catalog_list', null, null, array( 'test' => array( 'a', 'b' ) ) ) );
62
+		$this->assertEquals('/unittest/lists?test%5B0%5D=a&test%5B1%5D=b', $this->object->transform('catalog_list', null, null, array('test' => array('a', 'b'))));
63 63
 	}
64 64
 
65 65
 
66 66
 	public function testTransformTrailing()
67 67
 	{
68
-		$this->assertEquals( '/unittest/lists?trailing=a_b', $this->object->transform( 'catalog_list', null, null, array(), array( 'a', 'b' ) ) );
68
+		$this->assertEquals('/unittest/lists?trailing=a_b', $this->object->transform('catalog_list', null, null, array(), array('a', 'b')));
69 69
 	}
70 70
 
71 71
 
72 72
 	public function testTransformAbsolute()
73 73
 	{
74
-		$options = array( 'absoluteUri' => true );
75
-		$result = $this->object->transform( 'catalog_list', null, null, array(), array(), $options );
76
-		$this->assertEquals( 'http://localhost/unittest/lists', $result );
74
+		$options = array('absoluteUri' => true);
75
+		$result = $this->object->transform('catalog_list', null, null, array(), array(), $options);
76
+		$this->assertEquals('http://localhost/unittest/lists', $result);
77 77
 	}
78 78
 }
Please login to merge, or discard this patch.
lib/custom/tests/TestHelper.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
 
18 18
 		$includepaths = $mshop->getIncludePaths();
19 19
 		$includepaths[] = get_include_path();
20
-		set_include_path( implode( PATH_SEPARATOR, $includepaths ) );
20
+		set_include_path(implode(PATH_SEPARATOR, $includepaths));
21 21
 	}
22 22
 
23 23
 
24
-	public static function getContext( $site = 'unittest' )
24
+	public static function getContext($site = 'unittest')
25 25
 	{
26
-		if( !isset( self::$context[$site] ) ) {
27
-			self::$context[$site] = self::createContext( $site );
26
+		if (!isset(self::$context[$site])) {
27
+			self::$context[$site] = self::createContext($site);
28 28
 		}
29 29
 
30 30
 		return clone self::$context[$site];
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 
34 34
 	private static function getAimeos()
35 35
 	{
36
-		if( !isset( self::$aimeos ) )
36
+		if (!isset(self::$aimeos))
37 37
 		{
38 38
 			require_once 'Bootstrap.php';
39
-			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
39
+			spl_autoload_register('Aimeos\\Bootstrap::autoload');
40 40
 
41
-			$extdir = dirname( dirname( dirname( __DIR__ ) ) );
42
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false );
41
+			$extdir = dirname(dirname(dirname(__DIR__)));
42
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false);
43 43
 		}
44 44
 
45 45
 		return self::$aimeos;
@@ -52,37 +52,37 @@  discard block
 block discarded – undo
52 52
 	 * @param string $site Unique site code
53 53
 	 * @return \\Aimeos\MShop\Context\Item\Iface Context object
54 54
 	 */
55
-		private static function createContext( $site )
55
+		private static function createContext($site)
56 56
 	{
57 57
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
58 58
 		$mshop = self::getAimeos();
59 59
 
60 60
 
61
-		$paths = $mshop->getConfigPaths( 'mysql' );
62
-		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
61
+		$paths = $mshop->getConfigPaths('mysql');
62
+		$paths[] = __DIR__.DIRECTORY_SEPARATOR.'config';
63 63
 
64
-		$conf = new \Aimeos\MW\Config\PHPArray( array(), $paths );
65
-		$ctx->setConfig( $conf );
64
+		$conf = new \Aimeos\MW\Config\PHPArray(array(), $paths);
65
+		$ctx->setConfig($conf);
66 66
 
67 67
 
68
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
69
-		$ctx->setDatabaseManager( $dbm );
68
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
69
+		$ctx->setDatabaseManager($dbm);
70 70
 
71 71
 
72
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
73
-		$ctx->setLogger( $logger );
72
+		$logger = new \Aimeos\MW\Logger\File($site.'.log', \Aimeos\MW\Logger\Base::DEBUG);
73
+		$ctx->setLogger($logger);
74 74
 
75 75
 
76 76
 		$session = new \Aimeos\MW\Session\None();
77
-		$ctx->setSession( $session );
77
+		$ctx->setSession($session);
78 78
 
79 79
 
80
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
81
-		$localeItem = $localeManager->bootstrap( $site, '', '', false );
80
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx);
81
+		$localeItem = $localeManager->bootstrap($site, '', '', false);
82 82
 
83
-		$ctx->setLocale( $localeItem );
83
+		$ctx->setLocale($localeItem);
84 84
 
85
-		$ctx->setEditor( 'ai-symfony:unittest' );
85
+		$ctx->setEditor('ai-symfony:unittest');
86 86
 
87 87
 		return $ctx;
88 88
 	}
Please login to merge, or discard this patch.
lib/custom/src/MW/View/Helper/Url/Symfony2.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 	 * @param Symfony\Component\Routing\RouterInterface $router Symfony2 Router implementation
33 33
 	 * @param array $fixed Fixed parameters that should be added to each URL
34 34
 	 */
35
-	public function __construct( $view, \Symfony\Component\Routing\RouterInterface $router, array $fixed )
35
+	public function __construct($view, \Symfony\Component\Routing\RouterInterface $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,19 +52,19 @@  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(), array $trailing = array(), array $config = array() )
55
+	public function transform($target = null, $controller = null, $action = null, array $params = array(), array $trailing = array(), array $config = array())
56 56
 	{
57
-		if( !empty( $trailing ) ) {
58
-			$params['trailing'] = join( '_', $trailing );
57
+		if (!empty($trailing)) {
58
+			$params['trailing'] = join('_', $trailing);
59 59
 		}
60 60
 
61
-		$params = $this->sanitize( $params );
61
+		$params = $this->sanitize($params);
62 62
 		$refType = \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_PATH;
63 63
 
64
-		if( isset( $config['absoluteUri'] ) ) {
64
+		if (isset($config['absoluteUri'])) {
65 65
 			$refType = \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL;
66 66
 		}
67 67
 
68
-		return $this->router->generate( $target, $params + $this->fixed, $refType );
68
+		return $this->router->generate($target, $params + $this->fixed, $refType);
69 69
 	}
70 70
 }
Please login to merge, or discard this patch.