Completed
Push — master ( 702095...b9dfd2 )
by Aimeos
02:26
created
lib/custom/tests/TestHelper.php 2 patches
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -8,88 +8,88 @@
 block discarded – undo
8 8
  */
9 9
 class TestHelper
10 10
 {
11
-	private static $aimeos;
12
-	private static $context = array();
11
+    private static $aimeos;
12
+    private static $context = array();
13 13
 
14 14
 
15
-	public static function bootstrap()
16
-	{
17
-		$aimeos = self::getAimeos();
15
+    public static function bootstrap()
16
+    {
17
+        $aimeos = self::getAimeos();
18 18
 
19
-		$includepaths = $aimeos->getIncludePaths();
20
-		$includepaths[] = get_include_path();
21
-		set_include_path( implode( PATH_SEPARATOR, $includepaths ) );
22
-	}
19
+        $includepaths = $aimeos->getIncludePaths();
20
+        $includepaths[] = get_include_path();
21
+        set_include_path( implode( PATH_SEPARATOR, $includepaths ) );
22
+    }
23 23
 
24 24
 
25
-	public static function getContext( $site = 'unittest' )
26
-	{
27
-		if( !isset( self::$context[$site] ) ) {
28
-			self::$context[$site] = self::createContext( $site );
29
-		}
25
+    public static function getContext( $site = 'unittest' )
26
+    {
27
+        if( !isset( self::$context[$site] ) ) {
28
+            self::$context[$site] = self::createContext( $site );
29
+        }
30 30
 
31
-		return clone self::$context[$site];
32
-	}
31
+        return clone self::$context[$site];
32
+    }
33 33
 
34 34
 
35
-	private static function getAimeos()
36
-	{
37
-		if( !isset( self::$aimeos ) )
38
-		{
39
-			require_once 'Bootstrap.php';
40
-			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
35
+    private static function getAimeos()
36
+    {
37
+        if( !isset( self::$aimeos ) )
38
+        {
39
+            require_once 'Bootstrap.php';
40
+            spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
41 41
 
42
-			$extdir = dirname( dirname( dirname( __DIR__ ) ) );
43
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true );
44
-		}
42
+            $extdir = dirname( dirname( dirname( __DIR__ ) ) );
43
+            self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true );
44
+        }
45 45
 
46
-		return self::$aimeos;
47
-	}
46
+        return self::$aimeos;
47
+    }
48 48
 
49 49
 
50
-	/**
51
-	 * @param string $site
52
-	 */
53
-	private static function createContext( $site )
54
-	{
55
-		$ctx = new \Aimeos\MShop\Context\Item\Ezpublish();
56
-		$aimeos = self::getAimeos();
50
+    /**
51
+     * @param string $site
52
+     */
53
+    private static function createContext( $site )
54
+    {
55
+        $ctx = new \Aimeos\MShop\Context\Item\Ezpublish();
56
+        $aimeos = self::getAimeos();
57 57
 
58 58
 
59
-		$paths = $aimeos->getConfigPaths();
60
-		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
59
+        $paths = $aimeos->getConfigPaths();
60
+        $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
61 61
 
62
-		$conf = new \Aimeos\MW\Config\PHPArray( array(), $paths );
63
-		$ctx->setConfig( $conf );
62
+        $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths );
63
+        $ctx->setConfig( $conf );
64 64
 
65 65
 
66
-		$dbm = new \Aimeos\MW\DB\Manager\DBAL( $conf );
67
-		$ctx->setDatabaseManager( $dbm );
66
+        $dbm = new \Aimeos\MW\DB\Manager\DBAL( $conf );
67
+        $ctx->setDatabaseManager( $dbm );
68 68
 
69 69
 
70
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
71
-		$ctx->setLogger( $logger );
70
+        $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
71
+        $ctx->setLogger( $logger );
72 72
 
73 73
 
74
-		$cache = new \Aimeos\MW\Cache\None();
75
-		$ctx->setCache( $cache );
74
+        $cache = new \Aimeos\MW\Cache\None();
75
+        $ctx->setCache( $cache );
76 76
 
77 77
 
78
-		$i18n = new \Aimeos\MW\Translation\None( 'de' );
79
-		$ctx->setI18n( array( 'de' => $i18n ) );
78
+        $i18n = new \Aimeos\MW\Translation\None( 'de' );
79
+        $ctx->setI18n( array( 'de' => $i18n ) );
80 80
 
81 81
 
82
-		$session = new \Aimeos\MW\Session\None();
83
-		$ctx->setSession( $session );
82
+        $session = new \Aimeos\MW\Session\None();
83
+        $ctx->setSession( $session );
84 84
 
85 85
 
86
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
87
-		$localeItem = $localeManager->bootstrap( $site, '', '', false );
86
+        $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
87
+        $localeItem = $localeManager->bootstrap( $site, '', '', false );
88 88
 
89
-		$ctx->setLocale( $localeItem );
89
+        $ctx->setLocale( $localeItem );
90 90
 
91
-		$ctx->setEditor( 'ai-ezpublish:unittest' );
91
+        $ctx->setEditor( 'ai-ezpublish:unittest' );
92 92
 
93
-		return $ctx;
94
-	}
93
+        return $ctx;
94
+    }
95 95
 }
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 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,13 +34,13 @@  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 ), true );
42
+			$extdir = dirname(dirname(dirname(__DIR__)));
43
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), true);
44 44
 		}
45 45
 
46 46
 		return self::$aimeos;
@@ -50,45 +50,45 @@  discard block
 block discarded – undo
50 50
 	/**
51 51
 	 * @param string $site
52 52
 	 */
53
-	private static function createContext( $site )
53
+	private static function createContext($site)
54 54
 	{
55 55
 		$ctx = new \Aimeos\MShop\Context\Item\Ezpublish();
56 56
 		$aimeos = self::getAimeos();
57 57
 
58 58
 
59 59
 		$paths = $aimeos->getConfigPaths();
60
-		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
60
+		$paths[] = __DIR__.DIRECTORY_SEPARATOR.'config';
61 61
 
62
-		$conf = new \Aimeos\MW\Config\PHPArray( array(), $paths );
63
-		$ctx->setConfig( $conf );
62
+		$conf = new \Aimeos\MW\Config\PHPArray(array(), $paths);
63
+		$ctx->setConfig($conf);
64 64
 
65 65
 
66
-		$dbm = new \Aimeos\MW\DB\Manager\DBAL( $conf );
67
-		$ctx->setDatabaseManager( $dbm );
66
+		$dbm = new \Aimeos\MW\DB\Manager\DBAL($conf);
67
+		$ctx->setDatabaseManager($dbm);
68 68
 
69 69
 
70
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
71
-		$ctx->setLogger( $logger );
70
+		$logger = new \Aimeos\MW\Logger\File($site.'.log', \Aimeos\MW\Logger\Base::DEBUG);
71
+		$ctx->setLogger($logger);
72 72
 
73 73
 
74 74
 		$cache = new \Aimeos\MW\Cache\None();
75
-		$ctx->setCache( $cache );
75
+		$ctx->setCache($cache);
76 76
 
77 77
 
78
-		$i18n = new \Aimeos\MW\Translation\None( 'de' );
79
-		$ctx->setI18n( array( 'de' => $i18n ) );
78
+		$i18n = new \Aimeos\MW\Translation\None('de');
79
+		$ctx->setI18n(array('de' => $i18n));
80 80
 
81 81
 
82 82
 		$session = new \Aimeos\MW\Session\None();
83
-		$ctx->setSession( $session );
83
+		$ctx->setSession($session);
84 84
 
85 85
 
86
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
87
-		$localeItem = $localeManager->bootstrap( $site, '', '', false );
86
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx);
87
+		$localeItem = $localeManager->bootstrap($site, '', '', false);
88 88
 
89
-		$ctx->setLocale( $localeItem );
89
+		$ctx->setLocale($localeItem);
90 90
 
91
-		$ctx->setEditor( 'ai-ezpublish:unittest' );
91
+		$ctx->setEditor('ai-ezpublish:unittest');
92 92
 
93 93
 		return $ctx;
94 94
 	}
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Lists/Type/EzpublishTest.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -11,44 +11,44 @@
 block discarded – undo
11 11
 
12 12
 class EzpublishTest extends \PHPUnit_Framework_TestCase
13 13
 {
14
-	private $object;
14
+    private $object;
15 15
 
16 16
 
17
-	protected function setUp()
18
-	{
19
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' );
17
+    protected function setUp()
18
+    {
19
+        $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' );
20 20
 
21
-		$listManager = $manager->getSubManager( 'lists', 'Ezpublish' );
22
-		$this->object = $listManager->getSubManager( 'type', 'Ezpublish' );
23
-	}
21
+        $listManager = $manager->getSubManager( 'lists', 'Ezpublish' );
22
+        $this->object = $listManager->getSubManager( 'type', 'Ezpublish' );
23
+    }
24 24
 
25 25
 
26
-	protected function tearDown()
27
-	{
28
-		unset( $this->object );
29
-	}
26
+    protected function tearDown()
27
+    {
28
+        unset( $this->object );
29
+    }
30 30
 
31 31
 
32
-	public function testCleanup()
33
-	{
34
-		$this->object->cleanup( array( -1 ) );
35
-	}
32
+    public function testCleanup()
33
+    {
34
+        $this->object->cleanup( array( -1 ) );
35
+    }
36 36
 
37 37
 
38
-	public function testGetSearchAttributes()
39
-	{
40
-		$attributes = $this->object->getSearchAttributes();
41
-		$this->assertGreaterThan( 0, count( $attributes ) );
38
+    public function testGetSearchAttributes()
39
+    {
40
+        $attributes = $this->object->getSearchAttributes();
41
+        $this->assertGreaterThan( 0, count( $attributes ) );
42 42
 
43
-		foreach( $attributes as $attribute ) {
44
-			$this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute );
45
-		}
46
-	}
43
+        foreach( $attributes as $attribute ) {
44
+            $this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute );
45
+        }
46
+    }
47 47
 
48 48
 
49
-	public function testGetSubManager()
50
-	{
51
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
52
-		$this->object->getSubManager( 'unknown' );
53
-	}
49
+    public function testGetSubManager()
50
+    {
51
+        $this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
52
+        $this->object->getSubManager( 'unknown' );
53
+    }
54 54
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,39 +16,39 @@
 block discarded – undo
16 16
 
17 17
 	protected function setUp()
18 18
 	{
19
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' );
19
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Ezpublish');
20 20
 
21
-		$listManager = $manager->getSubManager( 'lists', 'Ezpublish' );
22
-		$this->object = $listManager->getSubManager( 'type', 'Ezpublish' );
21
+		$listManager = $manager->getSubManager('lists', 'Ezpublish');
22
+		$this->object = $listManager->getSubManager('type', 'Ezpublish');
23 23
 	}
24 24
 
25 25
 
26 26
 	protected function tearDown()
27 27
 	{
28
-		unset( $this->object );
28
+		unset($this->object);
29 29
 	}
30 30
 
31 31
 
32 32
 	public function testCleanup()
33 33
 	{
34
-		$this->object->cleanup( array( -1 ) );
34
+		$this->object->cleanup(array( -1 ));
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testGetSearchAttributes()
39 39
 	{
40 40
 		$attributes = $this->object->getSearchAttributes();
41
-		$this->assertGreaterThan( 0, count( $attributes ) );
41
+		$this->assertGreaterThan(0, count($attributes));
42 42
 
43
-		foreach( $attributes as $attribute ) {
44
-			$this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute );
43
+		foreach ($attributes as $attribute) {
44
+			$this->assertInstanceOf('\Aimeos\MW\Criteria\Attribute\Iface', $attribute);
45 45
 		}
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testGetSubManager()
50 50
 	{
51
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
52
-		$this->object->getSubManager( 'unknown' );
51
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
52
+		$this->object->getSubManager('unknown');
53 53
 	}
54 54
 }
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Lists/EzpublishTest.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,62 +11,62 @@
 block discarded – undo
11 11
 
12 12
 class EzpublishTest extends \PHPUnit_Framework_TestCase
13 13
 {
14
-	private $object;
14
+    private $object;
15 15
 
16 16
 
17
-	protected function setUp()
18
-	{
19
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' );
20
-		$this->object = $manager->getSubManager( 'lists', 'Ezpublish' );
21
-	}
17
+    protected function setUp()
18
+    {
19
+        $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' );
20
+        $this->object = $manager->getSubManager( 'lists', 'Ezpublish' );
21
+    }
22 22
 
23 23
 
24
-	protected function tearDown()
25
-	{
26
-		unset( $this->object );
27
-	}
24
+    protected function tearDown()
25
+    {
26
+        unset( $this->object );
27
+    }
28 28
 
29 29
 
30
-	public function testCleanup()
31
-	{
32
-		$this->object->cleanup( array( -1 ) );
33
-	}
30
+    public function testCleanup()
31
+    {
32
+        $this->object->cleanup( array( -1 ) );
33
+    }
34 34
 
35 35
 
36
-	public function testGetSearchAttributes()
37
-	{
38
-		$attributes = $this->object->getSearchAttributes();
39
-		$this->assertGreaterThan( 0, count( $attributes ) );
36
+    public function testGetSearchAttributes()
37
+    {
38
+        $attributes = $this->object->getSearchAttributes();
39
+        $this->assertGreaterThan( 0, count( $attributes ) );
40 40
 
41
-		foreach( $attributes as $attribute ) {
42
-			$this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute );
43
-		}
44
-	}
41
+        foreach( $attributes as $attribute ) {
42
+            $this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute );
43
+        }
44
+    }
45 45
 
46 46
 
47
-	public function testGetSubManager()
48
-	{
49
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') );
50
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') );
47
+    public function testGetSubManager()
48
+    {
49
+        $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') );
50
+        $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') );
51 51
 
52
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
53
-		$this->object->getSubManager( 'unknown' );
54
-	}
52
+        $this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
53
+        $this->object->getSubManager( 'unknown' );
54
+    }
55 55
 
56 56
 
57
-	public function testSaveItemInvalidItem()
58
-	{
59
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
60
-		$this->object->saveItem( new \Aimeos\MShop\Common\Item\Type\Standard( 'common.lists.type.' ) );
61
-	}
57
+    public function testSaveItemInvalidItem()
58
+    {
59
+        $this->setExpectedException( '\Aimeos\MShop\Exception' );
60
+        $this->object->saveItem( new \Aimeos\MShop\Common\Item\Type\Standard( 'common.lists.type.' ) );
61
+    }
62 62
 
63 63
 
64
-	public function testSaveItemInvalidDomain()
65
-	{
66
-		$item = $this->object->createItem();
67
-		$item->setDomain( 'customer/group' );
64
+    public function testSaveItemInvalidDomain()
65
+    {
66
+        $item = $this->object->createItem();
67
+        $item->setDomain( 'customer/group' );
68 68
 
69
-		$this->setExpectedException( '\Aimeos\MShop\Customer\Exception' );
70
-		$this->object->saveItem( $item );
71
-	}
69
+        $this->setExpectedException( '\Aimeos\MShop\Customer\Exception' );
70
+        $this->object->saveItem( $item );
71
+    }
72 72
 }
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -16,57 +16,57 @@
 block discarded – undo
16 16
 
17 17
 	protected function setUp()
18 18
 	{
19
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' );
20
-		$this->object = $manager->getSubManager( 'lists', 'Ezpublish' );
19
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Ezpublish');
20
+		$this->object = $manager->getSubManager('lists', 'Ezpublish');
21 21
 	}
22 22
 
23 23
 
24 24
 	protected function tearDown()
25 25
 	{
26
-		unset( $this->object );
26
+		unset($this->object);
27 27
 	}
28 28
 
29 29
 
30 30
 	public function testCleanup()
31 31
 	{
32
-		$this->object->cleanup( array( -1 ) );
32
+		$this->object->cleanup(array( -1 ));
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testGetSearchAttributes()
37 37
 	{
38 38
 		$attributes = $this->object->getSearchAttributes();
39
-		$this->assertGreaterThan( 0, count( $attributes ) );
39
+		$this->assertGreaterThan(0, count($attributes));
40 40
 
41
-		foreach( $attributes as $attribute ) {
42
-			$this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute );
41
+		foreach ($attributes as $attribute) {
42
+			$this->assertInstanceOf('\Aimeos\MW\Criteria\Attribute\Iface', $attribute);
43 43
 		}
44 44
 	}
45 45
 
46 46
 
47 47
 	public function testGetSubManager()
48 48
 	{
49
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') );
50
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') );
49
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type'));
50
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard'));
51 51
 
52
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
53
-		$this->object->getSubManager( 'unknown' );
52
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
53
+		$this->object->getSubManager('unknown');
54 54
 	}
55 55
 
56 56
 
57 57
 	public function testSaveItemInvalidItem()
58 58
 	{
59
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
60
-		$this->object->saveItem( new \Aimeos\MShop\Common\Item\Type\Standard( 'common.lists.type.' ) );
59
+		$this->setExpectedException('\Aimeos\MShop\Exception');
60
+		$this->object->saveItem(new \Aimeos\MShop\Common\Item\Type\Standard('common.lists.type.'));
61 61
 	}
62 62
 
63 63
 
64 64
 	public function testSaveItemInvalidDomain()
65 65
 	{
66 66
 		$item = $this->object->createItem();
67
-		$item->setDomain( 'customer/group' );
67
+		$item->setDomain('customer/group');
68 68
 
69
-		$this->setExpectedException( '\Aimeos\MShop\Customer\Exception' );
70
-		$this->object->saveItem( $item );
69
+		$this->setExpectedException('\Aimeos\MShop\Customer\Exception');
70
+		$this->object->saveItem($item);
71 71
 	}
72 72
 }
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Address/EzpublishTest.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -11,49 +11,49 @@
 block discarded – undo
11 11
 
12 12
 class EzpublishTest extends \PHPUnit_Framework_TestCase
13 13
 {
14
-	private $object;
14
+    private $object;
15 15
 
16 16
 
17
-	protected function setUp()
18
-	{
19
-		$customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( \TestHelper::getContext() );
17
+    protected function setUp()
18
+    {
19
+        $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( \TestHelper::getContext() );
20 20
 
21
-		$this->object = $customer->getSubManager( 'address', 'Ezpublish' );
22
-	}
21
+        $this->object = $customer->getSubManager( 'address', 'Ezpublish' );
22
+    }
23 23
 
24 24
 
25
-	protected function tearDown()
26
-	{
27
-		unset( $this->object );
28
-	}
25
+    protected function tearDown()
26
+    {
27
+        unset( $this->object );
28
+    }
29 29
 
30 30
 
31
-	public function testCleanup()
32
-	{
33
-		$this->object->cleanup( array( -1 ) );
34
-	}
31
+    public function testCleanup()
32
+    {
33
+        $this->object->cleanup( array( -1 ) );
34
+    }
35 35
 
36 36
 
37
-	public function testDeleteItems()
38
-	{
39
-		$this->object->deleteItems( array( -1 ) );
40
-	}
37
+    public function testDeleteItems()
38
+    {
39
+        $this->object->deleteItems( array( -1 ) );
40
+    }
41 41
 
42 42
 
43
-	public function testGetSearchAttributes()
44
-	{
45
-		$attributes = $this->object->getSearchAttributes();
46
-		$this->assertGreaterThan( 0, count( $attributes ) );
43
+    public function testGetSearchAttributes()
44
+    {
45
+        $attributes = $this->object->getSearchAttributes();
46
+        $this->assertGreaterThan( 0, count( $attributes ) );
47 47
 
48
-		foreach( $attributes as $attribute ) {
49
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
50
-		}
51
-	}
48
+        foreach( $attributes as $attribute ) {
49
+            $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
50
+        }
51
+    }
52 52
 
53 53
 
54
-	public function testGetSubManager()
55
-	{
56
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
57
-		$this->object->getSubManager( 'unknown' );
58
-	}
54
+    public function testGetSubManager()
55
+    {
56
+        $this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
57
+        $this->object->getSubManager( 'unknown' );
58
+    }
59 59
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,44 +16,44 @@
 block discarded – undo
16 16
 
17 17
 	protected function setUp()
18 18
 	{
19
-		$customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( \TestHelper::getContext() );
19
+		$customer = new \Aimeos\MShop\Customer\Manager\Ezpublish(\TestHelper::getContext());
20 20
 
21
-		$this->object = $customer->getSubManager( 'address', 'Ezpublish' );
21
+		$this->object = $customer->getSubManager('address', 'Ezpublish');
22 22
 	}
23 23
 
24 24
 
25 25
 	protected function tearDown()
26 26
 	{
27
-		unset( $this->object );
27
+		unset($this->object);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCleanup()
32 32
 	{
33
-		$this->object->cleanup( array( -1 ) );
33
+		$this->object->cleanup(array( -1 ));
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testDeleteItems()
38 38
 	{
39
-		$this->object->deleteItems( array( -1 ) );
39
+		$this->object->deleteItems(array( -1 ));
40 40
 	}
41 41
 
42 42
 
43 43
 	public function testGetSearchAttributes()
44 44
 	{
45 45
 		$attributes = $this->object->getSearchAttributes();
46
-		$this->assertGreaterThan( 0, count( $attributes ) );
46
+		$this->assertGreaterThan(0, count($attributes));
47 47
 
48
-		foreach( $attributes as $attribute ) {
49
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
48
+		foreach ($attributes as $attribute) {
49
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
50 50
 		}
51 51
 	}
52 52
 
53 53
 
54 54
 	public function testGetSubManager()
55 55
 	{
56
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
57
-		$this->object->getSubManager( 'unknown' );
56
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
57
+		$this->object->getSubManager('unknown');
58 58
 	}
59 59
 }
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Group/EzpublishTest.php 2 patches
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -11,98 +11,98 @@
 block discarded – undo
11 11
 
12 12
 class EzpublishTest extends \PHPUnit_Framework_TestCase
13 13
 {
14
-	private $context;
15
-	private $object;
14
+    private $context;
15
+    private $object;
16 16
 
17 17
 
18
-	protected function setUp()
19
-	{
20
-		$this->context = \TestHelper::getContext();
21
-		$customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $this->context );
18
+    protected function setUp()
19
+    {
20
+        $this->context = \TestHelper::getContext();
21
+        $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $this->context );
22 22
 
23
-		$this->object = $customer->getSubManager( 'group', 'Ezpublish' );
24
-	}
23
+        $this->object = $customer->getSubManager( 'group', 'Ezpublish' );
24
+    }
25 25
 
26 26
 
27
-	protected function tearDown()
28
-	{
29
-		unset( $this->object );
30
-	}
27
+    protected function tearDown()
28
+    {
29
+        unset( $this->object );
30
+    }
31 31
 
32 32
 
33
-	public function testCleanup()
34
-	{
35
-		$this->object->cleanup( array( -1 ) );
36
-	}
33
+    public function testCleanup()
34
+    {
35
+        $this->object->cleanup( array( -1 ) );
36
+    }
37 37
 
38 38
 
39
-	public function testDeleteItems()
40
-	{
41
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
42
-		$this->object->deleteItems( array( -1 ) );
43
-	}
39
+    public function testDeleteItems()
40
+    {
41
+        $this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
42
+        $this->object->deleteItems( array( -1 ) );
43
+    }
44 44
 
45 45
 
46
-	public function testGetSearchAttributes()
47
-	{
48
-		$attributes = $this->object->getSearchAttributes();
49
-		$this->assertGreaterThan( 0, count( $attributes ) );
46
+    public function testGetSearchAttributes()
47
+    {
48
+        $attributes = $this->object->getSearchAttributes();
49
+        $this->assertGreaterThan( 0, count( $attributes ) );
50 50
 
51
-		foreach( $attributes as $attribute ) {
52
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
53
-		}
54
-	}
51
+        foreach( $attributes as $attribute ) {
52
+            $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
53
+        }
54
+    }
55 55
 
56 56
 
57
-	public function testGetSubManager()
58
-	{
59
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
60
-		$this->object->getSubManager( 'unknown' );
61
-	}
57
+    public function testGetSubManager()
58
+    {
59
+        $this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
60
+        $this->object->getSubManager( 'unknown' );
61
+    }
62 62
 
63 63
 
64
-	public function testSaveItem()
65
-	{
66
-		$this->setExpectedException( '\\Aimeos\\MShop\\Customer\\Exception' );
67
-		$this->object->saveItem( new \Aimeos\MShop\Common\Item\Lists\Standard( 'common.lists.' ) );
68
-	}
64
+    public function testSaveItem()
65
+    {
66
+        $this->setExpectedException( '\\Aimeos\\MShop\\Customer\\Exception' );
67
+        $this->object->saveItem( new \Aimeos\MShop\Common\Item\Lists\Standard( 'common.lists.' ) );
68
+    }
69 69
 
70 70
 
71
-	public function testSearchItems()
72
-	{
73
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Group\Ezpublish' )
74
-			->setConstructorArgs( array( \TestHelper::getContext() ) )
75
-			->setMethods( array( 'searchItemsBase' ) )
76
-			->getMock();
71
+    public function testSearchItems()
72
+    {
73
+        $mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Group\Ezpublish' )
74
+            ->setConstructorArgs( array( \TestHelper::getContext() ) )
75
+            ->setMethods( array( 'searchItemsBase' ) )
76
+            ->getMock();
77 77
 
78
-		$result = $this->getMockBuilder( '\Aimeos\MW\DB\Result\Iface' )
79
-			->setMethods( array( 'affectedRows', 'fetch', 'finish', 'nextResult' ) )
80
-			->getMock();
78
+        $result = $this->getMockBuilder( '\Aimeos\MW\DB\Result\Iface' )
79
+            ->setMethods( array( 'affectedRows', 'fetch', 'finish', 'nextResult' ) )
80
+            ->getMock();
81 81
 
82
-		$mock->expects( $this->once() )->method( 'searchItemsBase' )
83
-			->will( $this->returnValue( $result ) );
82
+        $mock->expects( $this->once() )->method( 'searchItemsBase' )
83
+            ->will( $this->returnValue( $result ) );
84 84
 
85
-		$result->expects( $this->exactly( 2 ) )->method( 'fetch' )
86
-			->will( $this->onConsecutiveCalls( array( 'customer.group.id' => 1 ), false ) );
85
+        $result->expects( $this->exactly( 2 ) )->method( 'fetch' )
86
+            ->will( $this->onConsecutiveCalls( array( 'customer.group.id' => 1 ), false ) );
87 87
 
88
-		$result = $mock->searchItems( $mock->createSearch() );
88
+        $result = $mock->searchItems( $mock->createSearch() );
89 89
 
90
-		$this->assertEquals( 1, count( $result ) );
91
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Group\Iface', $result[1] );
92
-	}
90
+        $this->assertEquals( 1, count( $result ) );
91
+        $this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Group\Iface', $result[1] );
92
+    }
93 93
 
94 94
 
95
-	public function testSearchItemsException()
96
-	{
97
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Group\Ezpublish' )
98
-			->setConstructorArgs( array( \TestHelper::getContext() ) )
99
-			->setMethods( array( 'searchItemsBase' ) )
100
-			->getMock();
95
+    public function testSearchItemsException()
96
+    {
97
+        $mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Group\Ezpublish' )
98
+            ->setConstructorArgs( array( \TestHelper::getContext() ) )
99
+            ->setMethods( array( 'searchItemsBase' ) )
100
+            ->getMock();
101 101
 
102
-		$mock->expects( $this->once() )->method( 'searchItemsBase' )
103
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
102
+        $mock->expects( $this->once() )->method( 'searchItemsBase' )
103
+            ->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
104 104
 
105
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
106
-		$mock->searchItems( $mock->createSearch() );
107
-	}
105
+        $this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
106
+        $mock->searchItems( $mock->createSearch() );
107
+    }
108 108
 }
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -18,91 +18,91 @@
 block discarded – undo
18 18
 	protected function setUp()
19 19
 	{
20 20
 		$this->context = \TestHelper::getContext();
21
-		$customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $this->context );
21
+		$customer = new \Aimeos\MShop\Customer\Manager\Ezpublish($this->context);
22 22
 
23
-		$this->object = $customer->getSubManager( 'group', 'Ezpublish' );
23
+		$this->object = $customer->getSubManager('group', 'Ezpublish');
24 24
 	}
25 25
 
26 26
 
27 27
 	protected function tearDown()
28 28
 	{
29
-		unset( $this->object );
29
+		unset($this->object);
30 30
 	}
31 31
 
32 32
 
33 33
 	public function testCleanup()
34 34
 	{
35
-		$this->object->cleanup( array( -1 ) );
35
+		$this->object->cleanup(array( -1 ));
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testDeleteItems()
40 40
 	{
41
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
42
-		$this->object->deleteItems( array( -1 ) );
41
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
42
+		$this->object->deleteItems(array( -1 ));
43 43
 	}
44 44
 
45 45
 
46 46
 	public function testGetSearchAttributes()
47 47
 	{
48 48
 		$attributes = $this->object->getSearchAttributes();
49
-		$this->assertGreaterThan( 0, count( $attributes ) );
49
+		$this->assertGreaterThan(0, count($attributes));
50 50
 
51
-		foreach( $attributes as $attribute ) {
52
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
51
+		foreach ($attributes as $attribute) {
52
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
53 53
 		}
54 54
 	}
55 55
 
56 56
 
57 57
 	public function testGetSubManager()
58 58
 	{
59
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
60
-		$this->object->getSubManager( 'unknown' );
59
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
60
+		$this->object->getSubManager('unknown');
61 61
 	}
62 62
 
63 63
 
64 64
 	public function testSaveItem()
65 65
 	{
66
-		$this->setExpectedException( '\\Aimeos\\MShop\\Customer\\Exception' );
67
-		$this->object->saveItem( new \Aimeos\MShop\Common\Item\Lists\Standard( 'common.lists.' ) );
66
+		$this->setExpectedException('\\Aimeos\\MShop\\Customer\\Exception');
67
+		$this->object->saveItem(new \Aimeos\MShop\Common\Item\Lists\Standard('common.lists.'));
68 68
 	}
69 69
 
70 70
 
71 71
 	public function testSearchItems()
72 72
 	{
73
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Group\Ezpublish' )
74
-			->setConstructorArgs( array( \TestHelper::getContext() ) )
75
-			->setMethods( array( 'searchItemsBase' ) )
73
+		$mock = $this->getMockBuilder('\Aimeos\MShop\Customer\Manager\Group\Ezpublish')
74
+			->setConstructorArgs(array(\TestHelper::getContext()))
75
+			->setMethods(array('searchItemsBase'))
76 76
 			->getMock();
77 77
 
78
-		$result = $this->getMockBuilder( '\Aimeos\MW\DB\Result\Iface' )
79
-			->setMethods( array( 'affectedRows', 'fetch', 'finish', 'nextResult' ) )
78
+		$result = $this->getMockBuilder('\Aimeos\MW\DB\Result\Iface')
79
+			->setMethods(array('affectedRows', 'fetch', 'finish', 'nextResult'))
80 80
 			->getMock();
81 81
 
82
-		$mock->expects( $this->once() )->method( 'searchItemsBase' )
83
-			->will( $this->returnValue( $result ) );
82
+		$mock->expects($this->once())->method('searchItemsBase')
83
+			->will($this->returnValue($result));
84 84
 
85
-		$result->expects( $this->exactly( 2 ) )->method( 'fetch' )
86
-			->will( $this->onConsecutiveCalls( array( 'customer.group.id' => 1 ), false ) );
85
+		$result->expects($this->exactly(2))->method('fetch')
86
+			->will($this->onConsecutiveCalls(array('customer.group.id' => 1), false));
87 87
 
88
-		$result = $mock->searchItems( $mock->createSearch() );
88
+		$result = $mock->searchItems($mock->createSearch());
89 89
 
90
-		$this->assertEquals( 1, count( $result ) );
91
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Group\Iface', $result[1] );
90
+		$this->assertEquals(1, count($result));
91
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Group\Iface', $result[1]);
92 92
 	}
93 93
 
94 94
 
95 95
 	public function testSearchItemsException()
96 96
 	{
97
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Group\Ezpublish' )
98
-			->setConstructorArgs( array( \TestHelper::getContext() ) )
99
-			->setMethods( array( 'searchItemsBase' ) )
97
+		$mock = $this->getMockBuilder('\Aimeos\MShop\Customer\Manager\Group\Ezpublish')
98
+			->setConstructorArgs(array(\TestHelper::getContext()))
99
+			->setMethods(array('searchItemsBase'))
100 100
 			->getMock();
101 101
 
102
-		$mock->expects( $this->once() )->method( 'searchItemsBase' )
103
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
102
+		$mock->expects($this->once())->method('searchItemsBase')
103
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
104 104
 
105
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
106
-		$mock->searchItems( $mock->createSearch() );
105
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
106
+		$mock->searchItems($mock->createSearch());
107 107
 	}
108 108
 }
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/EzpublishTest.php 2 patches
Indentation   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -11,213 +11,213 @@
 block discarded – undo
11 11
 
12 12
 class EzpublishTest extends \PHPUnit_Framework_TestCase
13 13
 {
14
-	private $address;
15
-	private $context;
16
-	private $object;
14
+    private $address;
15
+    private $context;
16
+    private $object;
17 17
 
18 18
 
19
-	protected function setUp()
20
-	{
21
-		if( !interface_exists( 'eZ\Publish\API\Repository\UserService' ) ) {
22
-			$this->markTestSkipped( 'Install ezsystems/ezpublish-api first' );
23
-		}
19
+    protected function setUp()
20
+    {
21
+        if( !interface_exists( 'eZ\Publish\API\Repository\UserService' ) ) {
22
+            $this->markTestSkipped( 'Install ezsystems/ezpublish-api first' );
23
+        }
24 24
 
25
-		$this->context = \TestHelper::getContext();
25
+        $this->context = \TestHelper::getContext();
26 26
 
27
-		$this->object = new \Aimeos\MShop\Customer\Manager\Ezpublish( $this->context );
28
-		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.' );
29
-	}
27
+        $this->object = new \Aimeos\MShop\Customer\Manager\Ezpublish( $this->context );
28
+        $this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.' );
29
+    }
30 30
 
31 31
 
32
-	protected function tearDown()
33
-	{
34
-		unset( $this->object, $this->context, $this->address );
35
-	}
32
+    protected function tearDown()
33
+    {
34
+        unset( $this->object, $this->context, $this->address );
35
+    }
36 36
 
37 37
 
38
-	public function testCleanup()
39
-	{
40
-		$this->object->cleanup( array( -1 ) );
41
-	}
38
+    public function testCleanup()
39
+    {
40
+        $this->object->cleanup( array( -1 ) );
41
+    }
42 42
 
43 43
 
44
-	public function testCreateItem()
45
-	{
46
-		$this->assertInstanceOf( 'Aimeos\MShop\Customer\Item\Iface', $this->object->createItem() );
47
-	}
44
+    public function testCreateItem()
45
+    {
46
+        $this->assertInstanceOf( 'Aimeos\MShop\Customer\Item\Iface', $this->object->createItem() );
47
+    }
48 48
 
49 49
 
50
-	public function testDeleteItems()
51
-	{
52
-		$mock = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
53
-		$user = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\User' )->getMock();
50
+    public function testDeleteItems()
51
+    {
52
+        $mock = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
53
+        $user = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\User' )->getMock();
54 54
 
55
-		$mock->expects( $this->once() )->method( 'loadUser' )->will( $this->returnValue( $user ) );
56
-		$mock->expects( $this->once() )->method( 'deleteUser' );
55
+        $mock->expects( $this->once() )->method( 'loadUser' )->will( $this->returnValue( $user ) );
56
+        $mock->expects( $this->once() )->method( 'deleteUser' );
57 57
 
58
-		$this->context->setEzUserService( $mock );
59
-		$this->object->deleteItems( array( -1 ) );
60
-	}
58
+        $this->context->setEzUserService( $mock );
59
+        $this->object->deleteItems( array( -1 ) );
60
+    }
61 61
 
62 62
 
63
-	public function testGetSearchAttributes()
64
-	{
65
-		$attributes = $this->object->getSearchAttributes();
66
-		$this->assertGreaterThan( 0, count( $attributes ) );
63
+    public function testGetSearchAttributes()
64
+    {
65
+        $attributes = $this->object->getSearchAttributes();
66
+        $this->assertGreaterThan( 0, count( $attributes ) );
67 67
 
68
-		foreach( $attributes as $attribute ) {
69
-			$this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute );
70
-		}
71
-	}
68
+        foreach( $attributes as $attribute ) {
69
+            $this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute );
70
+        }
71
+    }
72 72
 
73 73
 
74
-	public function testGetSubManager()
75
-	{
76
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->getSubManager( 'address' ) );
77
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->getSubManager( 'address', 'Standard' ) );
74
+    public function testGetSubManager()
75
+    {
76
+        $this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->getSubManager( 'address' ) );
77
+        $this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->getSubManager( 'address', 'Standard' ) );
78 78
 
79
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
80
-		$this->object->getSubManager( 'unknown' );
81
-	}
79
+        $this->setExpectedException( '\Aimeos\MShop\Exception' );
80
+        $this->object->getSubManager( 'unknown' );
81
+    }
82 82
 
83 83
 
84
-	public function testGetSubManagerInvalidName()
85
-	{
86
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
87
-		$this->object->getSubManager( 'address', 'unknown' );
88
-	}
84
+    public function testGetSubManagerInvalidName()
85
+    {
86
+        $this->setExpectedException( '\Aimeos\MShop\Exception' );
87
+        $this->object->getSubManager( 'address', 'unknown' );
88
+    }
89 89
 
90 90
 
91
-	public function testSaveItemInsert()
92
-	{
93
-		$service = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
94
-		$struct = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\UserCreateStruct' )->getMock();
95
-		$user = $this->getMockBuilder( '\eZ\Publish\API\Repository\Values\User\User' )
96
-			->setMethods( array( 'getUserId', 'getVersionInfo', 'getFieldValue', 'getFields', 'getFieldsByLanguage' ) )
97
-			->getMock();
91
+    public function testSaveItemInsert()
92
+    {
93
+        $service = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
94
+        $struct = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\UserCreateStruct' )->getMock();
95
+        $user = $this->getMockBuilder( '\eZ\Publish\API\Repository\Values\User\User' )
96
+            ->setMethods( array( 'getUserId', 'getVersionInfo', 'getFieldValue', 'getFields', 'getFieldsByLanguage' ) )
97
+            ->getMock();
98 98
 
99
-		$dbm = $this->getMockBuilder( 'Aimeos\MW\DB\Manager\Iface' )->getMock();
100
-		$conn = $this->getMockBuilder( 'Aimeos\MW\DB\Connection\Iface' )->getMock();
101
-		$stmt = $this->getMockBuilder( 'Aimeos\MW\DB\Statement\Iface' )->getMock();
102
-		$result = $this->getMockBuilder( 'Aimeos\MW\DB\Result\Iface' )->getMock();
99
+        $dbm = $this->getMockBuilder( 'Aimeos\MW\DB\Manager\Iface' )->getMock();
100
+        $conn = $this->getMockBuilder( 'Aimeos\MW\DB\Connection\Iface' )->getMock();
101
+        $stmt = $this->getMockBuilder( 'Aimeos\MW\DB\Statement\Iface' )->getMock();
102
+        $result = $this->getMockBuilder( 'Aimeos\MW\DB\Result\Iface' )->getMock();
103 103
 
104
-		$service->expects( $this->once() )->method( 'newUserCreateStruct' )->will( $this->returnValue( $struct ) );
105
-		$service->expects( $this->once() )->method( 'createUser' )->will( $this->returnValue( $user ) );
106
-		$user->expects( $this->once() )->method( 'getUserId' )->will( $this->returnValue( 1 ) );
107
-		$dbm->expects( $this->once() )->method( 'acquire' )->will( $this->returnValue( $conn ) );
108
-		$conn->expects( $this->once() )->method( 'create' )->will( $this->returnValue( $stmt ) );
109
-		$stmt->expects( $this->once() )->method( 'execute' )->will( $this->returnValue( $result ) );
104
+        $service->expects( $this->once() )->method( 'newUserCreateStruct' )->will( $this->returnValue( $struct ) );
105
+        $service->expects( $this->once() )->method( 'createUser' )->will( $this->returnValue( $user ) );
106
+        $user->expects( $this->once() )->method( 'getUserId' )->will( $this->returnValue( 1 ) );
107
+        $dbm->expects( $this->once() )->method( 'acquire' )->will( $this->returnValue( $conn ) );
108
+        $conn->expects( $this->once() )->method( 'create' )->will( $this->returnValue( $stmt ) );
109
+        $stmt->expects( $this->once() )->method( 'execute' )->will( $this->returnValue( $result ) );
110 110
 
111 111
 
112
-		$this->context->setDatabaseManager( $dbm );
113
-		$this->context->setEzUserService( $service );
112
+        $this->context->setDatabaseManager( $dbm );
113
+        $this->context->setEzUserService( $service );
114 114
 
115
-		$this->object->saveItem( new \Aimeos\MShop\Customer\Item\Standard( $this->address ) );
116
-	}
115
+        $this->object->saveItem( new \Aimeos\MShop\Customer\Item\Standard( $this->address ) );
116
+    }
117 117
 
118 118
 
119
-	public function testSaveItemUpdate()
120
-	{
121
-		$service = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
122
-		$user = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\User' )->getMock();
123
-		$struct = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\UserUpdateStruct' )->getMock();
124
-		$dbm = $this->getMockBuilder( 'Aimeos\MW\DB\Manager\Iface' )->getMock();
125
-		$conn = $this->getMockBuilder( 'Aimeos\MW\DB\Connection\Iface' )->getMock();
126
-		$stmt = $this->getMockBuilder( 'Aimeos\MW\DB\Statement\Iface' )->getMock();
127
-		$result = $this->getMockBuilder( 'Aimeos\MW\DB\Result\Iface' )->getMock();
119
+    public function testSaveItemUpdate()
120
+    {
121
+        $service = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
122
+        $user = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\User' )->getMock();
123
+        $struct = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\UserUpdateStruct' )->getMock();
124
+        $dbm = $this->getMockBuilder( 'Aimeos\MW\DB\Manager\Iface' )->getMock();
125
+        $conn = $this->getMockBuilder( 'Aimeos\MW\DB\Connection\Iface' )->getMock();
126
+        $stmt = $this->getMockBuilder( 'Aimeos\MW\DB\Statement\Iface' )->getMock();
127
+        $result = $this->getMockBuilder( 'Aimeos\MW\DB\Result\Iface' )->getMock();
128 128
 
129
-		$service->expects( $this->once() )->method( 'updateUser' );
130
-		$service->expects( $this->once() )->method( 'loadUser' )->will( $this->returnValue( $user ) );
131
-		$service->expects( $this->once() )->method( 'newUserUpdateStruct' )->will( $this->returnValue( $struct ) );
132
-		$dbm->expects( $this->once() )->method( 'acquire' )->will( $this->returnValue( $conn ) );
133
-		$conn->expects( $this->once() )->method( 'create' )->will( $this->returnValue( $stmt ) );
134
-		$stmt->expects( $this->once() )->method( 'execute' )->will( $this->returnValue( $result ) );
135
-		$result->expects( $this->once() )->method( 'finish' );
136
-		$dbm->expects( $this->once() )->method( 'release' );
129
+        $service->expects( $this->once() )->method( 'updateUser' );
130
+        $service->expects( $this->once() )->method( 'loadUser' )->will( $this->returnValue( $user ) );
131
+        $service->expects( $this->once() )->method( 'newUserUpdateStruct' )->will( $this->returnValue( $struct ) );
132
+        $dbm->expects( $this->once() )->method( 'acquire' )->will( $this->returnValue( $conn ) );
133
+        $conn->expects( $this->once() )->method( 'create' )->will( $this->returnValue( $stmt ) );
134
+        $stmt->expects( $this->once() )->method( 'execute' )->will( $this->returnValue( $result ) );
135
+        $result->expects( $this->once() )->method( 'finish' );
136
+        $dbm->expects( $this->once() )->method( 'release' );
137 137
 
138 138
 
139
-		$item = new \Aimeos\MShop\Customer\Item\Standard( $this->address, array( 'customer.id' => 1 ) );
140
-		$item->setStatus( 1 );
139
+        $item = new \Aimeos\MShop\Customer\Item\Standard( $this->address, array( 'customer.id' => 1 ) );
140
+        $item->setStatus( 1 );
141 141
 
142
-		$this->context->setDatabaseManager( $dbm );
143
-		$this->context->setEzUserService( $service );
144
-		$this->object->saveItem( $item );
145
-	}
142
+        $this->context->setDatabaseManager( $dbm );
143
+        $this->context->setEzUserService( $service );
144
+        $this->object->saveItem( $item );
145
+    }
146 146
 
147 147
 
148
-	public function testSaveItemInvalidItem()
149
-	{
150
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
151
-		$this->object->saveItem( new \Aimeos\MShop\Common\Item\Lists\Standard( 'common.lists.' ) );
152
-	}
148
+    public function testSaveItemInvalidItem()
149
+    {
150
+        $this->setExpectedException( '\Aimeos\MShop\Exception' );
151
+        $this->object->saveItem( new \Aimeos\MShop\Common\Item\Lists\Standard( 'common.lists.' ) );
152
+    }
153 153
 
154 154
 
155
-	public function testSaveItemNotModified()
156
-	{
157
-		$item = new \Aimeos\MShop\Customer\Item\Standard( $this->address, array( 'customer.id' => 1 ) );
158
-		$this->object->saveItem( $item );
159
-	}
155
+    public function testSaveItemNotModified()
156
+    {
157
+        $item = new \Aimeos\MShop\Customer\Item\Standard( $this->address, array( 'customer.id' => 1 ) );
158
+        $this->object->saveItem( $item );
159
+    }
160 160
 
161 161
 
162
-	public function testSaveItemInvalidContext()
163
-	{
164
-		$context = new \Aimeos\MShop\Context\Item\Standard();
165
-		$context->setConfig( $this->context->getConfig() );
162
+    public function testSaveItemInvalidContext()
163
+    {
164
+        $context = new \Aimeos\MShop\Context\Item\Standard();
165
+        $context->setConfig( $this->context->getConfig() );
166 166
 
167
-		$object = new \Aimeos\MShop\Customer\Manager\Ezpublish( $context );
167
+        $object = new \Aimeos\MShop\Customer\Manager\Ezpublish( $context );
168 168
 
169
-		$this->setExpectedException( '\Aimeos\MShop\Customer\Exception' );
170
-		$object->saveItem( new \Aimeos\MShop\Customer\Item\Standard( $this->address ) );
171
-	}
169
+        $this->setExpectedException( '\Aimeos\MShop\Customer\Exception' );
170
+        $object->saveItem( new \Aimeos\MShop\Customer\Item\Standard( $this->address ) );
171
+    }
172 172
 
173 173
 
174
-	public function testSearchItems()
175
-	{
176
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Ezpublish' )
177
-			->setConstructorArgs( array( $this->context ) )
178
-			->setMethods( array( 'searchItemsBase' ) )
179
-			->getMock();
174
+    public function testSearchItems()
175
+    {
176
+        $mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Ezpublish' )
177
+            ->setConstructorArgs( array( $this->context ) )
178
+            ->setMethods( array( 'searchItemsBase' ) )
179
+            ->getMock();
180 180
 
181
-		$result1 = $this->getMockBuilder( '\Aimeos\MW\DB\Result\Iface' )->getMock();
181
+        $result1 = $this->getMockBuilder( '\Aimeos\MW\DB\Result\Iface' )->getMock();
182 182
 
183
-		$mock->expects( $this->once() )->method( 'searchItemsBase' )->will( $this->returnValue( $result1 ) );
184
-		$result1->expects( $this->exactly( 2 ) )->method( 'fetch' )
185
-			->will( $this->onConsecutiveCalls( array( 'customer.id' => -1 ), false ) );
183
+        $mock->expects( $this->once() )->method( 'searchItemsBase' )->will( $this->returnValue( $result1 ) );
184
+        $result1->expects( $this->exactly( 2 ) )->method( 'fetch' )
185
+            ->will( $this->onConsecutiveCalls( array( 'customer.id' => -1 ), false ) );
186 186
 
187 187
 
188
-		$dbm = $this->getMockBuilder( 'Aimeos\MW\DB\Manager\Iface' )->getMock();
189
-		$conn = $this->getMockBuilder( 'Aimeos\MW\DB\Connection\Iface' )->getMock();
190
-		$stmt = $this->getMockBuilder( 'Aimeos\MW\DB\Statement\Iface' )->getMock();
191
-		$result2 = $this->getMockBuilder( '\Aimeos\MW\DB\Result\Iface' )->getMock();
188
+        $dbm = $this->getMockBuilder( 'Aimeos\MW\DB\Manager\Iface' )->getMock();
189
+        $conn = $this->getMockBuilder( 'Aimeos\MW\DB\Connection\Iface' )->getMock();
190
+        $stmt = $this->getMockBuilder( 'Aimeos\MW\DB\Statement\Iface' )->getMock();
191
+        $result2 = $this->getMockBuilder( '\Aimeos\MW\DB\Result\Iface' )->getMock();
192 192
 
193
-		$dbm->expects( $this->any() )->method( 'acquire' )->will( $this->returnValue( $conn ) );
194
-		$conn->expects( $this->once() )->method( 'create' )->will( $this->returnValue( $stmt ) );
195
-		$stmt->expects( $this->once() )->method( 'execute' )->will( $this->returnValue( $result2 ) );
196
-		$result2->expects( $this->exactly( 2 ) )->method( 'fetch' )
197
-			->will( $this->onConsecutiveCalls( array( 'contentobject_id' => -1, 'role_id' => -2 ), false ) );
193
+        $dbm->expects( $this->any() )->method( 'acquire' )->will( $this->returnValue( $conn ) );
194
+        $conn->expects( $this->once() )->method( 'create' )->will( $this->returnValue( $stmt ) );
195
+        $stmt->expects( $this->once() )->method( 'execute' )->will( $this->returnValue( $result2 ) );
196
+        $result2->expects( $this->exactly( 2 ) )->method( 'fetch' )
197
+            ->will( $this->onConsecutiveCalls( array( 'contentobject_id' => -1, 'role_id' => -2 ), false ) );
198 198
 
199
-		$dbm->expects( $this->any() )->method( 'release' );
199
+        $dbm->expects( $this->any() )->method( 'release' );
200 200
 
201 201
 
202
-		$this->context->setDatabaseManager( $dbm );
203
-		$list = $mock->searchItems( $mock->createSearch() );
202
+        $this->context->setDatabaseManager( $dbm );
203
+        $list = $mock->searchItems( $mock->createSearch() );
204 204
 
205
-		$this->assertEquals( 1, count( $list ) );
206
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $list[-1] );
207
-	}
205
+        $this->assertEquals( 1, count( $list ) );
206
+        $this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $list[-1] );
207
+    }
208 208
 
209 209
 
210
-	public function testSearchItemsException()
211
-	{
212
-		$object = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Ezpublish' )
213
-			->setConstructorArgs( array( $this->context ) )
214
-			->setMethods( array( 'searchItemsBase' ) )
215
-			->getMock();
210
+    public function testSearchItemsException()
211
+    {
212
+        $object = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Ezpublish' )
213
+            ->setConstructorArgs( array( $this->context ) )
214
+            ->setMethods( array( 'searchItemsBase' ) )
215
+            ->getMock();
216 216
 
217
-		$object->expects( $this->once() )->method( 'searchItemsBase' )
218
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
217
+        $object->expects( $this->once() )->method( 'searchItemsBase' )
218
+            ->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
219 219
 
220
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
221
-		$object->searchItems( $object->createSearch() );
222
-	}
220
+        $this->setExpectedException( '\Aimeos\MShop\Exception' );
221
+        $object->searchItems( $object->createSearch() );
222
+    }
223 223
 }
Please login to merge, or discard this patch.
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -18,206 +18,206 @@
 block discarded – undo
18 18
 
19 19
 	protected function setUp()
20 20
 	{
21
-		if( !interface_exists( 'eZ\Publish\API\Repository\UserService' ) ) {
22
-			$this->markTestSkipped( 'Install ezsystems/ezpublish-api first' );
21
+		if (!interface_exists('eZ\Publish\API\Repository\UserService')) {
22
+			$this->markTestSkipped('Install ezsystems/ezpublish-api first');
23 23
 		}
24 24
 
25 25
 		$this->context = \TestHelper::getContext();
26 26
 
27
-		$this->object = new \Aimeos\MShop\Customer\Manager\Ezpublish( $this->context );
28
-		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.' );
27
+		$this->object = new \Aimeos\MShop\Customer\Manager\Ezpublish($this->context);
28
+		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard('common.address.');
29 29
 	}
30 30
 
31 31
 
32 32
 	protected function tearDown()
33 33
 	{
34
-		unset( $this->object, $this->context, $this->address );
34
+		unset($this->object, $this->context, $this->address);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCleanup()
39 39
 	{
40
-		$this->object->cleanup( array( -1 ) );
40
+		$this->object->cleanup(array( -1 ));
41 41
 	}
42 42
 
43 43
 
44 44
 	public function testCreateItem()
45 45
 	{
46
-		$this->assertInstanceOf( 'Aimeos\MShop\Customer\Item\Iface', $this->object->createItem() );
46
+		$this->assertInstanceOf('Aimeos\MShop\Customer\Item\Iface', $this->object->createItem());
47 47
 	}
48 48
 
49 49
 
50 50
 	public function testDeleteItems()
51 51
 	{
52
-		$mock = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
53
-		$user = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\User' )->getMock();
52
+		$mock = $this->getMockBuilder('eZ\Publish\API\Repository\UserService')->getMock();
53
+		$user = $this->getMockBuilder('eZ\Publish\API\Repository\Values\User\User')->getMock();
54 54
 
55
-		$mock->expects( $this->once() )->method( 'loadUser' )->will( $this->returnValue( $user ) );
56
-		$mock->expects( $this->once() )->method( 'deleteUser' );
55
+		$mock->expects($this->once())->method('loadUser')->will($this->returnValue($user));
56
+		$mock->expects($this->once())->method('deleteUser');
57 57
 
58
-		$this->context->setEzUserService( $mock );
59
-		$this->object->deleteItems( array( -1 ) );
58
+		$this->context->setEzUserService($mock);
59
+		$this->object->deleteItems(array( -1 ));
60 60
 	}
61 61
 
62 62
 
63 63
 	public function testGetSearchAttributes()
64 64
 	{
65 65
 		$attributes = $this->object->getSearchAttributes();
66
-		$this->assertGreaterThan( 0, count( $attributes ) );
66
+		$this->assertGreaterThan(0, count($attributes));
67 67
 
68
-		foreach( $attributes as $attribute ) {
69
-			$this->assertInstanceOf( '\Aimeos\MW\Criteria\Attribute\Iface', $attribute );
68
+		foreach ($attributes as $attribute) {
69
+			$this->assertInstanceOf('\Aimeos\MW\Criteria\Attribute\Iface', $attribute);
70 70
 		}
71 71
 	}
72 72
 
73 73
 
74 74
 	public function testGetSubManager()
75 75
 	{
76
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->getSubManager( 'address' ) );
77
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->getSubManager( 'address', 'Standard' ) );
76
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Manager\Iface', $this->object->getSubManager('address'));
77
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Manager\Iface', $this->object->getSubManager('address', 'Standard'));
78 78
 
79
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
80
-		$this->object->getSubManager( 'unknown' );
79
+		$this->setExpectedException('\Aimeos\MShop\Exception');
80
+		$this->object->getSubManager('unknown');
81 81
 	}
82 82
 
83 83
 
84 84
 	public function testGetSubManagerInvalidName()
85 85
 	{
86
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
87
-		$this->object->getSubManager( 'address', 'unknown' );
86
+		$this->setExpectedException('\Aimeos\MShop\Exception');
87
+		$this->object->getSubManager('address', 'unknown');
88 88
 	}
89 89
 
90 90
 
91 91
 	public function testSaveItemInsert()
92 92
 	{
93
-		$service = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
94
-		$struct = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\UserCreateStruct' )->getMock();
95
-		$user = $this->getMockBuilder( '\eZ\Publish\API\Repository\Values\User\User' )
96
-			->setMethods( array( 'getUserId', 'getVersionInfo', 'getFieldValue', 'getFields', 'getFieldsByLanguage' ) )
93
+		$service = $this->getMockBuilder('eZ\Publish\API\Repository\UserService')->getMock();
94
+		$struct = $this->getMockBuilder('eZ\Publish\API\Repository\Values\User\UserCreateStruct')->getMock();
95
+		$user = $this->getMockBuilder('\eZ\Publish\API\Repository\Values\User\User')
96
+			->setMethods(array('getUserId', 'getVersionInfo', 'getFieldValue', 'getFields', 'getFieldsByLanguage'))
97 97
 			->getMock();
98 98
 
99
-		$dbm = $this->getMockBuilder( 'Aimeos\MW\DB\Manager\Iface' )->getMock();
100
-		$conn = $this->getMockBuilder( 'Aimeos\MW\DB\Connection\Iface' )->getMock();
101
-		$stmt = $this->getMockBuilder( 'Aimeos\MW\DB\Statement\Iface' )->getMock();
102
-		$result = $this->getMockBuilder( 'Aimeos\MW\DB\Result\Iface' )->getMock();
99
+		$dbm = $this->getMockBuilder('Aimeos\MW\DB\Manager\Iface')->getMock();
100
+		$conn = $this->getMockBuilder('Aimeos\MW\DB\Connection\Iface')->getMock();
101
+		$stmt = $this->getMockBuilder('Aimeos\MW\DB\Statement\Iface')->getMock();
102
+		$result = $this->getMockBuilder('Aimeos\MW\DB\Result\Iface')->getMock();
103 103
 
104
-		$service->expects( $this->once() )->method( 'newUserCreateStruct' )->will( $this->returnValue( $struct ) );
105
-		$service->expects( $this->once() )->method( 'createUser' )->will( $this->returnValue( $user ) );
106
-		$user->expects( $this->once() )->method( 'getUserId' )->will( $this->returnValue( 1 ) );
107
-		$dbm->expects( $this->once() )->method( 'acquire' )->will( $this->returnValue( $conn ) );
108
-		$conn->expects( $this->once() )->method( 'create' )->will( $this->returnValue( $stmt ) );
109
-		$stmt->expects( $this->once() )->method( 'execute' )->will( $this->returnValue( $result ) );
104
+		$service->expects($this->once())->method('newUserCreateStruct')->will($this->returnValue($struct));
105
+		$service->expects($this->once())->method('createUser')->will($this->returnValue($user));
106
+		$user->expects($this->once())->method('getUserId')->will($this->returnValue(1));
107
+		$dbm->expects($this->once())->method('acquire')->will($this->returnValue($conn));
108
+		$conn->expects($this->once())->method('create')->will($this->returnValue($stmt));
109
+		$stmt->expects($this->once())->method('execute')->will($this->returnValue($result));
110 110
 
111 111
 
112
-		$this->context->setDatabaseManager( $dbm );
113
-		$this->context->setEzUserService( $service );
112
+		$this->context->setDatabaseManager($dbm);
113
+		$this->context->setEzUserService($service);
114 114
 
115
-		$this->object->saveItem( new \Aimeos\MShop\Customer\Item\Standard( $this->address ) );
115
+		$this->object->saveItem(new \Aimeos\MShop\Customer\Item\Standard($this->address));
116 116
 	}
117 117
 
118 118
 
119 119
 	public function testSaveItemUpdate()
120 120
 	{
121
-		$service = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
122
-		$user = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\User' )->getMock();
123
-		$struct = $this->getMockBuilder( 'eZ\Publish\API\Repository\Values\User\UserUpdateStruct' )->getMock();
124
-		$dbm = $this->getMockBuilder( 'Aimeos\MW\DB\Manager\Iface' )->getMock();
125
-		$conn = $this->getMockBuilder( 'Aimeos\MW\DB\Connection\Iface' )->getMock();
126
-		$stmt = $this->getMockBuilder( 'Aimeos\MW\DB\Statement\Iface' )->getMock();
127
-		$result = $this->getMockBuilder( 'Aimeos\MW\DB\Result\Iface' )->getMock();
128
-
129
-		$service->expects( $this->once() )->method( 'updateUser' );
130
-		$service->expects( $this->once() )->method( 'loadUser' )->will( $this->returnValue( $user ) );
131
-		$service->expects( $this->once() )->method( 'newUserUpdateStruct' )->will( $this->returnValue( $struct ) );
132
-		$dbm->expects( $this->once() )->method( 'acquire' )->will( $this->returnValue( $conn ) );
133
-		$conn->expects( $this->once() )->method( 'create' )->will( $this->returnValue( $stmt ) );
134
-		$stmt->expects( $this->once() )->method( 'execute' )->will( $this->returnValue( $result ) );
135
-		$result->expects( $this->once() )->method( 'finish' );
136
-		$dbm->expects( $this->once() )->method( 'release' );
137
-
138
-
139
-		$item = new \Aimeos\MShop\Customer\Item\Standard( $this->address, array( 'customer.id' => 1 ) );
140
-		$item->setStatus( 1 );
141
-
142
-		$this->context->setDatabaseManager( $dbm );
143
-		$this->context->setEzUserService( $service );
144
-		$this->object->saveItem( $item );
121
+		$service = $this->getMockBuilder('eZ\Publish\API\Repository\UserService')->getMock();
122
+		$user = $this->getMockBuilder('eZ\Publish\API\Repository\Values\User\User')->getMock();
123
+		$struct = $this->getMockBuilder('eZ\Publish\API\Repository\Values\User\UserUpdateStruct')->getMock();
124
+		$dbm = $this->getMockBuilder('Aimeos\MW\DB\Manager\Iface')->getMock();
125
+		$conn = $this->getMockBuilder('Aimeos\MW\DB\Connection\Iface')->getMock();
126
+		$stmt = $this->getMockBuilder('Aimeos\MW\DB\Statement\Iface')->getMock();
127
+		$result = $this->getMockBuilder('Aimeos\MW\DB\Result\Iface')->getMock();
128
+
129
+		$service->expects($this->once())->method('updateUser');
130
+		$service->expects($this->once())->method('loadUser')->will($this->returnValue($user));
131
+		$service->expects($this->once())->method('newUserUpdateStruct')->will($this->returnValue($struct));
132
+		$dbm->expects($this->once())->method('acquire')->will($this->returnValue($conn));
133
+		$conn->expects($this->once())->method('create')->will($this->returnValue($stmt));
134
+		$stmt->expects($this->once())->method('execute')->will($this->returnValue($result));
135
+		$result->expects($this->once())->method('finish');
136
+		$dbm->expects($this->once())->method('release');
137
+
138
+
139
+		$item = new \Aimeos\MShop\Customer\Item\Standard($this->address, array('customer.id' => 1));
140
+		$item->setStatus(1);
141
+
142
+		$this->context->setDatabaseManager($dbm);
143
+		$this->context->setEzUserService($service);
144
+		$this->object->saveItem($item);
145 145
 	}
146 146
 
147 147
 
148 148
 	public function testSaveItemInvalidItem()
149 149
 	{
150
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
151
-		$this->object->saveItem( new \Aimeos\MShop\Common\Item\Lists\Standard( 'common.lists.' ) );
150
+		$this->setExpectedException('\Aimeos\MShop\Exception');
151
+		$this->object->saveItem(new \Aimeos\MShop\Common\Item\Lists\Standard('common.lists.'));
152 152
 	}
153 153
 
154 154
 
155 155
 	public function testSaveItemNotModified()
156 156
 	{
157
-		$item = new \Aimeos\MShop\Customer\Item\Standard( $this->address, array( 'customer.id' => 1 ) );
158
-		$this->object->saveItem( $item );
157
+		$item = new \Aimeos\MShop\Customer\Item\Standard($this->address, array('customer.id' => 1));
158
+		$this->object->saveItem($item);
159 159
 	}
160 160
 
161 161
 
162 162
 	public function testSaveItemInvalidContext()
163 163
 	{
164 164
 		$context = new \Aimeos\MShop\Context\Item\Standard();
165
-		$context->setConfig( $this->context->getConfig() );
165
+		$context->setConfig($this->context->getConfig());
166 166
 
167
-		$object = new \Aimeos\MShop\Customer\Manager\Ezpublish( $context );
167
+		$object = new \Aimeos\MShop\Customer\Manager\Ezpublish($context);
168 168
 
169
-		$this->setExpectedException( '\Aimeos\MShop\Customer\Exception' );
170
-		$object->saveItem( new \Aimeos\MShop\Customer\Item\Standard( $this->address ) );
169
+		$this->setExpectedException('\Aimeos\MShop\Customer\Exception');
170
+		$object->saveItem(new \Aimeos\MShop\Customer\Item\Standard($this->address));
171 171
 	}
172 172
 
173 173
 
174 174
 	public function testSearchItems()
175 175
 	{
176
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Ezpublish' )
177
-			->setConstructorArgs( array( $this->context ) )
178
-			->setMethods( array( 'searchItemsBase' ) )
176
+		$mock = $this->getMockBuilder('\Aimeos\MShop\Customer\Manager\Ezpublish')
177
+			->setConstructorArgs(array($this->context))
178
+			->setMethods(array('searchItemsBase'))
179 179
 			->getMock();
180 180
 
181
-		$result1 = $this->getMockBuilder( '\Aimeos\MW\DB\Result\Iface' )->getMock();
181
+		$result1 = $this->getMockBuilder('\Aimeos\MW\DB\Result\Iface')->getMock();
182 182
 
183
-		$mock->expects( $this->once() )->method( 'searchItemsBase' )->will( $this->returnValue( $result1 ) );
184
-		$result1->expects( $this->exactly( 2 ) )->method( 'fetch' )
185
-			->will( $this->onConsecutiveCalls( array( 'customer.id' => -1 ), false ) );
183
+		$mock->expects($this->once())->method('searchItemsBase')->will($this->returnValue($result1));
184
+		$result1->expects($this->exactly(2))->method('fetch')
185
+			->will($this->onConsecutiveCalls(array('customer.id' => -1), false));
186 186
 
187 187
 
188
-		$dbm = $this->getMockBuilder( 'Aimeos\MW\DB\Manager\Iface' )->getMock();
189
-		$conn = $this->getMockBuilder( 'Aimeos\MW\DB\Connection\Iface' )->getMock();
190
-		$stmt = $this->getMockBuilder( 'Aimeos\MW\DB\Statement\Iface' )->getMock();
191
-		$result2 = $this->getMockBuilder( '\Aimeos\MW\DB\Result\Iface' )->getMock();
188
+		$dbm = $this->getMockBuilder('Aimeos\MW\DB\Manager\Iface')->getMock();
189
+		$conn = $this->getMockBuilder('Aimeos\MW\DB\Connection\Iface')->getMock();
190
+		$stmt = $this->getMockBuilder('Aimeos\MW\DB\Statement\Iface')->getMock();
191
+		$result2 = $this->getMockBuilder('\Aimeos\MW\DB\Result\Iface')->getMock();
192 192
 
193
-		$dbm->expects( $this->any() )->method( 'acquire' )->will( $this->returnValue( $conn ) );
194
-		$conn->expects( $this->once() )->method( 'create' )->will( $this->returnValue( $stmt ) );
195
-		$stmt->expects( $this->once() )->method( 'execute' )->will( $this->returnValue( $result2 ) );
196
-		$result2->expects( $this->exactly( 2 ) )->method( 'fetch' )
197
-			->will( $this->onConsecutiveCalls( array( 'contentobject_id' => -1, 'role_id' => -2 ), false ) );
193
+		$dbm->expects($this->any())->method('acquire')->will($this->returnValue($conn));
194
+		$conn->expects($this->once())->method('create')->will($this->returnValue($stmt));
195
+		$stmt->expects($this->once())->method('execute')->will($this->returnValue($result2));
196
+		$result2->expects($this->exactly(2))->method('fetch')
197
+			->will($this->onConsecutiveCalls(array('contentobject_id' => -1, 'role_id' => -2), false));
198 198
 
199
-		$dbm->expects( $this->any() )->method( 'release' );
199
+		$dbm->expects($this->any())->method('release');
200 200
 
201 201
 
202
-		$this->context->setDatabaseManager( $dbm );
203
-		$list = $mock->searchItems( $mock->createSearch() );
202
+		$this->context->setDatabaseManager($dbm);
203
+		$list = $mock->searchItems($mock->createSearch());
204 204
 
205
-		$this->assertEquals( 1, count( $list ) );
206
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $list[-1] );
205
+		$this->assertEquals(1, count($list));
206
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $list[-1]);
207 207
 	}
208 208
 
209 209
 
210 210
 	public function testSearchItemsException()
211 211
 	{
212
-		$object = $this->getMockBuilder( '\Aimeos\MShop\Customer\Manager\Ezpublish' )
213
-			->setConstructorArgs( array( $this->context ) )
214
-			->setMethods( array( 'searchItemsBase' ) )
212
+		$object = $this->getMockBuilder('\Aimeos\MShop\Customer\Manager\Ezpublish')
213
+			->setConstructorArgs(array($this->context))
214
+			->setMethods(array('searchItemsBase'))
215 215
 			->getMock();
216 216
 
217
-		$object->expects( $this->once() )->method( 'searchItemsBase' )
218
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
217
+		$object->expects($this->once())->method('searchItemsBase')
218
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
219 219
 
220
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
221
-		$object->searchItems( $object->createSearch() );
220
+		$this->setExpectedException('\Aimeos\MShop\Exception');
221
+		$object->searchItems($object->createSearch());
222 222
 	}
223 223
 }
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Context/Item/EzpublishTest.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -11,38 +11,38 @@
 block discarded – undo
11 11
 
12 12
 class EzpublishTest extends \PHPUnit_Framework_TestCase
13 13
 {
14
-	private $object;
14
+    private $object;
15 15
 
16 16
 
17
-	protected function setUp()
18
-	{
19
-		if( !interface_exists( 'eZ\Publish\API\Repository\UserService' ) ) {
20
-			$this->markTestSkipped( 'Install ezsystems/ezpublish-api first' );
21
-		}
17
+    protected function setUp()
18
+    {
19
+        if( !interface_exists( 'eZ\Publish\API\Repository\UserService' ) ) {
20
+            $this->markTestSkipped( 'Install ezsystems/ezpublish-api first' );
21
+        }
22 22
 
23
-		$this->mock = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
24
-		$this->object = new \Aimeos\MShop\Context\Item\Ezpublish();
25
-	}
23
+        $this->mock = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
24
+        $this->object = new \Aimeos\MShop\Context\Item\Ezpublish();
25
+    }
26 26
 
27 27
 
28
-	protected function tearDown()
29
-	{
30
-		unset( $this->object, $this->mock );
31
-	}
28
+    protected function tearDown()
29
+    {
30
+        unset( $this->object, $this->mock );
31
+    }
32 32
 
33 33
 
34
-	public function testGetEzUserService()
35
-	{
36
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
37
-		$this->object->getEzUserService();
38
-	}
34
+    public function testGetEzUserService()
35
+    {
36
+        $this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
37
+        $this->object->getEzUserService();
38
+    }
39 39
 
40 40
 
41
-	public function testSetEzUserService()
42
-	{
43
-		$return = $this->object->setEzUserService( $this->mock );
41
+    public function testSetEzUserService()
42
+    {
43
+        $return = $this->object->setEzUserService( $this->mock );
44 44
 
45
-		$this->assertSame( $this->mock, $this->object->getEzUserService() );
46
-		$this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $return );
47
-	}
45
+        $this->assertSame( $this->mock, $this->object->getEzUserService() );
46
+        $this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $return );
47
+    }
48 48
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,33 +16,33 @@
 block discarded – undo
16 16
 
17 17
 	protected function setUp()
18 18
 	{
19
-		if( !interface_exists( 'eZ\Publish\API\Repository\UserService' ) ) {
20
-			$this->markTestSkipped( 'Install ezsystems/ezpublish-api first' );
19
+		if (!interface_exists('eZ\Publish\API\Repository\UserService')) {
20
+			$this->markTestSkipped('Install ezsystems/ezpublish-api first');
21 21
 		}
22 22
 
23
-		$this->mock = $this->getMockBuilder( 'eZ\Publish\API\Repository\UserService' )->getMock();
23
+		$this->mock = $this->getMockBuilder('eZ\Publish\API\Repository\UserService')->getMock();
24 24
 		$this->object = new \Aimeos\MShop\Context\Item\Ezpublish();
25 25
 	}
26 26
 
27 27
 
28 28
 	protected function tearDown()
29 29
 	{
30
-		unset( $this->object, $this->mock );
30
+		unset($this->object, $this->mock);
31 31
 	}
32 32
 
33 33
 
34 34
 	public function testGetEzUserService()
35 35
 	{
36
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
36
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
37 37
 		$this->object->getEzUserService();
38 38
 	}
39 39
 
40 40
 
41 41
 	public function testSetEzUserService()
42 42
 	{
43
-		$return = $this->object->setEzUserService( $this->mock );
43
+		$return = $this->object->setEzUserService($this->mock);
44 44
 
45
-		$this->assertSame( $this->mock, $this->object->getEzUserService() );
46
-		$this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $return );
45
+		$this->assertSame($this->mock, $this->object->getEzUserService());
46
+		$this->assertInstanceOf('\Aimeos\MShop\Context\Item\Iface', $return);
47 47
 	}
48 48
 }
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Item/Ezpublish.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -19,34 +19,34 @@
 block discarded – undo
19 19
  */
20 20
 class Ezpublish extends Standard implements Iface
21 21
 {
22
-	private $password = null;
23
-
24
-
25
-	/**
26
-	 * Returns the password of the customer item
27
-	 *
28
-	 * @return string
29
-	 */
30
-	public function getPassword()
31
-	{
32
-		return $this->password;
33
-	}
34
-
35
-
36
-	/**
37
-	 * Sets the password of the customer item
38
-	 *
39
-	 * @param string $value password of the customer item
40
-	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item for chaining method calls
41
-	 */
42
-	public function setPassword( $value )
43
-	{
44
-		if( $value !== '' && $value != $this->getPassword() )
45
-		{
46
-			$this->password = (string) $value;
47
-			$this->setModified();
48
-		}
49
-
50
-		return $this;
51
-	}
22
+    private $password = null;
23
+
24
+
25
+    /**
26
+     * Returns the password of the customer item
27
+     *
28
+     * @return string
29
+     */
30
+    public function getPassword()
31
+    {
32
+        return $this->password;
33
+    }
34
+
35
+
36
+    /**
37
+     * Sets the password of the customer item
38
+     *
39
+     * @param string $value password of the customer item
40
+     * @return \Aimeos\MShop\Customer\Item\Iface Customer item for chaining method calls
41
+     */
42
+    public function setPassword( $value )
43
+    {
44
+        if( $value !== '' && $value != $this->getPassword() )
45
+        {
46
+            $this->password = (string) $value;
47
+            $this->setModified();
48
+        }
49
+
50
+        return $this;
51
+    }
52 52
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@
 block discarded – undo
39 39
 	 * @param string $value password of the customer item
40 40
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item for chaining method calls
41 41
 	 */
42
-	public function setPassword( $value )
42
+	public function setPassword($value)
43 43
 	{
44
-		if( $value !== '' && $value != $this->getPassword() )
44
+		if ($value !== '' && $value != $this->getPassword())
45 45
 		{
46 46
 			$this->password = (string) $value;
47 47
 			$this->setModified();
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Lists/Ezpublish.php 2 patches
Indentation   +193 added lines, -193 removed lines patch added patch discarded remove patch
@@ -18,198 +18,198 @@
 block discarded – undo
18 18
  * @subpackage Customer
19 19
  */
20 20
 class Ezpublish
21
-	extends \Aimeos\MShop\Customer\Manager\Lists\Standard
22
-	implements \Aimeos\MShop\Customer\Manager\Lists\Iface, \Aimeos\MShop\Common\Manager\Lists\Iface
21
+    extends \Aimeos\MShop\Customer\Manager\Lists\Standard
22
+    implements \Aimeos\MShop\Customer\Manager\Lists\Iface, \Aimeos\MShop\Common\Manager\Lists\Iface
23 23
 {
24
-	private $searchConfig = array(
25
-		'customer.lists.id'=> array(
26
-			'code'=>'customer.lists.id',
27
-			'internalcode'=>'ezuli."id"',
28
-			'internaldeps' => array( 'LEFT JOIN "ezuser_list" AS ezuli ON ( ezu."id" = ezuli."parentid" )' ),
29
-			'label'=>'Customer list ID',
30
-			'type'=> 'integer',
31
-			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_INT,
32
-			'public' => false,
33
-		),
34
-		'customer.lists.siteid'=> array(
35
-			'code'=>'customer.lists.siteid',
36
-			'internalcode'=>'ezuli."siteid"',
37
-			'label'=>'Customer list site ID',
38
-			'type'=> 'integer',
39
-			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_INT,
40
-			'public' => false,
41
-		),
42
-		'customer.lists.parentid'=> array(
43
-			'code'=>'customer.lists.parentid',
44
-			'internalcode'=>'ezuli."parentid"',
45
-			'label'=>'Customer list parent ID',
46
-			'type'=> 'integer',
47
-			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_INT,
48
-			'public' => false,
49
-		),
50
-		'customer.lists.domain'=> array(
51
-			'code'=>'customer.lists.domain',
52
-			'internalcode'=>'ezuli."domain"',
53
-			'label'=>'Customer list domain',
54
-			'type'=> 'string',
55
-			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
56
-		),
57
-		'customer.lists.typeid' => array(
58
-			'code'=>'customer.lists.typeid',
59
-			'internalcode'=>'ezuli."typeid"',
60
-			'label'=>'Customer list type ID',
61
-			'type'=> 'integer',
62
-			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
63
-			'public' => false,
64
-		),
65
-		'customer.lists.refid'=> array(
66
-			'code'=>'customer.lists.refid',
67
-			'internalcode'=>'ezuli."refid"',
68
-			'label'=>'Customer list reference ID',
69
-			'type'=> 'string',
70
-			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
71
-		),
72
-		'customer.lists.datestart' => array(
73
-			'code'=>'customer.lists.datestart',
74
-			'internalcode'=>'ezuli."start"',
75
-			'label'=>'Customer list start date/time',
76
-			'type'=> 'datetime',
77
-			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
78
-		),
79
-		'customer.lists.dateend' => array(
80
-			'code'=>'customer.lists.dateend',
81
-			'internalcode'=>'ezuli."end"',
82
-			'label'=>'Customer list end date/time',
83
-			'type'=> 'datetime',
84
-			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
85
-		),
86
-		'customer.lists.config' => array(
87
-			'code'=>'customer.lists.config',
88
-			'internalcode'=>'ezuli."config"',
89
-			'label'=>'Customer list position',
90
-			'type'=> 'string',
91
-			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
92
-		),
93
-		'customer.lists.position' => array(
94
-			'code'=>'customer.lists.position',
95
-			'internalcode'=>'ezuli."pos"',
96
-			'label'=>'Customer list position',
97
-			'type'=> 'integer',
98
-			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
99
-		),
100
-		'customer.lists.status' => array(
101
-			'code'=>'customer.lists.status',
102
-			'internalcode'=>'ezuli."status"',
103
-			'label'=>'Customer list status',
104
-			'type'=> 'integer',
105
-			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
106
-		),
107
-		'customer.lists.ctime'=> array(
108
-			'code'=>'customer.lists.ctime',
109
-			'internalcode'=>'ezuli."ctime"',
110
-			'label'=>'Customer list create date/time',
111
-			'type'=> 'datetime',
112
-			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
113
-		),
114
-		'customer.lists.mtime'=> array(
115
-			'code'=>'customer.lists.mtime',
116
-			'internalcode'=>'ezuli."mtime"',
117
-			'label'=>'Customer list modification date/time',
118
-			'type'=> 'datetime',
119
-			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
120
-		),
121
-		'customer.lists.editor'=> array(
122
-			'code'=>'customer.lists.editor',
123
-			'internalcode'=>'ezuli."editor"',
124
-			'label'=>'Customer list editor',
125
-			'type'=> 'string',
126
-			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
127
-		),
128
-	);
129
-
130
-
131
-	/**
132
-	 * Removes old entries from the storage.
133
-	 *
134
-	 * @param array $siteids List of IDs for sites whose entries should be deleted
135
-	 */
136
-	public function cleanup( array $siteids )
137
-	{
138
-		$path = 'mshop/customer/manager/lists/submanagers';
139
-		foreach( $this->getContext()->getConfig()->get( $path, array( 'type' ) ) as $domain ) {
140
-			$this->getSubManager( $domain )->cleanup( $siteids );
141
-		}
142
-
143
-		$this->cleanupBase( $siteids, $this->getConfigPath() . 'delete' );
144
-	}
145
-
146
-
147
-	/**
148
-	 * Returns the list attributes that can be used for searching.
149
-	 *
150
-	 * @param boolean $withsub Return also attributes of sub-managers if true
151
-	 * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
152
-	 */
153
-	public function getSearchAttributes( $withsub = true )
154
-	{
155
-		$path = 'mshop/customer/manager/lists/submanagers';
156
-
157
-		return $this->getSearchAttributesBase( $this->getSearchConfig(), $path, array( 'type' ), $withsub );
158
-	}
159
-
160
-
161
-	/**
162
-	 * Returns a new manager for customer extensions
163
-	 *
164
-	 * @param string $manager Name of the sub manager type in lower case
165
-	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
166
-	 * @return mixed Manager for different extensions, e.g stock, tags, locations, etc.
167
-	 */
168
-	public function getSubManager( $manager, $name = null )
169
-	{
170
-		return $this->getSubManagerBase( 'customer', 'lists/' . $manager, ( $name === null ? 'Ezpublish' : $name ) );
171
-	}
172
-
173
-
174
-	/**
175
-	 * Updates or adds a common list item object.
176
-	 *
177
-	 * @param \Aimeos\MShop\Common\Item\Lists\Iface $item List item object which should be saved
178
-	 * @param boolean $fetch True if the new ID should be returned in the item
179
-	 */
180
-	public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true )
181
-	{
182
-		$iface = '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface';
183
-		if( !( $item instanceof $iface ) ) {
184
-			throw new \Aimeos\MShop\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
185
-		}
186
-
187
-		if( $item->getDomain() === 'customer/group' ) {
188
-			throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Adding groups to customers is not supported, please use the eZ Publish backend' ) );
189
-		}
190
-
191
-		parent::saveItem( $item, $fetch );
192
-	}
193
-
194
-
195
-	/**
196
-	 * Returns the config path for retrieving the configuration values.
197
-	 *
198
-	 * @return string Configuration path (mshop/customer/manager/lists/ezpublish/)
199
-	 */
200
-	protected function getConfigPath()
201
-	{
202
-		return 'mshop/customer/manager/lists/ezpublish/';
203
-	}
204
-
205
-
206
-	/**
207
-	 * Returns the search configuration for searching items.
208
-	 *
209
-	 * @return array Associative list of search keys and search definitions
210
-	 */
211
-	protected function getSearchConfig()
212
-	{
213
-		return $this->searchConfig;
214
-	}
24
+    private $searchConfig = array(
25
+        'customer.lists.id'=> array(
26
+            'code'=>'customer.lists.id',
27
+            'internalcode'=>'ezuli."id"',
28
+            'internaldeps' => array( 'LEFT JOIN "ezuser_list" AS ezuli ON ( ezu."id" = ezuli."parentid" )' ),
29
+            'label'=>'Customer list ID',
30
+            'type'=> 'integer',
31
+            'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_INT,
32
+            'public' => false,
33
+        ),
34
+        'customer.lists.siteid'=> array(
35
+            'code'=>'customer.lists.siteid',
36
+            'internalcode'=>'ezuli."siteid"',
37
+            'label'=>'Customer list site ID',
38
+            'type'=> 'integer',
39
+            'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_INT,
40
+            'public' => false,
41
+        ),
42
+        'customer.lists.parentid'=> array(
43
+            'code'=>'customer.lists.parentid',
44
+            'internalcode'=>'ezuli."parentid"',
45
+            'label'=>'Customer list parent ID',
46
+            'type'=> 'integer',
47
+            'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_INT,
48
+            'public' => false,
49
+        ),
50
+        'customer.lists.domain'=> array(
51
+            'code'=>'customer.lists.domain',
52
+            'internalcode'=>'ezuli."domain"',
53
+            'label'=>'Customer list domain',
54
+            'type'=> 'string',
55
+            'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
56
+        ),
57
+        'customer.lists.typeid' => array(
58
+            'code'=>'customer.lists.typeid',
59
+            'internalcode'=>'ezuli."typeid"',
60
+            'label'=>'Customer list type ID',
61
+            'type'=> 'integer',
62
+            'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
63
+            'public' => false,
64
+        ),
65
+        'customer.lists.refid'=> array(
66
+            'code'=>'customer.lists.refid',
67
+            'internalcode'=>'ezuli."refid"',
68
+            'label'=>'Customer list reference ID',
69
+            'type'=> 'string',
70
+            'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
71
+        ),
72
+        'customer.lists.datestart' => array(
73
+            'code'=>'customer.lists.datestart',
74
+            'internalcode'=>'ezuli."start"',
75
+            'label'=>'Customer list start date/time',
76
+            'type'=> 'datetime',
77
+            'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
78
+        ),
79
+        'customer.lists.dateend' => array(
80
+            'code'=>'customer.lists.dateend',
81
+            'internalcode'=>'ezuli."end"',
82
+            'label'=>'Customer list end date/time',
83
+            'type'=> 'datetime',
84
+            'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
85
+        ),
86
+        'customer.lists.config' => array(
87
+            'code'=>'customer.lists.config',
88
+            'internalcode'=>'ezuli."config"',
89
+            'label'=>'Customer list position',
90
+            'type'=> 'string',
91
+            'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
92
+        ),
93
+        'customer.lists.position' => array(
94
+            'code'=>'customer.lists.position',
95
+            'internalcode'=>'ezuli."pos"',
96
+            'label'=>'Customer list position',
97
+            'type'=> 'integer',
98
+            'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
99
+        ),
100
+        'customer.lists.status' => array(
101
+            'code'=>'customer.lists.status',
102
+            'internalcode'=>'ezuli."status"',
103
+            'label'=>'Customer list status',
104
+            'type'=> 'integer',
105
+            'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT,
106
+        ),
107
+        'customer.lists.ctime'=> array(
108
+            'code'=>'customer.lists.ctime',
109
+            'internalcode'=>'ezuli."ctime"',
110
+            'label'=>'Customer list create date/time',
111
+            'type'=> 'datetime',
112
+            'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
113
+        ),
114
+        'customer.lists.mtime'=> array(
115
+            'code'=>'customer.lists.mtime',
116
+            'internalcode'=>'ezuli."mtime"',
117
+            'label'=>'Customer list modification date/time',
118
+            'type'=> 'datetime',
119
+            'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
120
+        ),
121
+        'customer.lists.editor'=> array(
122
+            'code'=>'customer.lists.editor',
123
+            'internalcode'=>'ezuli."editor"',
124
+            'label'=>'Customer list editor',
125
+            'type'=> 'string',
126
+            'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR,
127
+        ),
128
+    );
129
+
130
+
131
+    /**
132
+     * Removes old entries from the storage.
133
+     *
134
+     * @param array $siteids List of IDs for sites whose entries should be deleted
135
+     */
136
+    public function cleanup( array $siteids )
137
+    {
138
+        $path = 'mshop/customer/manager/lists/submanagers';
139
+        foreach( $this->getContext()->getConfig()->get( $path, array( 'type' ) ) as $domain ) {
140
+            $this->getSubManager( $domain )->cleanup( $siteids );
141
+        }
142
+
143
+        $this->cleanupBase( $siteids, $this->getConfigPath() . 'delete' );
144
+    }
145
+
146
+
147
+    /**
148
+     * Returns the list attributes that can be used for searching.
149
+     *
150
+     * @param boolean $withsub Return also attributes of sub-managers if true
151
+     * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
152
+     */
153
+    public function getSearchAttributes( $withsub = true )
154
+    {
155
+        $path = 'mshop/customer/manager/lists/submanagers';
156
+
157
+        return $this->getSearchAttributesBase( $this->getSearchConfig(), $path, array( 'type' ), $withsub );
158
+    }
159
+
160
+
161
+    /**
162
+     * Returns a new manager for customer extensions
163
+     *
164
+     * @param string $manager Name of the sub manager type in lower case
165
+     * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
166
+     * @return mixed Manager for different extensions, e.g stock, tags, locations, etc.
167
+     */
168
+    public function getSubManager( $manager, $name = null )
169
+    {
170
+        return $this->getSubManagerBase( 'customer', 'lists/' . $manager, ( $name === null ? 'Ezpublish' : $name ) );
171
+    }
172
+
173
+
174
+    /**
175
+     * Updates or adds a common list item object.
176
+     *
177
+     * @param \Aimeos\MShop\Common\Item\Lists\Iface $item List item object which should be saved
178
+     * @param boolean $fetch True if the new ID should be returned in the item
179
+     */
180
+    public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true )
181
+    {
182
+        $iface = '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface';
183
+        if( !( $item instanceof $iface ) ) {
184
+            throw new \Aimeos\MShop\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
185
+        }
186
+
187
+        if( $item->getDomain() === 'customer/group' ) {
188
+            throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Adding groups to customers is not supported, please use the eZ Publish backend' ) );
189
+        }
190
+
191
+        parent::saveItem( $item, $fetch );
192
+    }
193
+
194
+
195
+    /**
196
+     * Returns the config path for retrieving the configuration values.
197
+     *
198
+     * @return string Configuration path (mshop/customer/manager/lists/ezpublish/)
199
+     */
200
+    protected function getConfigPath()
201
+    {
202
+        return 'mshop/customer/manager/lists/ezpublish/';
203
+    }
204
+
205
+
206
+    /**
207
+     * Returns the search configuration for searching items.
208
+     *
209
+     * @return array Associative list of search keys and search definitions
210
+     */
211
+    protected function getSearchConfig()
212
+    {
213
+        return $this->searchConfig;
214
+    }
215 215
 }
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		'customer.lists.id'=> array(
26 26
 			'code'=>'customer.lists.id',
27 27
 			'internalcode'=>'ezuli."id"',
28
-			'internaldeps' => array( 'LEFT JOIN "ezuser_list" AS ezuli ON ( ezu."id" = ezuli."parentid" )' ),
28
+			'internaldeps' => array('LEFT JOIN "ezuser_list" AS ezuli ON ( ezu."id" = ezuli."parentid" )'),
29 29
 			'label'=>'Customer list ID',
30 30
 			'type'=> 'integer',
31 31
 			'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_INT,
@@ -133,14 +133,14 @@  discard block
 block discarded – undo
133 133
 	 *
134 134
 	 * @param array $siteids List of IDs for sites whose entries should be deleted
135 135
 	 */
136
-	public function cleanup( array $siteids )
136
+	public function cleanup(array $siteids)
137 137
 	{
138 138
 		$path = 'mshop/customer/manager/lists/submanagers';
139
-		foreach( $this->getContext()->getConfig()->get( $path, array( 'type' ) ) as $domain ) {
140
-			$this->getSubManager( $domain )->cleanup( $siteids );
139
+		foreach ($this->getContext()->getConfig()->get($path, array('type')) as $domain) {
140
+			$this->getSubManager($domain)->cleanup($siteids);
141 141
 		}
142 142
 
143
-		$this->cleanupBase( $siteids, $this->getConfigPath() . 'delete' );
143
+		$this->cleanupBase($siteids, $this->getConfigPath().'delete');
144 144
 	}
145 145
 
146 146
 
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
 	 * @param boolean $withsub Return also attributes of sub-managers if true
151 151
 	 * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
152 152
 	 */
153
-	public function getSearchAttributes( $withsub = true )
153
+	public function getSearchAttributes($withsub = true)
154 154
 	{
155 155
 		$path = 'mshop/customer/manager/lists/submanagers';
156 156
 
157
-		return $this->getSearchAttributesBase( $this->getSearchConfig(), $path, array( 'type' ), $withsub );
157
+		return $this->getSearchAttributesBase($this->getSearchConfig(), $path, array('type'), $withsub);
158 158
 	}
159 159
 
160 160
 
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
 	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
166 166
 	 * @return mixed Manager for different extensions, e.g stock, tags, locations, etc.
167 167
 	 */
168
-	public function getSubManager( $manager, $name = null )
168
+	public function getSubManager($manager, $name = null)
169 169
 	{
170
-		return $this->getSubManagerBase( 'customer', 'lists/' . $manager, ( $name === null ? 'Ezpublish' : $name ) );
170
+		return $this->getSubManagerBase('customer', 'lists/'.$manager, ($name === null ? 'Ezpublish' : $name));
171 171
 	}
172 172
 
173 173
 
@@ -177,18 +177,18 @@  discard block
 block discarded – undo
177 177
 	 * @param \Aimeos\MShop\Common\Item\Lists\Iface $item List item object which should be saved
178 178
 	 * @param boolean $fetch True if the new ID should be returned in the item
179 179
 	 */
180
-	public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true )
180
+	public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true)
181 181
 	{
182 182
 		$iface = '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface';
183
-		if( !( $item instanceof $iface ) ) {
184
-			throw new \Aimeos\MShop\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
183
+		if (!($item instanceof $iface)) {
184
+			throw new \Aimeos\MShop\Exception(sprintf('Object is not of required type "%1$s"', $iface));
185 185
 		}
186 186
 
187
-		if( $item->getDomain() === 'customer/group' ) {
188
-			throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Adding groups to customers is not supported, please use the eZ Publish backend' ) );
187
+		if ($item->getDomain() === 'customer/group') {
188
+			throw new \Aimeos\MShop\Customer\Exception(sprintf('Adding groups to customers is not supported, please use the eZ Publish backend'));
189 189
 		}
190 190
 
191
-		parent::saveItem( $item, $fetch );
191
+		parent::saveItem($item, $fetch);
192 192
 	}
193 193
 
194 194
 
Please login to merge, or discard this patch.