Completed
Push — master ( a97add...702095 )
by Aimeos
02:48
created
lib/custom/setup/unittest/CustomerAddEzpublishTestData.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,8 +117,7 @@
 block discarded – undo
117 117
 				$stmt->execute()->finish();
118 118
 
119 119
 				$dbm->release( $conn, $dbname );
120
-			}
121
-			catch( \Exception $e )
120
+			} catch( \Exception $e )
122 121
 			{
123 122
 				$dbm->release( $conn, $dbname );
124 123
 				throw $e;
Please login to merge, or discard this patch.
Indentation   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -14,134 +14,134 @@
 block discarded – undo
14 14
  */
15 15
 class CustomerAddEzpublishTestData extends \Aimeos\MW\Setup\Task\CustomerAddTestData
16 16
 {
17
-	/**
18
-	 * Returns the list of task names which this task depends on.
19
-	 *
20
-	 * @return string[] List of task names
21
-	 */
22
-	public function getPreDependencies()
23
-	{
24
-		return array( 'TablesCreateEzpublish', 'EzuserAddAddress', 'MShopSetLocale', 'MediaAddTestData' );
25
-	}
17
+    /**
18
+     * Returns the list of task names which this task depends on.
19
+     *
20
+     * @return string[] List of task names
21
+     */
22
+    public function getPreDependencies()
23
+    {
24
+        return array( 'TablesCreateEzpublish', 'EzuserAddAddress', 'MShopSetLocale', 'MediaAddTestData' );
25
+    }
26 26
 
27 27
 
28
-	/**
29
-	 * Adds attribute test data.
30
-	 */
31
-	public function migrate()
32
-	{
33
-		$iface = '\\Aimeos\\MShop\\Context\\Item\\Iface';
34
-		if( !( $this->additional instanceof $iface ) ) {
35
-			throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) );
36
-		}
28
+    /**
29
+     * Adds attribute test data.
30
+     */
31
+    public function migrate()
32
+    {
33
+        $iface = '\\Aimeos\\MShop\\Context\\Item\\Iface';
34
+        if( !( $this->additional instanceof $iface ) ) {
35
+            throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) );
36
+        }
37 37
 
38
-		$context = $this->getEzContext( $this->additional );
38
+        $context = $this->getEzContext( $this->additional );
39 39
 
40
-		$this->msg( 'Adding ezPublish customer test data', 0 );
40
+        $this->msg( 'Adding ezPublish customer test data', 0 );
41 41
 
42
-		$parentIds = array();
43
-		$ds = DIRECTORY_SEPARATOR;
44
-		$context->setEditor( 'ai-ezpublish:unittest' );
45
-		$path = __DIR__ . $ds . 'data' . $ds . 'customer.php';
42
+        $parentIds = array();
43
+        $ds = DIRECTORY_SEPARATOR;
44
+        $context->setEditor( 'ai-ezpublish:unittest' );
45
+        $path = __DIR__ . $ds . 'data' . $ds . 'customer.php';
46 46
 
47
-		if( ( $testdata = include( $path ) ) === false ){
48
-			throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) );
49
-		}
47
+        if( ( $testdata = include( $path ) ) === false ){
48
+            throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) );
49
+        }
50 50
 
51 51
 
52
-		$customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'Ezpublish' );
53
-		$customerAddressManager = $customerManager->getSubManager( 'address', 'Ezpublish' );
52
+        $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'Ezpublish' );
53
+        $customerAddressManager = $customerManager->getSubManager( 'address', 'Ezpublish' );
54 54
 
55
-		$search = $customerManager->createSearch();
56
-		$search->setConditions( $search->compare( '==', 'customer.code', array( 'UTC001', 'UTC002', 'UTC003' ) ) );
57
-		$items = $customerManager->searchItems( $search );
55
+        $search = $customerManager->createSearch();
56
+        $search->setConditions( $search->compare( '==', 'customer.code', array( 'UTC001', 'UTC002', 'UTC003' ) ) );
57
+        $items = $customerManager->searchItems( $search );
58 58
 
59
-		$this->conn->begin();
59
+        $this->conn->begin();
60 60
 
61
-		$customerManager->deleteItems( array_keys( $items ) );
62
-		$parentIds = $this->addCustomerData( $testdata, $customerManager, $customerAddressManager->createItem() );
63
-		$this->addCustomerAddressData( $testdata, $customerAddressManager, $parentIds );
61
+        $customerManager->deleteItems( array_keys( $items ) );
62
+        $parentIds = $this->addCustomerData( $testdata, $customerManager, $customerAddressManager->createItem() );
63
+        $this->addCustomerAddressData( $testdata, $customerAddressManager, $parentIds );
64 64
 
65
-		$this->conn->commit();
65
+        $this->conn->commit();
66 66
 
67 67
 
68
-		$this->status( 'done' );
69
-	}
68
+        $this->status( 'done' );
69
+    }
70 70
 
71 71
 
72
-	/**
73
-	 * Returns the Ezpublish context
74
-	 *
75
-	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
76
-	 * @return \Aimeos\MShop\Context\Item\Ezpublish Ezpublish context object
77
-	 */
78
-	protected function getEzContext( \Aimeos\MShop\Context\Item\Iface $context )
79
-	{
80
-		$class = '\Aimeos\MShop\Context\Item\Ezpublish';
81
-		if( is_a( $context, $class ) ) {
82
-			return $context;
83
-		}
72
+    /**
73
+     * Returns the Ezpublish context
74
+     *
75
+     * @param \Aimeos\MShop\Context\Item\Iface $context Context object
76
+     * @return \Aimeos\MShop\Context\Item\Ezpublish Ezpublish context object
77
+     */
78
+    protected function getEzContext( \Aimeos\MShop\Context\Item\Iface $context )
79
+    {
80
+        $class = '\Aimeos\MShop\Context\Item\Ezpublish';
81
+        if( is_a( $context, $class ) ) {
82
+            return $context;
83
+        }
84 84
 
85
-		$ctx = new \Aimeos\MShop\Context\Item\Ezpublish();
86
-		$ctx->setDatabaseManager( clone $context->getDatabaseManager() );
87
-		$ctx->setSession( clone $context->getSession() );
88
-		$ctx->setLogger( clone $context->getLogger() );
89
-		$ctx->setLocale( clone $context->getLocale() );
90
-		$ctx->setConfig( clone $context->getConfig() );
91
-		$ctx->setCache( clone $context->getCache() );
85
+        $ctx = new \Aimeos\MShop\Context\Item\Ezpublish();
86
+        $ctx->setDatabaseManager( clone $context->getDatabaseManager() );
87
+        $ctx->setSession( clone $context->getSession() );
88
+        $ctx->setLogger( clone $context->getLogger() );
89
+        $ctx->setLocale( clone $context->getLocale() );
90
+        $ctx->setConfig( clone $context->getConfig() );
91
+        $ctx->setCache( clone $context->getCache() );
92 92
 
93 93
 
94
-		$ctx->setEzUser( function( $id, $code, $email, $password, $status ) use ( $ctx ) {
94
+        $ctx->setEzUser( function( $id, $code, $email, $password, $status ) use ( $ctx ) {
95 95
 
96
-			$dbm = $ctx->getDatabaseManager();
97
-			$dbname = ( $ctx->getConfig()->get( 'resource/db-customer' ) ? 'db-customer' : 'db' );
98
-			$conn = $dbm->acquire( $dbname );
96
+            $dbm = $ctx->getDatabaseManager();
97
+            $dbname = ( $ctx->getConfig()->get( 'resource/db-customer' ) ? 'db-customer' : 'db' );
98
+            $conn = $dbm->acquire( $dbname );
99 99
 
100
-			try
101
-			{
102
-				$contentid = ( $id === null ? mt_rand( -0x7fffffff,-1 ) : $id );
100
+            try
101
+            {
102
+                $contentid = ( $id === null ? mt_rand( -0x7fffffff,-1 ) : $id );
103 103
 
104
-				if( $id === null ) {
105
-					$sql = 'INSERT INTO "ezuser" ( "email", "login", "login_normalized", "password_hash", "password_hash_type", "contentobject_id" ) VALUES ( ?, ?, ?, ?, 5, ? )';
106
-				} else {
107
-					$sql = 'UPDATE "ezuser" SET "email" = ?, "login" = ?, "login_normalized" = ?, "password_hash" = ?, "password_hash_type" = 5 WHERE "contentobject_id" = ?';
108
-				}
104
+                if( $id === null ) {
105
+                    $sql = 'INSERT INTO "ezuser" ( "email", "login", "login_normalized", "password_hash", "password_hash_type", "contentobject_id" ) VALUES ( ?, ?, ?, ?, 5, ? )';
106
+                } else {
107
+                    $sql = 'UPDATE "ezuser" SET "email" = ?, "login" = ?, "login_normalized" = ?, "password_hash" = ?, "password_hash_type" = 5 WHERE "contentobject_id" = ?';
108
+                }
109 109
 
110
-				$stmt = $conn->create( $sql );
111
-				$stmt->bind( 1, $email );
112
-				$stmt->bind( 2, $code );
113
-				$stmt->bind( 3, $code );
114
-				$stmt->bind( 4, $password );
115
-				$stmt->bind( 5, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
110
+                $stmt = $conn->create( $sql );
111
+                $stmt->bind( 1, $email );
112
+                $stmt->bind( 2, $code );
113
+                $stmt->bind( 3, $code );
114
+                $stmt->bind( 4, $password );
115
+                $stmt->bind( 5, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
116 116
 
117
-				$stmt->execute()->finish();
117
+                $stmt->execute()->finish();
118 118
 
119 119
 
120
-				if( $id === null ) {
121
-					$sql = 'INSERT INTO "ezuser_setting" ( "is_enabled", "user_id" ) VALUES ( ?, ? )';
122
-				} else {
123
-					$sql = 'UPDATE "ezuser_setting" SET "is_enabled" = ? WHERE "user_id" = ?';
124
-				}
120
+                if( $id === null ) {
121
+                    $sql = 'INSERT INTO "ezuser_setting" ( "is_enabled", "user_id" ) VALUES ( ?, ? )';
122
+                } else {
123
+                    $sql = 'UPDATE "ezuser_setting" SET "is_enabled" = ? WHERE "user_id" = ?';
124
+                }
125 125
 
126
-				$stmt = $conn->create( $sql );
127
-				$stmt->bind( 1, $status, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
128
-				$stmt->bind( 2, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
126
+                $stmt = $conn->create( $sql );
127
+                $stmt->bind( 1, $status, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
128
+                $stmt->bind( 2, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
129 129
 
130
-				$stmt->execute()->finish();
130
+                $stmt->execute()->finish();
131 131
 
132 132
 
133
-				$dbm->release( $conn, $dbname );
134
-			}
135
-			catch( \Exception $e )
136
-			{
137
-				$dbm->release( $conn, $dbname );
138
-				throw $e;
139
-			}
133
+                $dbm->release( $conn, $dbname );
134
+            }
135
+            catch( \Exception $e )
136
+            {
137
+                $dbm->release( $conn, $dbname );
138
+                throw $e;
139
+            }
140 140
 
141
-			return $contentid;
142
-		} );
141
+            return $contentid;
142
+        } );
143 143
 
144 144
 
145
-		return $ctx;
146
-	}
145
+        return $ctx;
146
+    }
147 147
 }
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function getPreDependencies()
23 23
 	{
24
-		return array( 'TablesCreateEzpublish', 'EzuserAddAddress', 'MShopSetLocale', 'MediaAddTestData' );
24
+		return array('TablesCreateEzpublish', 'EzuserAddAddress', 'MShopSetLocale', 'MediaAddTestData');
25 25
 	}
26 26
 
27 27
 
@@ -31,41 +31,41 @@  discard block
 block discarded – undo
31 31
 	public function migrate()
32 32
 	{
33 33
 		$iface = '\\Aimeos\\MShop\\Context\\Item\\Iface';
34
-		if( !( $this->additional instanceof $iface ) ) {
35
-			throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) );
34
+		if (!($this->additional instanceof $iface)) {
35
+			throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface));
36 36
 		}
37 37
 
38
-		$context = $this->getEzContext( $this->additional );
38
+		$context = $this->getEzContext($this->additional);
39 39
 
40
-		$this->msg( 'Adding ezPublish customer test data', 0 );
40
+		$this->msg('Adding ezPublish customer test data', 0);
41 41
 
42 42
 		$parentIds = array();
43 43
 		$ds = DIRECTORY_SEPARATOR;
44
-		$context->setEditor( 'ai-ezpublish:unittest' );
45
-		$path = __DIR__ . $ds . 'data' . $ds . 'customer.php';
44
+		$context->setEditor('ai-ezpublish:unittest');
45
+		$path = __DIR__.$ds.'data'.$ds.'customer.php';
46 46
 
47
-		if( ( $testdata = include( $path ) ) === false ){
48
-			throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) );
47
+		if (($testdata = include($path)) === false) {
48
+			throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path));
49 49
 		}
50 50
 
51 51
 
52
-		$customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'Ezpublish' );
53
-		$customerAddressManager = $customerManager->getSubManager( 'address', 'Ezpublish' );
52
+		$customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'Ezpublish');
53
+		$customerAddressManager = $customerManager->getSubManager('address', 'Ezpublish');
54 54
 
55 55
 		$search = $customerManager->createSearch();
56
-		$search->setConditions( $search->compare( '==', 'customer.code', array( 'UTC001', 'UTC002', 'UTC003' ) ) );
57
-		$items = $customerManager->searchItems( $search );
56
+		$search->setConditions($search->compare('==', 'customer.code', array('UTC001', 'UTC002', 'UTC003')));
57
+		$items = $customerManager->searchItems($search);
58 58
 
59 59
 		$this->conn->begin();
60 60
 
61
-		$customerManager->deleteItems( array_keys( $items ) );
62
-		$parentIds = $this->addCustomerData( $testdata, $customerManager, $customerAddressManager->createItem() );
63
-		$this->addCustomerAddressData( $testdata, $customerAddressManager, $parentIds );
61
+		$customerManager->deleteItems(array_keys($items));
62
+		$parentIds = $this->addCustomerData($testdata, $customerManager, $customerAddressManager->createItem());
63
+		$this->addCustomerAddressData($testdata, $customerAddressManager, $parentIds);
64 64
 
65 65
 		$this->conn->commit();
66 66
 
67 67
 
68
-		$this->status( 'done' );
68
+		$this->status('done');
69 69
 	}
70 70
 
71 71
 
@@ -75,66 +75,66 @@  discard block
 block discarded – undo
75 75
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
76 76
 	 * @return \Aimeos\MShop\Context\Item\Ezpublish Ezpublish context object
77 77
 	 */
78
-	protected function getEzContext( \Aimeos\MShop\Context\Item\Iface $context )
78
+	protected function getEzContext(\Aimeos\MShop\Context\Item\Iface $context)
79 79
 	{
80 80
 		$class = '\Aimeos\MShop\Context\Item\Ezpublish';
81
-		if( is_a( $context, $class ) ) {
81
+		if (is_a($context, $class)) {
82 82
 			return $context;
83 83
 		}
84 84
 
85 85
 		$ctx = new \Aimeos\MShop\Context\Item\Ezpublish();
86
-		$ctx->setDatabaseManager( clone $context->getDatabaseManager() );
87
-		$ctx->setSession( clone $context->getSession() );
88
-		$ctx->setLogger( clone $context->getLogger() );
89
-		$ctx->setLocale( clone $context->getLocale() );
90
-		$ctx->setConfig( clone $context->getConfig() );
91
-		$ctx->setCache( clone $context->getCache() );
86
+		$ctx->setDatabaseManager(clone $context->getDatabaseManager());
87
+		$ctx->setSession(clone $context->getSession());
88
+		$ctx->setLogger(clone $context->getLogger());
89
+		$ctx->setLocale(clone $context->getLocale());
90
+		$ctx->setConfig(clone $context->getConfig());
91
+		$ctx->setCache(clone $context->getCache());
92 92
 
93 93
 
94
-		$ctx->setEzUser( function( $id, $code, $email, $password, $status ) use ( $ctx ) {
94
+		$ctx->setEzUser(function($id, $code, $email, $password, $status) use ($ctx) {
95 95
 
96 96
 			$dbm = $ctx->getDatabaseManager();
97
-			$dbname = ( $ctx->getConfig()->get( 'resource/db-customer' ) ? 'db-customer' : 'db' );
98
-			$conn = $dbm->acquire( $dbname );
97
+			$dbname = ($ctx->getConfig()->get('resource/db-customer') ? 'db-customer' : 'db');
98
+			$conn = $dbm->acquire($dbname);
99 99
 
100 100
 			try
101 101
 			{
102
-				$contentid = ( $id === null ? mt_rand( -0x7fffffff,-1 ) : $id );
102
+				$contentid = ($id === null ? mt_rand( -0x7fffffff, -1 ) : $id);
103 103
 
104
-				if( $id === null ) {
104
+				if ($id === null) {
105 105
 					$sql = 'INSERT INTO "ezuser" ( "email", "login", "login_normalized", "password_hash", "password_hash_type", "contentobject_id" ) VALUES ( ?, ?, ?, ?, 5, ? )';
106 106
 				} else {
107 107
 					$sql = 'UPDATE "ezuser" SET "email" = ?, "login" = ?, "login_normalized" = ?, "password_hash" = ?, "password_hash_type" = 5 WHERE "contentobject_id" = ?';
108 108
 				}
109 109
 
110
-				$stmt = $conn->create( $sql );
111
-				$stmt->bind( 1, $email );
112
-				$stmt->bind( 2, $code );
113
-				$stmt->bind( 3, $code );
114
-				$stmt->bind( 4, $password );
115
-				$stmt->bind( 5, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
110
+				$stmt = $conn->create($sql);
111
+				$stmt->bind(1, $email);
112
+				$stmt->bind(2, $code);
113
+				$stmt->bind(3, $code);
114
+				$stmt->bind(4, $password);
115
+				$stmt->bind(5, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
116 116
 
117 117
 				$stmt->execute()->finish();
118 118
 
119 119
 
120
-				if( $id === null ) {
120
+				if ($id === null) {
121 121
 					$sql = 'INSERT INTO "ezuser_setting" ( "is_enabled", "user_id" ) VALUES ( ?, ? )';
122 122
 				} else {
123 123
 					$sql = 'UPDATE "ezuser_setting" SET "is_enabled" = ? WHERE "user_id" = ?';
124 124
 				}
125 125
 
126
-				$stmt = $conn->create( $sql );
127
-				$stmt->bind( 1, $status, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
128
-				$stmt->bind( 2, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
126
+				$stmt = $conn->create($sql);
127
+				$stmt->bind(1, $status, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
128
+				$stmt->bind(2, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
129 129
 
130 130
 				$stmt->execute()->finish();
131 131
 
132 132
 
133
-				$dbm->release( $conn, $dbname );
133
+				$dbm->release($conn, $dbname);
134 134
 			}
135
-			catch( \Exception $e )
135
+			catch (\Exception $e)
136 136
 			{
137
-				$dbm->release( $conn, $dbname );
137
+				$dbm->release($conn, $dbname);
138 138
 				throw $e;
139 139
 			}
140 140
 
Please login to merge, or discard this patch.
lib/custom/tests/TestHelper.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,8 +117,7 @@
 block discarded – undo
117 117
 				$stmt->execute()->finish();
118 118
 
119 119
 				$dbm->release( $conn, $dbname );
120
-			}
121
-			catch( \Exception $e )
120
+			} catch( \Exception $e )
122 121
 			{
123 122
 				$dbm->release( $conn, $dbname );
124 123
 				throw $e;
Please login to merge, or discard this patch.
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -8,140 +8,140 @@
 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 93
 
94
-		$ctx->setEzUser( function( $id, $code, $email, $password, $status ) use ( $ctx ) {
94
+        $ctx->setEzUser( function( $id, $code, $email, $password, $status ) use ( $ctx ) {
95 95
 
96
-			$dbm = $ctx->getDatabaseManager();
97
-			$dbname = ( $ctx->getConfig()->get( 'resource/db-customer' ) ? 'db-customer' : 'db' );
98
-			$conn = $dbm->acquire( $dbname );
96
+            $dbm = $ctx->getDatabaseManager();
97
+            $dbname = ( $ctx->getConfig()->get( 'resource/db-customer' ) ? 'db-customer' : 'db' );
98
+            $conn = $dbm->acquire( $dbname );
99 99
 
100
-			try
101
-			{
102
-				$contentid = ( $id === null ? mt_rand( -0x7fffffff,-1 ) : $id );
100
+            try
101
+            {
102
+                $contentid = ( $id === null ? mt_rand( -0x7fffffff,-1 ) : $id );
103 103
 
104
-				if( $id === null ) {
105
-					$sql = 'INSERT INTO "ezuser" ( "email", "login", "login_normalized", "password_hash", "password_hash_type", "contentobject_id" ) VALUES ( ?, ?, ?, ?, 5, ? )';
106
-				} else {
107
-					$sql = 'UPDATE "ezuser" SET "email" = ?, "login" = ?, "login_normalized" = ?, "password_hash" = ?, "password_hash_type" = 5 WHERE "contentobject_id" = ?';
108
-				}
104
+                if( $id === null ) {
105
+                    $sql = 'INSERT INTO "ezuser" ( "email", "login", "login_normalized", "password_hash", "password_hash_type", "contentobject_id" ) VALUES ( ?, ?, ?, ?, 5, ? )';
106
+                } else {
107
+                    $sql = 'UPDATE "ezuser" SET "email" = ?, "login" = ?, "login_normalized" = ?, "password_hash" = ?, "password_hash_type" = 5 WHERE "contentobject_id" = ?';
108
+                }
109 109
 
110
-				$stmt = $conn->create( $sql );
111
-				$stmt->bind( 1, $email );
112
-				$stmt->bind( 2, $code );
113
-				$stmt->bind( 3, $code );
114
-				$stmt->bind( 4, $password );
115
-				$stmt->bind( 5, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
110
+                $stmt = $conn->create( $sql );
111
+                $stmt->bind( 1, $email );
112
+                $stmt->bind( 2, $code );
113
+                $stmt->bind( 3, $code );
114
+                $stmt->bind( 4, $password );
115
+                $stmt->bind( 5, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
116 116
 
117
-				$stmt->execute()->finish();
117
+                $stmt->execute()->finish();
118 118
 
119 119
 
120
-				if( $id === null ) {
121
-					$sql = 'INSERT INTO "ezuser_setting" ( "is_enabled", "user_id" ) VALUES ( ?, ? )';
122
-				} else {
123
-					$sql = 'UPDATE "ezuser_setting" SET "is_enabled" = ? WHERE "user_id" = ?';
124
-				}
120
+                if( $id === null ) {
121
+                    $sql = 'INSERT INTO "ezuser_setting" ( "is_enabled", "user_id" ) VALUES ( ?, ? )';
122
+                } else {
123
+                    $sql = 'UPDATE "ezuser_setting" SET "is_enabled" = ? WHERE "user_id" = ?';
124
+                }
125 125
 
126
-				$stmt = $conn->create( $sql );
127
-				$stmt->bind( 1, $status, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
128
-				$stmt->bind( 2, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
126
+                $stmt = $conn->create( $sql );
127
+                $stmt->bind( 1, $status, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
128
+                $stmt->bind( 2, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
129 129
 
130
-				$stmt->execute()->finish();
130
+                $stmt->execute()->finish();
131 131
 
132 132
 
133
-				$dbm->release( $conn, $dbname );
134
-			}
135
-			catch( \Exception $e )
136
-			{
137
-				$dbm->release( $conn, $dbname );
138
-				throw $e;
139
-			}
133
+                $dbm->release( $conn, $dbname );
134
+            }
135
+            catch( \Exception $e )
136
+            {
137
+                $dbm->release( $conn, $dbname );
138
+                throw $e;
139
+            }
140 140
 
141
-			return $contentid;
142
-		} );
141
+            return $contentid;
142
+        } );
143 143
 
144 144
 
145
-		return $ctx;
146
-	}
145
+        return $ctx;
146
+    }
147 147
 }
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 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,91 +50,91 @@  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
 
94
-		$ctx->setEzUser( function( $id, $code, $email, $password, $status ) use ( $ctx ) {
94
+		$ctx->setEzUser(function($id, $code, $email, $password, $status) use ($ctx) {
95 95
 
96 96
 			$dbm = $ctx->getDatabaseManager();
97
-			$dbname = ( $ctx->getConfig()->get( 'resource/db-customer' ) ? 'db-customer' : 'db' );
98
-			$conn = $dbm->acquire( $dbname );
97
+			$dbname = ($ctx->getConfig()->get('resource/db-customer') ? 'db-customer' : 'db');
98
+			$conn = $dbm->acquire($dbname);
99 99
 
100 100
 			try
101 101
 			{
102
-				$contentid = ( $id === null ? mt_rand( -0x7fffffff,-1 ) : $id );
102
+				$contentid = ($id === null ? mt_rand( -0x7fffffff, -1 ) : $id);
103 103
 
104
-				if( $id === null ) {
104
+				if ($id === null) {
105 105
 					$sql = 'INSERT INTO "ezuser" ( "email", "login", "login_normalized", "password_hash", "password_hash_type", "contentobject_id" ) VALUES ( ?, ?, ?, ?, 5, ? )';
106 106
 				} else {
107 107
 					$sql = 'UPDATE "ezuser" SET "email" = ?, "login" = ?, "login_normalized" = ?, "password_hash" = ?, "password_hash_type" = 5 WHERE "contentobject_id" = ?';
108 108
 				}
109 109
 
110
-				$stmt = $conn->create( $sql );
111
-				$stmt->bind( 1, $email );
112
-				$stmt->bind( 2, $code );
113
-				$stmt->bind( 3, $code );
114
-				$stmt->bind( 4, $password );
115
-				$stmt->bind( 5, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
110
+				$stmt = $conn->create($sql);
111
+				$stmt->bind(1, $email);
112
+				$stmt->bind(2, $code);
113
+				$stmt->bind(3, $code);
114
+				$stmt->bind(4, $password);
115
+				$stmt->bind(5, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
116 116
 
117 117
 				$stmt->execute()->finish();
118 118
 
119 119
 
120
-				if( $id === null ) {
120
+				if ($id === null) {
121 121
 					$sql = 'INSERT INTO "ezuser_setting" ( "is_enabled", "user_id" ) VALUES ( ?, ? )';
122 122
 				} else {
123 123
 					$sql = 'UPDATE "ezuser_setting" SET "is_enabled" = ? WHERE "user_id" = ?';
124 124
 				}
125 125
 
126
-				$stmt = $conn->create( $sql );
127
-				$stmt->bind( 1, $status, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
128
-				$stmt->bind( 2, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
126
+				$stmt = $conn->create($sql);
127
+				$stmt->bind(1, $status, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
128
+				$stmt->bind(2, $contentid, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
129 129
 
130 130
 				$stmt->execute()->finish();
131 131
 
132 132
 
133
-				$dbm->release( $conn, $dbname );
133
+				$dbm->release($conn, $dbname);
134 134
 			}
135
-			catch( \Exception $e )
135
+			catch (\Exception $e)
136 136
 			{
137
-				$dbm->release( $conn, $dbname );
137
+				$dbm->release($conn, $dbname);
138 138
 				throw $e;
139 139
 			}
140 140
 
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Address/EzpublishTest.php 2 patches
Indentation   +211 added lines, -211 removed lines patch added patch discarded remove patch
@@ -11,215 +11,215 @@
 block discarded – undo
11 11
 
12 12
 class EzpublishTest extends \PHPUnit_Framework_TestCase
13 13
 {
14
-	private $fixture = null;
15
-	private $object = null;
16
-	private $editor = '';
17
-
18
-
19
-	protected function setUp()
20
-	{
21
-		$context = \TestHelper::getContext();
22
-		$this->editor = $context->getEditor();
23
-		$customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $context );
24
-
25
-		$search = $customer->createSearch();
26
-		$conditions = array(
27
-			$search->compare( '==', 'customer.code', 'UTC001' ),
28
-			$search->compare( '==', 'customer.editor', $this->editor )
29
-		);
30
-		$search->setConditions( $search->combine( '&&', $conditions ) );
31
-		$result = $customer->searchItems( $search );
32
-
33
-		if( ( $customerItem = reset( $result ) ) === false ) {
34
-			throw new \Exception( sprintf( 'No customer item found for code "%1$s"', 'UTC001' ) );
35
-		}
36
-
37
-		$this->fixture = array(
38
-			'customer.address.parentid' => $customerItem->getId(),
39
-			'customer.address.company' => 'ABC GmbH',
40
-			'customer.address.vatid' => 'DE999999999',
41
-			'customer.address.salutation' => \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR,
42
-			'customer.address.title' => 'Herr',
43
-			'customer.address.firstname' => 'firstunit',
44
-			'customer.address.lastname' => 'lastunit',
45
-			'customer.address.address1' => 'unit str.',
46
-			'customer.address.address2' => ' 166',
47
-			'customer.address.address3' => '4.OG',
48
-			'customer.address.postal' => '22769',
49
-			'customer.address.city' => 'Hamburg',
50
-			'customer.address.state' => 'Hamburg',
51
-			'customer.address.countryid' => 'de',
52
-			'customer.address.languageid' => 'de',
53
-			'customer.address.telephone' => '05554433221',
54
-			'customer.address.email' => '[email protected]',
55
-			'customer.address.telefax' => '05554433222',
56
-			'customer.address.website' => 'unittest.aimeos.org',
57
-			'customer.address.position' => 1,
58
-			'customer.address.siteid' => $context->getLocale()->getSiteId(),
59
-		);
60
-
61
-		$this->object = $customer->getSubManager( 'address', 'Ezpublish' );
62
-	}
63
-
64
-
65
-	protected function tearDown()
66
-	{
67
-		unset( $this->object, $this->fixture );
68
-	}
69
-
70
-
71
-	public function testCleanup()
72
-	{
73
-		$this->object->cleanup( array( -1 ) );
74
-	}
75
-
76
-	public function testGetSearchAttributes()
77
-	{
78
-		foreach( $this->object->getSearchAttributes() as $attribute ) {
79
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
80
-		}
81
-	}
82
-
83
-	public function testGetSubManager()
84
-	{
85
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
86
-		$this->object->getSubManager( 'unknown' );
87
-	}
88
-
89
-	public function testCreateItem()
90
-	{
91
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() );
92
-	}
93
-
94
-	public function testGetItem()
95
-	{
96
-		$search = $this->object->createSearch();
97
-		$search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) );
98
-
99
-		$items = $this->object->searchItems( $search );
100
-
101
-		if( ( $item = reset( $items ) ) === false ) {
102
-			throw new \Exception( 'No address item with company "ABC" found' );
103
-		}
104
-
105
-		$this->assertEquals( $item, $this->object->getItem( $item->getId() ) );
106
-	}
107
-
108
-	public function testSaveUpdateDeleteItem()
109
-	{
110
-		$item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture );
111
-		$item->setId( null );
112
-		$this->object->saveItem( $item );
113
-		$itemSaved = $this->object->getItem( $item->getId() );
114
-
115
-		$itemExp = clone $itemSaved;
116
-		$itemExp->setPosition( 1 );
117
-		$itemExp->setCity( 'Berlin' );
118
-		$itemExp->setState( 'Berlin' );
119
-		$this->object->saveItem( $itemExp );
120
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
121
-
122
-		$this->object->deleteItem( $itemSaved->getId() );
123
-
124
-
125
-		$this->assertTrue( $item->getId() !== null );
126
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
127
-		$this->assertEquals( $item->getParentId(), $itemSaved->getParentId());
128
-		$this->assertEquals( $item->getPosition(), $itemSaved->getPosition());
129
-		$this->assertEquals( $item->getCompany(), $itemSaved->getCompany());
130
-		$this->assertEquals( $item->getVatID(), $itemSaved->getVatID());
131
-		$this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation());
132
-		$this->assertEquals( $item->getTitle(), $itemSaved->getTitle());
133
-		$this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname());
134
-		$this->assertEquals( $item->getLastname(), $itemSaved->getLastname());
135
-		$this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1());
136
-		$this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2());
137
-		$this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3());
138
-		$this->assertEquals( $item->getPostal(), $itemSaved->getPostal());
139
-		$this->assertEquals( $item->getCity(), $itemSaved->getCity());
140
-		$this->assertEquals( $item->getState(), $itemSaved->getState());
141
-		$this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId());
142
-		$this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId());
143
-		$this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone());
144
-		$this->assertEquals( $item->getEmail(), $itemSaved->getEmail());
145
-		$this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax());
146
-		$this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite());
147
-		$this->assertEquals( $item->getFlag(), $itemSaved->getFlag());
148
-
149
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
150
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
151
-		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
152
-
153
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
154
-		$this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId());
155
-		$this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition());
156
-		$this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany());
157
-		$this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID());
158
-		$this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation());
159
-		$this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle());
160
-		$this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname());
161
-		$this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname());
162
-		$this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1());
163
-		$this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2());
164
-		$this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3());
165
-		$this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal());
166
-		$this->assertEquals( $itemExp->getCity(), $itemUpd->getCity());
167
-		$this->assertEquals( $itemExp->getState(), $itemUpd->getState());
168
-		$this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId());
169
-		$this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId());
170
-		$this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone());
171
-		$this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail());
172
-		$this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax());
173
-		$this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite());
174
-		$this->assertEquals( $itemExp->getFlag(), $itemUpd->getFlag());
175
-
176
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
177
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
178
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
179
-
180
-		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
181
-		$this->object->getItem( $itemSaved->getId() );
182
-	}
183
-
184
-	public function testCreateSearch()
185
-	{
186
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() );
187
-	}
188
-
189
-
190
-	public function testSearchItem()
191
-	{
192
-		$search = $this->object->createSearch();
193
-
194
-		$conditions = array(
195
-			$search->compare( '==', 'customer.address.company', 'ABC' ),
196
-			$search->compare( '==', 'customer.address.editor', $this->editor )
197
-		);
198
-		$search->setConditions( $search->combine( '&&', $conditions ) );
199
-		$this->assertEquals( 1, count( $this->object->searchItems( $search ) ) );
200
-	}
201
-
202
-
203
-	public function testSearchItemTotal()
204
-	{
205
-		$total = 0;
206
-		$search = $this->object->createSearch();
207
-
208
-		$conditions = array(
209
-			$search->compare( '~=', 'customer.address.company', 'ABC GmbH' ),
210
-			$search->compare( '==', 'customer.address.editor', $this->editor )
211
-		);
212
-
213
-		$search->setConditions( $search->combine( '&&', $conditions ) );
214
-		$search->setSlice( 0, 1 );
215
-
216
-		$results = $this->object->searchItems( $search, array(), $total );
217
-
218
-		$this->assertEquals( 1, count( $results ) );
219
-		$this->assertEquals( 2, $total );
220
-
221
-		foreach( $results as $id => $item ) {
222
-			$this->assertEquals( $id, $item->getId() );
223
-		}
224
-	}
14
+    private $fixture = null;
15
+    private $object = null;
16
+    private $editor = '';
17
+
18
+
19
+    protected function setUp()
20
+    {
21
+        $context = \TestHelper::getContext();
22
+        $this->editor = $context->getEditor();
23
+        $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $context );
24
+
25
+        $search = $customer->createSearch();
26
+        $conditions = array(
27
+            $search->compare( '==', 'customer.code', 'UTC001' ),
28
+            $search->compare( '==', 'customer.editor', $this->editor )
29
+        );
30
+        $search->setConditions( $search->combine( '&&', $conditions ) );
31
+        $result = $customer->searchItems( $search );
32
+
33
+        if( ( $customerItem = reset( $result ) ) === false ) {
34
+            throw new \Exception( sprintf( 'No customer item found for code "%1$s"', 'UTC001' ) );
35
+        }
36
+
37
+        $this->fixture = array(
38
+            'customer.address.parentid' => $customerItem->getId(),
39
+            'customer.address.company' => 'ABC GmbH',
40
+            'customer.address.vatid' => 'DE999999999',
41
+            'customer.address.salutation' => \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR,
42
+            'customer.address.title' => 'Herr',
43
+            'customer.address.firstname' => 'firstunit',
44
+            'customer.address.lastname' => 'lastunit',
45
+            'customer.address.address1' => 'unit str.',
46
+            'customer.address.address2' => ' 166',
47
+            'customer.address.address3' => '4.OG',
48
+            'customer.address.postal' => '22769',
49
+            'customer.address.city' => 'Hamburg',
50
+            'customer.address.state' => 'Hamburg',
51
+            'customer.address.countryid' => 'de',
52
+            'customer.address.languageid' => 'de',
53
+            'customer.address.telephone' => '05554433221',
54
+            'customer.address.email' => '[email protected]',
55
+            'customer.address.telefax' => '05554433222',
56
+            'customer.address.website' => 'unittest.aimeos.org',
57
+            'customer.address.position' => 1,
58
+            'customer.address.siteid' => $context->getLocale()->getSiteId(),
59
+        );
60
+
61
+        $this->object = $customer->getSubManager( 'address', 'Ezpublish' );
62
+    }
63
+
64
+
65
+    protected function tearDown()
66
+    {
67
+        unset( $this->object, $this->fixture );
68
+    }
69
+
70
+
71
+    public function testCleanup()
72
+    {
73
+        $this->object->cleanup( array( -1 ) );
74
+    }
75
+
76
+    public function testGetSearchAttributes()
77
+    {
78
+        foreach( $this->object->getSearchAttributes() as $attribute ) {
79
+            $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
80
+        }
81
+    }
82
+
83
+    public function testGetSubManager()
84
+    {
85
+        $this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
86
+        $this->object->getSubManager( 'unknown' );
87
+    }
88
+
89
+    public function testCreateItem()
90
+    {
91
+        $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() );
92
+    }
93
+
94
+    public function testGetItem()
95
+    {
96
+        $search = $this->object->createSearch();
97
+        $search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) );
98
+
99
+        $items = $this->object->searchItems( $search );
100
+
101
+        if( ( $item = reset( $items ) ) === false ) {
102
+            throw new \Exception( 'No address item with company "ABC" found' );
103
+        }
104
+
105
+        $this->assertEquals( $item, $this->object->getItem( $item->getId() ) );
106
+    }
107
+
108
+    public function testSaveUpdateDeleteItem()
109
+    {
110
+        $item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture );
111
+        $item->setId( null );
112
+        $this->object->saveItem( $item );
113
+        $itemSaved = $this->object->getItem( $item->getId() );
114
+
115
+        $itemExp = clone $itemSaved;
116
+        $itemExp->setPosition( 1 );
117
+        $itemExp->setCity( 'Berlin' );
118
+        $itemExp->setState( 'Berlin' );
119
+        $this->object->saveItem( $itemExp );
120
+        $itemUpd = $this->object->getItem( $itemExp->getId() );
121
+
122
+        $this->object->deleteItem( $itemSaved->getId() );
123
+
124
+
125
+        $this->assertTrue( $item->getId() !== null );
126
+        $this->assertEquals( $item->getId(), $itemSaved->getId() );
127
+        $this->assertEquals( $item->getParentId(), $itemSaved->getParentId());
128
+        $this->assertEquals( $item->getPosition(), $itemSaved->getPosition());
129
+        $this->assertEquals( $item->getCompany(), $itemSaved->getCompany());
130
+        $this->assertEquals( $item->getVatID(), $itemSaved->getVatID());
131
+        $this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation());
132
+        $this->assertEquals( $item->getTitle(), $itemSaved->getTitle());
133
+        $this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname());
134
+        $this->assertEquals( $item->getLastname(), $itemSaved->getLastname());
135
+        $this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1());
136
+        $this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2());
137
+        $this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3());
138
+        $this->assertEquals( $item->getPostal(), $itemSaved->getPostal());
139
+        $this->assertEquals( $item->getCity(), $itemSaved->getCity());
140
+        $this->assertEquals( $item->getState(), $itemSaved->getState());
141
+        $this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId());
142
+        $this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId());
143
+        $this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone());
144
+        $this->assertEquals( $item->getEmail(), $itemSaved->getEmail());
145
+        $this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax());
146
+        $this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite());
147
+        $this->assertEquals( $item->getFlag(), $itemSaved->getFlag());
148
+
149
+        $this->assertEquals( $this->editor, $itemSaved->getEditor() );
150
+        $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
151
+        $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
152
+
153
+        $this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
154
+        $this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId());
155
+        $this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition());
156
+        $this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany());
157
+        $this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID());
158
+        $this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation());
159
+        $this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle());
160
+        $this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname());
161
+        $this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname());
162
+        $this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1());
163
+        $this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2());
164
+        $this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3());
165
+        $this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal());
166
+        $this->assertEquals( $itemExp->getCity(), $itemUpd->getCity());
167
+        $this->assertEquals( $itemExp->getState(), $itemUpd->getState());
168
+        $this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId());
169
+        $this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId());
170
+        $this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone());
171
+        $this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail());
172
+        $this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax());
173
+        $this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite());
174
+        $this->assertEquals( $itemExp->getFlag(), $itemUpd->getFlag());
175
+
176
+        $this->assertEquals( $this->editor, $itemUpd->getEditor() );
177
+        $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
178
+        $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
179
+
180
+        $this->setExpectedException('\\Aimeos\\MShop\\Exception');
181
+        $this->object->getItem( $itemSaved->getId() );
182
+    }
183
+
184
+    public function testCreateSearch()
185
+    {
186
+        $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() );
187
+    }
188
+
189
+
190
+    public function testSearchItem()
191
+    {
192
+        $search = $this->object->createSearch();
193
+
194
+        $conditions = array(
195
+            $search->compare( '==', 'customer.address.company', 'ABC' ),
196
+            $search->compare( '==', 'customer.address.editor', $this->editor )
197
+        );
198
+        $search->setConditions( $search->combine( '&&', $conditions ) );
199
+        $this->assertEquals( 1, count( $this->object->searchItems( $search ) ) );
200
+    }
201
+
202
+
203
+    public function testSearchItemTotal()
204
+    {
205
+        $total = 0;
206
+        $search = $this->object->createSearch();
207
+
208
+        $conditions = array(
209
+            $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ),
210
+            $search->compare( '==', 'customer.address.editor', $this->editor )
211
+        );
212
+
213
+        $search->setConditions( $search->combine( '&&', $conditions ) );
214
+        $search->setSlice( 0, 1 );
215
+
216
+        $results = $this->object->searchItems( $search, array(), $total );
217
+
218
+        $this->assertEquals( 1, count( $results ) );
219
+        $this->assertEquals( 2, $total );
220
+
221
+        foreach( $results as $id => $item ) {
222
+            $this->assertEquals( $id, $item->getId() );
223
+        }
224
+    }
225 225
 }
Please login to merge, or discard this patch.
Spacing   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -20,18 +20,18 @@  discard block
 block discarded – undo
20 20
 	{
21 21
 		$context = \TestHelper::getContext();
22 22
 		$this->editor = $context->getEditor();
23
-		$customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $context );
23
+		$customer = new \Aimeos\MShop\Customer\Manager\Ezpublish($context);
24 24
 
25 25
 		$search = $customer->createSearch();
26 26
 		$conditions = array(
27
-			$search->compare( '==', 'customer.code', 'UTC001' ),
28
-			$search->compare( '==', 'customer.editor', $this->editor )
27
+			$search->compare('==', 'customer.code', 'UTC001'),
28
+			$search->compare('==', 'customer.editor', $this->editor)
29 29
 		);
30
-		$search->setConditions( $search->combine( '&&', $conditions ) );
31
-		$result = $customer->searchItems( $search );
30
+		$search->setConditions($search->combine('&&', $conditions));
31
+		$result = $customer->searchItems($search);
32 32
 
33
-		if( ( $customerItem = reset( $result ) ) === false ) {
34
-			throw new \Exception( sprintf( 'No customer item found for code "%1$s"', 'UTC001' ) );
33
+		if (($customerItem = reset($result)) === false) {
34
+			throw new \Exception(sprintf('No customer item found for code "%1$s"', 'UTC001'));
35 35
 		}
36 36
 
37 37
 		$this->fixture = array(
@@ -58,132 +58,132 @@  discard block
 block discarded – undo
58 58
 			'customer.address.siteid' => $context->getLocale()->getSiteId(),
59 59
 		);
60 60
 
61
-		$this->object = $customer->getSubManager( 'address', 'Ezpublish' );
61
+		$this->object = $customer->getSubManager('address', 'Ezpublish');
62 62
 	}
63 63
 
64 64
 
65 65
 	protected function tearDown()
66 66
 	{
67
-		unset( $this->object, $this->fixture );
67
+		unset($this->object, $this->fixture);
68 68
 	}
69 69
 
70 70
 
71 71
 	public function testCleanup()
72 72
 	{
73
-		$this->object->cleanup( array( -1 ) );
73
+		$this->object->cleanup(array( -1 ));
74 74
 	}
75 75
 
76 76
 	public function testGetSearchAttributes()
77 77
 	{
78
-		foreach( $this->object->getSearchAttributes() as $attribute ) {
79
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
78
+		foreach ($this->object->getSearchAttributes() as $attribute) {
79
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
80 80
 		}
81 81
 	}
82 82
 
83 83
 	public function testGetSubManager()
84 84
 	{
85
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
86
-		$this->object->getSubManager( 'unknown' );
85
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
86
+		$this->object->getSubManager('unknown');
87 87
 	}
88 88
 
89 89
 	public function testCreateItem()
90 90
 	{
91
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() );
91
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem());
92 92
 	}
93 93
 
94 94
 	public function testGetItem()
95 95
 	{
96 96
 		$search = $this->object->createSearch();
97
-		$search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) );
97
+		$search->setConditions($search->compare('~=', 'customer.address.company', 'ABC GmbH'));
98 98
 
99
-		$items = $this->object->searchItems( $search );
99
+		$items = $this->object->searchItems($search);
100 100
 
101
-		if( ( $item = reset( $items ) ) === false ) {
102
-			throw new \Exception( 'No address item with company "ABC" found' );
101
+		if (($item = reset($items)) === false) {
102
+			throw new \Exception('No address item with company "ABC" found');
103 103
 		}
104 104
 
105
-		$this->assertEquals( $item, $this->object->getItem( $item->getId() ) );
105
+		$this->assertEquals($item, $this->object->getItem($item->getId()));
106 106
 	}
107 107
 
108 108
 	public function testSaveUpdateDeleteItem()
109 109
 	{
110
-		$item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture );
111
-		$item->setId( null );
112
-		$this->object->saveItem( $item );
113
-		$itemSaved = $this->object->getItem( $item->getId() );
110
+		$item = new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.', $this->fixture);
111
+		$item->setId(null);
112
+		$this->object->saveItem($item);
113
+		$itemSaved = $this->object->getItem($item->getId());
114 114
 
115 115
 		$itemExp = clone $itemSaved;
116
-		$itemExp->setPosition( 1 );
117
-		$itemExp->setCity( 'Berlin' );
118
-		$itemExp->setState( 'Berlin' );
119
-		$this->object->saveItem( $itemExp );
120
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
121
-
122
-		$this->object->deleteItem( $itemSaved->getId() );
123
-
124
-
125
-		$this->assertTrue( $item->getId() !== null );
126
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
127
-		$this->assertEquals( $item->getParentId(), $itemSaved->getParentId());
128
-		$this->assertEquals( $item->getPosition(), $itemSaved->getPosition());
129
-		$this->assertEquals( $item->getCompany(), $itemSaved->getCompany());
130
-		$this->assertEquals( $item->getVatID(), $itemSaved->getVatID());
131
-		$this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation());
132
-		$this->assertEquals( $item->getTitle(), $itemSaved->getTitle());
133
-		$this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname());
134
-		$this->assertEquals( $item->getLastname(), $itemSaved->getLastname());
135
-		$this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1());
136
-		$this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2());
137
-		$this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3());
138
-		$this->assertEquals( $item->getPostal(), $itemSaved->getPostal());
139
-		$this->assertEquals( $item->getCity(), $itemSaved->getCity());
140
-		$this->assertEquals( $item->getState(), $itemSaved->getState());
141
-		$this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId());
142
-		$this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId());
143
-		$this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone());
144
-		$this->assertEquals( $item->getEmail(), $itemSaved->getEmail());
145
-		$this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax());
146
-		$this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite());
147
-		$this->assertEquals( $item->getFlag(), $itemSaved->getFlag());
148
-
149
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
150
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
116
+		$itemExp->setPosition(1);
117
+		$itemExp->setCity('Berlin');
118
+		$itemExp->setState('Berlin');
119
+		$this->object->saveItem($itemExp);
120
+		$itemUpd = $this->object->getItem($itemExp->getId());
121
+
122
+		$this->object->deleteItem($itemSaved->getId());
123
+
124
+
125
+		$this->assertTrue($item->getId() !== null);
126
+		$this->assertEquals($item->getId(), $itemSaved->getId());
127
+		$this->assertEquals($item->getParentId(), $itemSaved->getParentId());
128
+		$this->assertEquals($item->getPosition(), $itemSaved->getPosition());
129
+		$this->assertEquals($item->getCompany(), $itemSaved->getCompany());
130
+		$this->assertEquals($item->getVatID(), $itemSaved->getVatID());
131
+		$this->assertEquals($item->getSalutation(), $itemSaved->getSalutation());
132
+		$this->assertEquals($item->getTitle(), $itemSaved->getTitle());
133
+		$this->assertEquals($item->getFirstname(), $itemSaved->getFirstname());
134
+		$this->assertEquals($item->getLastname(), $itemSaved->getLastname());
135
+		$this->assertEquals($item->getAddress1(), $itemSaved->getAddress1());
136
+		$this->assertEquals($item->getAddress2(), $itemSaved->getAddress2());
137
+		$this->assertEquals($item->getAddress3(), $itemSaved->getAddress3());
138
+		$this->assertEquals($item->getPostal(), $itemSaved->getPostal());
139
+		$this->assertEquals($item->getCity(), $itemSaved->getCity());
140
+		$this->assertEquals($item->getState(), $itemSaved->getState());
141
+		$this->assertEquals($item->getCountryId(), $itemSaved->getCountryId());
142
+		$this->assertEquals($item->getLanguageId(), $itemSaved->getLanguageId());
143
+		$this->assertEquals($item->getTelephone(), $itemSaved->getTelephone());
144
+		$this->assertEquals($item->getEmail(), $itemSaved->getEmail());
145
+		$this->assertEquals($item->getTelefax(), $itemSaved->getTelefax());
146
+		$this->assertEquals($item->getWebsite(), $itemSaved->getWebsite());
147
+		$this->assertEquals($item->getFlag(), $itemSaved->getFlag());
148
+
149
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
150
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
151 151
 		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
152 152
 
153
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
154
-		$this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId());
155
-		$this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition());
156
-		$this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany());
157
-		$this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID());
158
-		$this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation());
159
-		$this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle());
160
-		$this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname());
161
-		$this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname());
162
-		$this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1());
163
-		$this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2());
164
-		$this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3());
165
-		$this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal());
166
-		$this->assertEquals( $itemExp->getCity(), $itemUpd->getCity());
167
-		$this->assertEquals( $itemExp->getState(), $itemUpd->getState());
168
-		$this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId());
169
-		$this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId());
170
-		$this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone());
171
-		$this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail());
172
-		$this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax());
173
-		$this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite());
174
-		$this->assertEquals( $itemExp->getFlag(), $itemUpd->getFlag());
175
-
176
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
177
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
178
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
153
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
154
+		$this->assertEquals($itemExp->getParentId(), $itemUpd->getParentId());
155
+		$this->assertEquals($itemExp->getPosition(), $itemUpd->getPosition());
156
+		$this->assertEquals($itemExp->getCompany(), $itemUpd->getCompany());
157
+		$this->assertEquals($itemExp->getVatID(), $itemUpd->getVatID());
158
+		$this->assertEquals($itemExp->getSalutation(), $itemUpd->getSalutation());
159
+		$this->assertEquals($itemExp->getTitle(), $itemUpd->getTitle());
160
+		$this->assertEquals($itemExp->getFirstname(), $itemUpd->getFirstname());
161
+		$this->assertEquals($itemExp->getLastname(), $itemUpd->getLastname());
162
+		$this->assertEquals($itemExp->getAddress1(), $itemUpd->getAddress1());
163
+		$this->assertEquals($itemExp->getAddress2(), $itemUpd->getAddress2());
164
+		$this->assertEquals($itemExp->getAddress3(), $itemUpd->getAddress3());
165
+		$this->assertEquals($itemExp->getPostal(), $itemUpd->getPostal());
166
+		$this->assertEquals($itemExp->getCity(), $itemUpd->getCity());
167
+		$this->assertEquals($itemExp->getState(), $itemUpd->getState());
168
+		$this->assertEquals($itemExp->getCountryId(), $itemUpd->getCountryId());
169
+		$this->assertEquals($itemExp->getLanguageId(), $itemUpd->getLanguageId());
170
+		$this->assertEquals($itemExp->getTelephone(), $itemUpd->getTelephone());
171
+		$this->assertEquals($itemExp->getEmail(), $itemUpd->getEmail());
172
+		$this->assertEquals($itemExp->getTelefax(), $itemUpd->getTelefax());
173
+		$this->assertEquals($itemExp->getWebsite(), $itemUpd->getWebsite());
174
+		$this->assertEquals($itemExp->getFlag(), $itemUpd->getFlag());
175
+
176
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
177
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
178
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
179 179
 
180 180
 		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
181
-		$this->object->getItem( $itemSaved->getId() );
181
+		$this->object->getItem($itemSaved->getId());
182 182
 	}
183 183
 
184 184
 	public function testCreateSearch()
185 185
 	{
186
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() );
186
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch());
187 187
 	}
188 188
 
189 189
 
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
 		$search = $this->object->createSearch();
193 193
 
194 194
 		$conditions = array(
195
-			$search->compare( '==', 'customer.address.company', 'ABC' ),
196
-			$search->compare( '==', 'customer.address.editor', $this->editor )
195
+			$search->compare('==', 'customer.address.company', 'ABC'),
196
+			$search->compare('==', 'customer.address.editor', $this->editor)
197 197
 		);
198
-		$search->setConditions( $search->combine( '&&', $conditions ) );
199
-		$this->assertEquals( 1, count( $this->object->searchItems( $search ) ) );
198
+		$search->setConditions($search->combine('&&', $conditions));
199
+		$this->assertEquals(1, count($this->object->searchItems($search)));
200 200
 	}
201 201
 
202 202
 
@@ -206,20 +206,20 @@  discard block
 block discarded – undo
206 206
 		$search = $this->object->createSearch();
207 207
 
208 208
 		$conditions = array(
209
-			$search->compare( '~=', 'customer.address.company', 'ABC GmbH' ),
210
-			$search->compare( '==', 'customer.address.editor', $this->editor )
209
+			$search->compare('~=', 'customer.address.company', 'ABC GmbH'),
210
+			$search->compare('==', 'customer.address.editor', $this->editor)
211 211
 		);
212 212
 
213
-		$search->setConditions( $search->combine( '&&', $conditions ) );
214
-		$search->setSlice( 0, 1 );
213
+		$search->setConditions($search->combine('&&', $conditions));
214
+		$search->setSlice(0, 1);
215 215
 
216
-		$results = $this->object->searchItems( $search, array(), $total );
216
+		$results = $this->object->searchItems($search, array(), $total);
217 217
 
218
-		$this->assertEquals( 1, count( $results ) );
219
-		$this->assertEquals( 2, $total );
218
+		$this->assertEquals(1, count($results));
219
+		$this->assertEquals(2, $total);
220 220
 
221
-		foreach( $results as $id => $item ) {
222
-			$this->assertEquals( $id, $item->getId() );
221
+		foreach ($results as $id => $item) {
222
+			$this->assertEquals($id, $item->getId());
223 223
 		}
224 224
 	}
225 225
 }
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Lists/Type/EzpublishTest.php 2 patches
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -11,137 +11,137 @@
 block discarded – undo
11 11
 
12 12
 class EzpublishTest extends \PHPUnit_Framework_TestCase
13 13
 {
14
-	private $object;
15
-	private $editor = '';
14
+    private $object;
15
+    private $editor = '';
16 16
 
17 17
 
18
-	protected function setUp()
19
-	{
20
-		$this->editor = \TestHelper::getContext()->getEditor();
21
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' );
18
+    protected function setUp()
19
+    {
20
+        $this->editor = \TestHelper::getContext()->getEditor();
21
+        $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' );
22 22
 
23
-		$listManager = $manager->getSubManager( 'lists', 'Ezpublish' );
24
-		$this->object = $listManager->getSubManager( 'type', 'Ezpublish' );
25
-	}
23
+        $listManager = $manager->getSubManager( 'lists', 'Ezpublish' );
24
+        $this->object = $listManager->getSubManager( 'type', 'Ezpublish' );
25
+    }
26 26
 
27 27
 
28
-	protected function tearDown()
29
-	{
30
-		unset( $this->object );
31
-	}
28
+    protected function tearDown()
29
+    {
30
+        unset( $this->object );
31
+    }
32 32
 
33 33
 
34
-	public function testCleanup()
35
-	{
36
-		$this->object->cleanup( array( -1 ) );
37
-	}
34
+    public function testCleanup()
35
+    {
36
+        $this->object->cleanup( array( -1 ) );
37
+    }
38 38
 
39 39
 
40
-	public function testGetSubManager()
41
-	{
42
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
43
-		$this->object->getSubManager( 'unknown' );
44
-	}
40
+    public function testGetSubManager()
41
+    {
42
+        $this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
43
+        $this->object->getSubManager( 'unknown' );
44
+    }
45 45
 
46 46
 
47
-	public function testCreateItem()
48
-	{
49
-		$item = $this->object->createItem();
50
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item );
51
-	}
47
+    public function testCreateItem()
48
+    {
49
+        $item = $this->object->createItem();
50
+        $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item );
51
+    }
52 52
 
53 53
 
54
-	public function testGetItem()
55
-	{
56
-		$search = $this->object->createSearch();
57
-		$search->setSlice(0, 1);
58
-		$results = $this->object->searchItems($search);
54
+    public function testGetItem()
55
+    {
56
+        $search = $this->object->createSearch();
57
+        $search->setSlice(0, 1);
58
+        $results = $this->object->searchItems($search);
59 59
 
60
-		if( ( $expected = reset($results) ) === false ) {
61
-			throw new \Exception( 'No list type item found' );
62
-		}
60
+        if( ( $expected = reset($results) ) === false ) {
61
+            throw new \Exception( 'No list type item found' );
62
+        }
63 63
 
64
-		$this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) );
65
-	}
64
+        $this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) );
65
+    }
66 66
 
67 67
 
68
-	public function testSaveUpdateDeleteItem()
69
-	{
70
-		$search = $this->object->createSearch();
71
-		$search->setSlice(0, 1);
72
-		$results = $this->object->searchItems($search);
68
+    public function testSaveUpdateDeleteItem()
69
+    {
70
+        $search = $this->object->createSearch();
71
+        $search->setSlice(0, 1);
72
+        $results = $this->object->searchItems($search);
73 73
 
74
-		if( ( $item = reset($results) ) === false ) {
75
-			throw new \Exception( 'No type item found' );
76
-		}
74
+        if( ( $item = reset($results) ) === false ) {
75
+            throw new \Exception( 'No type item found' );
76
+        }
77 77
 
78
-		$item->setId(null);
79
-		$item->setCode( 'unitTestInit' );
80
-		$this->object->saveItem( $item );
81
-		$itemSaved = $this->object->getItem( $item->getId() );
78
+        $item->setId(null);
79
+        $item->setCode( 'unitTestInit' );
80
+        $this->object->saveItem( $item );
81
+        $itemSaved = $this->object->getItem( $item->getId() );
82 82
 
83
-		$itemExp = clone $itemSaved;
84
-		$itemExp->setCode( 'unitTestSave' );
85
-		$this->object->saveItem( $itemExp );
86
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
83
+        $itemExp = clone $itemSaved;
84
+        $itemExp->setCode( 'unitTestSave' );
85
+        $this->object->saveItem( $itemExp );
86
+        $itemUpd = $this->object->getItem( $itemExp->getId() );
87 87
 
88
-		$this->object->deleteItem( $itemSaved->getId() );
88
+        $this->object->deleteItem( $itemSaved->getId() );
89 89
 
90 90
 
91
-		$this->assertTrue( $item->getId() !== null );
92
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
93
-		$this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
94
-		$this->assertEquals( $item->getCode(), $itemSaved->getCode() );
95
-		$this->assertEquals( $item->getDomain(), $itemSaved->getDomain() );
96
-		$this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
97
-		$this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
91
+        $this->assertTrue( $item->getId() !== null );
92
+        $this->assertEquals( $item->getId(), $itemSaved->getId() );
93
+        $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
94
+        $this->assertEquals( $item->getCode(), $itemSaved->getCode() );
95
+        $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() );
96
+        $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
97
+        $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
98 98
 
99
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
100
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
101
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
99
+        $this->assertEquals( $this->editor, $itemSaved->getEditor() );
100
+        $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
101
+        $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
102 102
 
103
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
104
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
105
-		$this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
106
-		$this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() );
107
-		$this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
108
-		$this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
103
+        $this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
104
+        $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
105
+        $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
106
+        $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() );
107
+        $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
108
+        $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
109 109
 
110
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
111
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
112
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
110
+        $this->assertEquals( $this->editor, $itemUpd->getEditor() );
111
+        $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
112
+        $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
113 113
 
114
-		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
115
-		$this->object->getItem( $itemSaved->getId() );
116
-	}
114
+        $this->setExpectedException('\\Aimeos\\MShop\\Exception');
115
+        $this->object->getItem( $itemSaved->getId() );
116
+    }
117 117
 
118 118
 
119
-	public function testSearchItems()
120
-	{
121
-		$total = 0;
122
-		$search = $this->object->createSearch();
123
-
124
-		$expr = array();
125
-		$expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 );
126
-		$expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null );
127
-		$expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' );
128
-		$expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' );
129
-		$expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' );
130
-		$expr[] = $search->compare( '==', 'customer.lists.type.status', 1 );
131
-		$expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' );
132
-		$expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' );
133
-		$expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor );
134
-
135
-		$search->setConditions( $search->combine( '&&', $expr ) );
136
-		$search->setSlice(0, 1);
137
-
138
-		$results = $this->object->searchItems( $search, array(), $total );
139
-		$this->assertEquals( 1, count( $results ) );
140
-		$this->assertEquals( 1, $total );
141
-
142
-		foreach($results as $itemId => $item) {
143
-			$this->assertEquals( $itemId, $item->getId() );
144
-		}
145
-	}
119
+    public function testSearchItems()
120
+    {
121
+        $total = 0;
122
+        $search = $this->object->createSearch();
123
+
124
+        $expr = array();
125
+        $expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 );
126
+        $expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null );
127
+        $expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' );
128
+        $expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' );
129
+        $expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' );
130
+        $expr[] = $search->compare( '==', 'customer.lists.type.status', 1 );
131
+        $expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' );
132
+        $expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' );
133
+        $expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor );
134
+
135
+        $search->setConditions( $search->combine( '&&', $expr ) );
136
+        $search->setSlice(0, 1);
137
+
138
+        $results = $this->object->searchItems( $search, array(), $total );
139
+        $this->assertEquals( 1, count( $results ) );
140
+        $this->assertEquals( 1, $total );
141
+
142
+        foreach($results as $itemId => $item) {
143
+            $this->assertEquals( $itemId, $item->getId() );
144
+        }
145
+    }
146 146
 
147 147
 }
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -18,36 +18,36 @@  discard block
 block discarded – undo
18 18
 	protected function setUp()
19 19
 	{
20 20
 		$this->editor = \TestHelper::getContext()->getEditor();
21
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' );
21
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Ezpublish');
22 22
 
23
-		$listManager = $manager->getSubManager( 'lists', 'Ezpublish' );
24
-		$this->object = $listManager->getSubManager( 'type', 'Ezpublish' );
23
+		$listManager = $manager->getSubManager('lists', 'Ezpublish');
24
+		$this->object = $listManager->getSubManager('type', 'Ezpublish');
25 25
 	}
26 26
 
27 27
 
28 28
 	protected function tearDown()
29 29
 	{
30
-		unset( $this->object );
30
+		unset($this->object);
31 31
 	}
32 32
 
33 33
 
34 34
 	public function testCleanup()
35 35
 	{
36
-		$this->object->cleanup( array( -1 ) );
36
+		$this->object->cleanup(array( -1 ));
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testGetSubManager()
41 41
 	{
42
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
43
-		$this->object->getSubManager( 'unknown' );
42
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
43
+		$this->object->getSubManager('unknown');
44 44
 	}
45 45
 
46 46
 
47 47
 	public function testCreateItem()
48 48
 	{
49 49
 		$item = $this->object->createItem();
50
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item );
50
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item);
51 51
 	}
52 52
 
53 53
 
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 		$search->setSlice(0, 1);
58 58
 		$results = $this->object->searchItems($search);
59 59
 
60
-		if( ( $expected = reset($results) ) === false ) {
61
-			throw new \Exception( 'No list type item found' );
60
+		if (($expected = reset($results)) === false) {
61
+			throw new \Exception('No list type item found');
62 62
 		}
63 63
 
64
-		$this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) );
64
+		$this->assertEquals($expected, $this->object->getItem($expected->getId()));
65 65
 	}
66 66
 
67 67
 
@@ -71,48 +71,48 @@  discard block
 block discarded – undo
71 71
 		$search->setSlice(0, 1);
72 72
 		$results = $this->object->searchItems($search);
73 73
 
74
-		if( ( $item = reset($results) ) === false ) {
75
-			throw new \Exception( 'No type item found' );
74
+		if (($item = reset($results)) === false) {
75
+			throw new \Exception('No type item found');
76 76
 		}
77 77
 
78 78
 		$item->setId(null);
79
-		$item->setCode( 'unitTestInit' );
80
-		$this->object->saveItem( $item );
81
-		$itemSaved = $this->object->getItem( $item->getId() );
79
+		$item->setCode('unitTestInit');
80
+		$this->object->saveItem($item);
81
+		$itemSaved = $this->object->getItem($item->getId());
82 82
 
83 83
 		$itemExp = clone $itemSaved;
84
-		$itemExp->setCode( 'unitTestSave' );
85
-		$this->object->saveItem( $itemExp );
86
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
84
+		$itemExp->setCode('unitTestSave');
85
+		$this->object->saveItem($itemExp);
86
+		$itemUpd = $this->object->getItem($itemExp->getId());
87 87
 
88
-		$this->object->deleteItem( $itemSaved->getId() );
88
+		$this->object->deleteItem($itemSaved->getId());
89 89
 
90 90
 
91
-		$this->assertTrue( $item->getId() !== null );
92
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
93
-		$this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
94
-		$this->assertEquals( $item->getCode(), $itemSaved->getCode() );
95
-		$this->assertEquals( $item->getDomain(), $itemSaved->getDomain() );
96
-		$this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
97
-		$this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
91
+		$this->assertTrue($item->getId() !== null);
92
+		$this->assertEquals($item->getId(), $itemSaved->getId());
93
+		$this->assertEquals($item->getSiteId(), $itemSaved->getSiteId());
94
+		$this->assertEquals($item->getCode(), $itemSaved->getCode());
95
+		$this->assertEquals($item->getDomain(), $itemSaved->getDomain());
96
+		$this->assertEquals($item->getLabel(), $itemSaved->getLabel());
97
+		$this->assertEquals($item->getStatus(), $itemSaved->getStatus());
98 98
 
99
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
100
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
101
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
99
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
100
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
101
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
102 102
 
103
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
104
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
105
-		$this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
106
-		$this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() );
107
-		$this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
108
-		$this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
103
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
104
+		$this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId());
105
+		$this->assertEquals($itemExp->getCode(), $itemUpd->getCode());
106
+		$this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain());
107
+		$this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel());
108
+		$this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus());
109 109
 
110
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
111
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
112
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
110
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
111
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
112
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
113 113
 
114 114
 		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
115
-		$this->object->getItem( $itemSaved->getId() );
115
+		$this->object->getItem($itemSaved->getId());
116 116
 	}
117 117
 
118 118
 
@@ -122,25 +122,25 @@  discard block
 block discarded – undo
122 122
 		$search = $this->object->createSearch();
123 123
 
124 124
 		$expr = array();
125
-		$expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 );
126
-		$expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null );
127
-		$expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' );
128
-		$expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' );
129
-		$expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' );
130
-		$expr[] = $search->compare( '==', 'customer.lists.type.status', 1 );
131
-		$expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' );
132
-		$expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' );
133
-		$expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor );
134
-
135
-		$search->setConditions( $search->combine( '&&', $expr ) );
125
+		$expr[] = $search->compare('!=', 'customer.lists.type.id', 0);
126
+		$expr[] = $search->compare('!=', 'customer.lists.type.siteid', null);
127
+		$expr[] = $search->compare('==', 'customer.lists.type.code', 'default');
128
+		$expr[] = $search->compare('==', 'customer.lists.type.domain', 'text');
129
+		$expr[] = $search->compare('==', 'customer.lists.type.label', 'Standard');
130
+		$expr[] = $search->compare('==', 'customer.lists.type.status', 1);
131
+		$expr[] = $search->compare('>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00');
132
+		$expr[] = $search->compare('>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00');
133
+		$expr[] = $search->compare('==', 'customer.lists.type.editor', $this->editor);
134
+
135
+		$search->setConditions($search->combine('&&', $expr));
136 136
 		$search->setSlice(0, 1);
137 137
 
138
-		$results = $this->object->searchItems( $search, array(), $total );
139
-		$this->assertEquals( 1, count( $results ) );
140
-		$this->assertEquals( 1, $total );
138
+		$results = $this->object->searchItems($search, array(), $total);
139
+		$this->assertEquals(1, count($results));
140
+		$this->assertEquals(1, $total);
141 141
 
142
-		foreach($results as $itemId => $item) {
143
-			$this->assertEquals( $itemId, $item->getId() );
142
+		foreach ($results as $itemId => $item) {
143
+			$this->assertEquals($itemId, $item->getId());
144 144
 		}
145 145
 	}
146 146
 
Please login to merge, or discard this patch.
lib/custom/setup/default/schema/customer.php 2 patches
Indentation   +134 added lines, -134 removed lines patch added patch discarded remove patch
@@ -7,138 +7,138 @@
 block discarded – undo
7 7
 
8 8
 
9 9
 return array(
10
-	'table' => array(
11
-		'ezuser' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
12
-
13
-			$table = $schema->createTable( 'ezuser' );
14
-
15
-			$table->addColumn( 'contentobject_id', 'integer', array() );
16
-			$table->addColumn( 'email', 'string', array( 'length' => 150 ) );
17
-			$table->addColumn( 'login', 'string', array( 'length' => 150 ) );
18
-			$table->addColumn( 'login_normalized', 'string', array( 'length' => 150 ) );
19
-			$table->addColumn( 'password_hash', 'string', array( 'length' => 50 ) );
20
-			$table->addColumn( 'password_hash_type', 'integer', array( 'default' => 1 ) );
21
-
22
-			$table->setPrimaryKey( array( 'contentobject_id' ) );
23
-			$table->addUniqueIndex( array( 'login_normalized' ), 'ezuser_login' );
24
-
25
-			return $schema;
26
-		},
27
-
28
-		'ezuser_setting' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
29
-
30
-			$table = $schema->createTable( 'ezuser_setting' );
31
-
32
-			$table->addColumn( 'is_enabled', 'integer', array() );
33
-			$table->addColumn( 'max_login', 'integer', array( 'notnull' => false ) );
34
-			$table->addColumn( 'user_id', 'integer', array() );
35
-
36
-			$table->setPrimaryKey( array( 'user_id' ) );
37
-
38
-			return $schema;
39
-		},
40
-
41
-		'ezuser_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
42
-
43
-			$table = $schema->createTable( 'ezuser_address' );
44
-
45
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
46
-			$table->addColumn( 'siteid', 'integer', array() );
47
-			$table->addColumn( 'parentid', 'integer', array() );
48
-			$table->addColumn( 'company', 'string', array( 'length' => 100 ) );
49
-			$table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
50
-			$table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
51
-			$table->addColumn( 'title', 'string', array( 'length' => 64 ) );
52
-			$table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
53
-			$table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
54
-			$table->addColumn( 'address1', 'string', array( 'length' => 255 ) );
55
-			$table->addColumn( 'address2', 'string', array( 'length' => 255 ) );
56
-			$table->addColumn( 'address3', 'string', array( 'length' => 255 ) );
57
-			$table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
58
-			$table->addColumn( 'city', 'string', array( 'length' => 255 ) );
59
-			$table->addColumn( 'state', 'string', array( 'length' => 255 ) );
60
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
61
-			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
62
-			$table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
63
-			$table->addColumn( 'email', 'string', array( 'length' => 255 ) );
64
-			$table->addColumn( 'telefax', 'string', array( 'length' => 255 ) );
65
-			$table->addColumn( 'website', 'string', array( 'length' => 255 ) );
66
-			$table->addColumn( 'flag', 'integer', array() );
67
-			$table->addColumn( 'pos', 'smallint', array() );
68
-			$table->addColumn( 'mtime', 'datetime', array() );
69
-			$table->addColumn( 'ctime', 'datetime', array() );
70
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
71
-
72
-			$table->setPrimaryKey( array( 'id' ), 'pk_ezpad_id' );
73
-			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_ezpad_ln_fn' );
74
-			$table->addIndex( array( 'address1', 'address2' ), 'idx_ezpad_ad1_ad2' );
75
-			$table->addIndex( array( 'postal', 'city' ), 'idx_ezpad_post_ci' );
76
-			$table->addIndex( array( 'parentid' ), 'idx_ezpad_pid' );
77
-			$table->addIndex( array( 'city' ), 'idx_ezpad_city' );
78
-
79
-			$table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ),
80
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpad_pid' );
81
-
82
-			return $schema;
83
-		},
84
-
85
-		'ezuser_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
86
-
87
-			$table = $schema->createTable( 'ezuser_list_type' );
88
-
89
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
90
-			$table->addColumn( 'siteid', 'integer', array() );
91
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
92
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
93
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
94
-			$table->addColumn( 'status', 'smallint', array() );
95
-			$table->addColumn( 'mtime', 'datetime', array() );
96
-			$table->addColumn( 'ctime', 'datetime', array() );
97
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
98
-
99
-			$table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' );
100
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' );
101
-			$table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' );
102
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' );
103
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' );
104
-
105
-			return $schema;
106
-		},
107
-
108
-		'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
109
-
110
-			$table = $schema->createTable( 'ezuser_list' );
111
-
112
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
113
-			$table->addColumn( 'parentid', 'integer', array() );
114
-			$table->addColumn( 'siteid', 'integer', array() );
115
-			$table->addColumn( 'typeid', 'integer', array() );
116
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
117
-			$table->addColumn( 'refid', 'string', array( 'length' => 32 ) );
118
-			$table->addColumn( 'start', 'datetime', array( 'notnull' => false ) );
119
-			$table->addColumn( 'end', 'datetime', array( 'notnull' => false ) );
120
-			$table->addColumn( 'config', 'text', array( 'length' => 0xffff ) );
121
-			$table->addColumn( 'pos', 'integer', array() );
122
-			$table->addColumn( 'status', 'smallint', array() );
123
-			$table->addColumn( 'mtime', 'datetime', array() );
124
-			$table->addColumn( 'ctime', 'datetime', array() );
125
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
126
-
127
-			$table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' );
128
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' );
129
-			$table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' );
130
-			$table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' );
131
-			$table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' );
132
-			$table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' );
133
-			$table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' );
134
-
135
-			$table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ),
136
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' );
137
-
138
-			$table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ),
139
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' );
140
-
141
-			return $schema;
142
-		},
143
-	),
10
+    'table' => array(
11
+        'ezuser' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
12
+
13
+            $table = $schema->createTable( 'ezuser' );
14
+
15
+            $table->addColumn( 'contentobject_id', 'integer', array() );
16
+            $table->addColumn( 'email', 'string', array( 'length' => 150 ) );
17
+            $table->addColumn( 'login', 'string', array( 'length' => 150 ) );
18
+            $table->addColumn( 'login_normalized', 'string', array( 'length' => 150 ) );
19
+            $table->addColumn( 'password_hash', 'string', array( 'length' => 50 ) );
20
+            $table->addColumn( 'password_hash_type', 'integer', array( 'default' => 1 ) );
21
+
22
+            $table->setPrimaryKey( array( 'contentobject_id' ) );
23
+            $table->addUniqueIndex( array( 'login_normalized' ), 'ezuser_login' );
24
+
25
+            return $schema;
26
+        },
27
+
28
+        'ezuser_setting' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
29
+
30
+            $table = $schema->createTable( 'ezuser_setting' );
31
+
32
+            $table->addColumn( 'is_enabled', 'integer', array() );
33
+            $table->addColumn( 'max_login', 'integer', array( 'notnull' => false ) );
34
+            $table->addColumn( 'user_id', 'integer', array() );
35
+
36
+            $table->setPrimaryKey( array( 'user_id' ) );
37
+
38
+            return $schema;
39
+        },
40
+
41
+        'ezuser_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
42
+
43
+            $table = $schema->createTable( 'ezuser_address' );
44
+
45
+            $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
46
+            $table->addColumn( 'siteid', 'integer', array() );
47
+            $table->addColumn( 'parentid', 'integer', array() );
48
+            $table->addColumn( 'company', 'string', array( 'length' => 100 ) );
49
+            $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
50
+            $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
51
+            $table->addColumn( 'title', 'string', array( 'length' => 64 ) );
52
+            $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
53
+            $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
54
+            $table->addColumn( 'address1', 'string', array( 'length' => 255 ) );
55
+            $table->addColumn( 'address2', 'string', array( 'length' => 255 ) );
56
+            $table->addColumn( 'address3', 'string', array( 'length' => 255 ) );
57
+            $table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
58
+            $table->addColumn( 'city', 'string', array( 'length' => 255 ) );
59
+            $table->addColumn( 'state', 'string', array( 'length' => 255 ) );
60
+            $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
61
+            $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
62
+            $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
63
+            $table->addColumn( 'email', 'string', array( 'length' => 255 ) );
64
+            $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) );
65
+            $table->addColumn( 'website', 'string', array( 'length' => 255 ) );
66
+            $table->addColumn( 'flag', 'integer', array() );
67
+            $table->addColumn( 'pos', 'smallint', array() );
68
+            $table->addColumn( 'mtime', 'datetime', array() );
69
+            $table->addColumn( 'ctime', 'datetime', array() );
70
+            $table->addColumn( 'editor', 'string', array('length' => 255 ) );
71
+
72
+            $table->setPrimaryKey( array( 'id' ), 'pk_ezpad_id' );
73
+            $table->addIndex( array( 'lastname', 'firstname' ), 'idx_ezpad_ln_fn' );
74
+            $table->addIndex( array( 'address1', 'address2' ), 'idx_ezpad_ad1_ad2' );
75
+            $table->addIndex( array( 'postal', 'city' ), 'idx_ezpad_post_ci' );
76
+            $table->addIndex( array( 'parentid' ), 'idx_ezpad_pid' );
77
+            $table->addIndex( array( 'city' ), 'idx_ezpad_city' );
78
+
79
+            $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ),
80
+                array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpad_pid' );
81
+
82
+            return $schema;
83
+        },
84
+
85
+        'ezuser_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
86
+
87
+            $table = $schema->createTable( 'ezuser_list_type' );
88
+
89
+            $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
90
+            $table->addColumn( 'siteid', 'integer', array() );
91
+            $table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
92
+            $table->addColumn( 'code', 'string', array( 'length' => 32 ) );
93
+            $table->addColumn( 'label', 'string', array( 'length' => 255 ) );
94
+            $table->addColumn( 'status', 'smallint', array() );
95
+            $table->addColumn( 'mtime', 'datetime', array() );
96
+            $table->addColumn( 'ctime', 'datetime', array() );
97
+            $table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
98
+
99
+            $table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' );
100
+            $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' );
101
+            $table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' );
102
+            $table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' );
103
+            $table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' );
104
+
105
+            return $schema;
106
+        },
107
+
108
+        'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
109
+
110
+            $table = $schema->createTable( 'ezuser_list' );
111
+
112
+            $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
113
+            $table->addColumn( 'parentid', 'integer', array() );
114
+            $table->addColumn( 'siteid', 'integer', array() );
115
+            $table->addColumn( 'typeid', 'integer', array() );
116
+            $table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
117
+            $table->addColumn( 'refid', 'string', array( 'length' => 32 ) );
118
+            $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) );
119
+            $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) );
120
+            $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) );
121
+            $table->addColumn( 'pos', 'integer', array() );
122
+            $table->addColumn( 'status', 'smallint', array() );
123
+            $table->addColumn( 'mtime', 'datetime', array() );
124
+            $table->addColumn( 'ctime', 'datetime', array() );
125
+            $table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
126
+
127
+            $table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' );
128
+            $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' );
129
+            $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' );
130
+            $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' );
131
+            $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' );
132
+            $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' );
133
+            $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' );
134
+
135
+            $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ),
136
+                array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' );
137
+
138
+            $table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ),
139
+                array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' );
140
+
141
+            return $schema;
142
+        },
143
+    ),
144 144
 );
Please login to merge, or discard this patch.
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -8,135 +8,135 @@
 block discarded – undo
8 8
 
9 9
 return array(
10 10
 	'table' => array(
11
-		'ezuser' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
11
+		'ezuser' => function(\Doctrine\DBAL\Schema\Schema $schema) {
12 12
 
13
-			$table = $schema->createTable( 'ezuser' );
13
+			$table = $schema->createTable('ezuser');
14 14
 
15
-			$table->addColumn( 'contentobject_id', 'integer', array() );
16
-			$table->addColumn( 'email', 'string', array( 'length' => 150 ) );
17
-			$table->addColumn( 'login', 'string', array( 'length' => 150 ) );
18
-			$table->addColumn( 'login_normalized', 'string', array( 'length' => 150 ) );
19
-			$table->addColumn( 'password_hash', 'string', array( 'length' => 50 ) );
20
-			$table->addColumn( 'password_hash_type', 'integer', array( 'default' => 1 ) );
15
+			$table->addColumn('contentobject_id', 'integer', array());
16
+			$table->addColumn('email', 'string', array('length' => 150));
17
+			$table->addColumn('login', 'string', array('length' => 150));
18
+			$table->addColumn('login_normalized', 'string', array('length' => 150));
19
+			$table->addColumn('password_hash', 'string', array('length' => 50));
20
+			$table->addColumn('password_hash_type', 'integer', array('default' => 1));
21 21
 
22
-			$table->setPrimaryKey( array( 'contentobject_id' ) );
23
-			$table->addUniqueIndex( array( 'login_normalized' ), 'ezuser_login' );
22
+			$table->setPrimaryKey(array('contentobject_id'));
23
+			$table->addUniqueIndex(array('login_normalized'), 'ezuser_login');
24 24
 
25 25
 			return $schema;
26 26
 		},
27 27
 
28
-		'ezuser_setting' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
28
+		'ezuser_setting' => function(\Doctrine\DBAL\Schema\Schema $schema) {
29 29
 
30
-			$table = $schema->createTable( 'ezuser_setting' );
30
+			$table = $schema->createTable('ezuser_setting');
31 31
 
32
-			$table->addColumn( 'is_enabled', 'integer', array() );
33
-			$table->addColumn( 'max_login', 'integer', array( 'notnull' => false ) );
34
-			$table->addColumn( 'user_id', 'integer', array() );
32
+			$table->addColumn('is_enabled', 'integer', array());
33
+			$table->addColumn('max_login', 'integer', array('notnull' => false));
34
+			$table->addColumn('user_id', 'integer', array());
35 35
 
36
-			$table->setPrimaryKey( array( 'user_id' ) );
36
+			$table->setPrimaryKey(array('user_id'));
37 37
 
38 38
 			return $schema;
39 39
 		},
40 40
 
41
-		'ezuser_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
42
-
43
-			$table = $schema->createTable( 'ezuser_address' );
44
-
45
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
46
-			$table->addColumn( 'siteid', 'integer', array() );
47
-			$table->addColumn( 'parentid', 'integer', array() );
48
-			$table->addColumn( 'company', 'string', array( 'length' => 100 ) );
49
-			$table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
50
-			$table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
51
-			$table->addColumn( 'title', 'string', array( 'length' => 64 ) );
52
-			$table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
53
-			$table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
54
-			$table->addColumn( 'address1', 'string', array( 'length' => 255 ) );
55
-			$table->addColumn( 'address2', 'string', array( 'length' => 255 ) );
56
-			$table->addColumn( 'address3', 'string', array( 'length' => 255 ) );
57
-			$table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
58
-			$table->addColumn( 'city', 'string', array( 'length' => 255 ) );
59
-			$table->addColumn( 'state', 'string', array( 'length' => 255 ) );
60
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
61
-			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
62
-			$table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
63
-			$table->addColumn( 'email', 'string', array( 'length' => 255 ) );
64
-			$table->addColumn( 'telefax', 'string', array( 'length' => 255 ) );
65
-			$table->addColumn( 'website', 'string', array( 'length' => 255 ) );
66
-			$table->addColumn( 'flag', 'integer', array() );
67
-			$table->addColumn( 'pos', 'smallint', array() );
68
-			$table->addColumn( 'mtime', 'datetime', array() );
69
-			$table->addColumn( 'ctime', 'datetime', array() );
70
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
71
-
72
-			$table->setPrimaryKey( array( 'id' ), 'pk_ezpad_id' );
73
-			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_ezpad_ln_fn' );
74
-			$table->addIndex( array( 'address1', 'address2' ), 'idx_ezpad_ad1_ad2' );
75
-			$table->addIndex( array( 'postal', 'city' ), 'idx_ezpad_post_ci' );
76
-			$table->addIndex( array( 'parentid' ), 'idx_ezpad_pid' );
77
-			$table->addIndex( array( 'city' ), 'idx_ezpad_city' );
78
-
79
-			$table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ),
80
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpad_pid' );
41
+		'ezuser_address' => function(\Doctrine\DBAL\Schema\Schema $schema) {
42
+
43
+			$table = $schema->createTable('ezuser_address');
44
+
45
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
46
+			$table->addColumn('siteid', 'integer', array());
47
+			$table->addColumn('parentid', 'integer', array());
48
+			$table->addColumn('company', 'string', array('length' => 100));
49
+			$table->addColumn('vatid', 'string', array('length' => 32));
50
+			$table->addColumn('salutation', 'string', array('length' => 8));
51
+			$table->addColumn('title', 'string', array('length' => 64));
52
+			$table->addColumn('firstname', 'string', array('length' => 64));
53
+			$table->addColumn('lastname', 'string', array('length' => 64));
54
+			$table->addColumn('address1', 'string', array('length' => 255));
55
+			$table->addColumn('address2', 'string', array('length' => 255));
56
+			$table->addColumn('address3', 'string', array('length' => 255));
57
+			$table->addColumn('postal', 'string', array('length' => 16));
58
+			$table->addColumn('city', 'string', array('length' => 255));
59
+			$table->addColumn('state', 'string', array('length' => 255));
60
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
61
+			$table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true));
62
+			$table->addColumn('telephone', 'string', array('length' => 32));
63
+			$table->addColumn('email', 'string', array('length' => 255));
64
+			$table->addColumn('telefax', 'string', array('length' => 255));
65
+			$table->addColumn('website', 'string', array('length' => 255));
66
+			$table->addColumn('flag', 'integer', array());
67
+			$table->addColumn('pos', 'smallint', array());
68
+			$table->addColumn('mtime', 'datetime', array());
69
+			$table->addColumn('ctime', 'datetime', array());
70
+			$table->addColumn('editor', 'string', array('length' => 255));
71
+
72
+			$table->setPrimaryKey(array('id'), 'pk_ezpad_id');
73
+			$table->addIndex(array('lastname', 'firstname'), 'idx_ezpad_ln_fn');
74
+			$table->addIndex(array('address1', 'address2'), 'idx_ezpad_ad1_ad2');
75
+			$table->addIndex(array('postal', 'city'), 'idx_ezpad_post_ci');
76
+			$table->addIndex(array('parentid'), 'idx_ezpad_pid');
77
+			$table->addIndex(array('city'), 'idx_ezpad_city');
78
+
79
+			$table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'),
80
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpad_pid');
81 81
 
82 82
 			return $schema;
83 83
 		},
84 84
 
85
-		'ezuser_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
85
+		'ezuser_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) {
86 86
 
87
-			$table = $schema->createTable( 'ezuser_list_type' );
87
+			$table = $schema->createTable('ezuser_list_type');
88 88
 
89
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
90
-			$table->addColumn( 'siteid', 'integer', array() );
91
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
92
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
93
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
94
-			$table->addColumn( 'status', 'smallint', array() );
95
-			$table->addColumn( 'mtime', 'datetime', array() );
96
-			$table->addColumn( 'ctime', 'datetime', array() );
97
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
89
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
90
+			$table->addColumn('siteid', 'integer', array());
91
+			$table->addColumn('domain', 'string', array('length' => 32));
92
+			$table->addColumn('code', 'string', array('length' => 32));
93
+			$table->addColumn('label', 'string', array('length' => 255));
94
+			$table->addColumn('status', 'smallint', array());
95
+			$table->addColumn('mtime', 'datetime', array());
96
+			$table->addColumn('ctime', 'datetime', array());
97
+			$table->addColumn('editor', 'string', array('length' => 255));
98 98
 
99
-			$table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' );
100
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' );
101
-			$table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' );
102
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' );
103
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' );
99
+			$table->setPrimaryKey(array('id'), 'pk_ezplity_id');
100
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_ezplity_sid_dom_code');
101
+			$table->addIndex(array('siteid', 'status'), 'idx_ezplity_sid_status');
102
+			$table->addIndex(array('siteid', 'label'), 'idx_ezplity_sid_label');
103
+			$table->addIndex(array('siteid', 'code'), 'idx_ezplity_sid_code');
104 104
 
105 105
 			return $schema;
106 106
 		},
107 107
 
108
-		'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
109
-
110
-			$table = $schema->createTable( 'ezuser_list' );
111
-
112
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
113
-			$table->addColumn( 'parentid', 'integer', array() );
114
-			$table->addColumn( 'siteid', 'integer', array() );
115
-			$table->addColumn( 'typeid', 'integer', array() );
116
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
117
-			$table->addColumn( 'refid', 'string', array( 'length' => 32 ) );
118
-			$table->addColumn( 'start', 'datetime', array( 'notnull' => false ) );
119
-			$table->addColumn( 'end', 'datetime', array( 'notnull' => false ) );
120
-			$table->addColumn( 'config', 'text', array( 'length' => 0xffff ) );
121
-			$table->addColumn( 'pos', 'integer', array() );
122
-			$table->addColumn( 'status', 'smallint', array() );
123
-			$table->addColumn( 'mtime', 'datetime', array() );
124
-			$table->addColumn( 'ctime', 'datetime', array() );
125
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
126
-
127
-			$table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' );
128
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' );
129
-			$table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' );
130
-			$table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' );
131
-			$table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' );
132
-			$table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' );
133
-			$table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' );
134
-
135
-			$table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ),
136
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' );
137
-
138
-			$table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ),
139
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' );
108
+		'ezuser_list' => function(\Doctrine\DBAL\Schema\Schema $schema) {
109
+
110
+			$table = $schema->createTable('ezuser_list');
111
+
112
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
113
+			$table->addColumn('parentid', 'integer', array());
114
+			$table->addColumn('siteid', 'integer', array());
115
+			$table->addColumn('typeid', 'integer', array());
116
+			$table->addColumn('domain', 'string', array('length' => 32));
117
+			$table->addColumn('refid', 'string', array('length' => 32));
118
+			$table->addColumn('start', 'datetime', array('notnull' => false));
119
+			$table->addColumn('end', 'datetime', array('notnull' => false));
120
+			$table->addColumn('config', 'text', array('length' => 0xffff));
121
+			$table->addColumn('pos', 'integer', array());
122
+			$table->addColumn('status', 'smallint', array());
123
+			$table->addColumn('mtime', 'datetime', array());
124
+			$table->addColumn('ctime', 'datetime', array());
125
+			$table->addColumn('editor', 'string', array('length' => 255));
126
+
127
+			$table->setPrimaryKey(array('id'), 'pk_ezpli_id');
128
+			$table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_ezpli_sid_dm_rid_tid_pid');
129
+			$table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_ezpli_sid_stat_start_end');
130
+			$table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_ezpli_pid_sid_rid_dom_tid');
131
+			$table->addIndex(array('parentid', 'siteid', 'start'), 'idx_ezpli_pid_sid_start');
132
+			$table->addIndex(array('parentid', 'siteid', 'end'), 'idx_ezpli_pid_sid_end');
133
+			$table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_ezpli_pid_sid_pos');
134
+
135
+			$table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'),
136
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_pid');
137
+
138
+			$table->addForeignKeyConstraint('ezuser_list_type', array('typeid'), array('id'),
139
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_typeid');
140 140
 
141 141
 			return $schema;
142 142
 		},
Please login to merge, or discard this patch.
lib/custom/src/MShop/Common/Item/Helper/Password/Ezpublish.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,15 +19,15 @@
 block discarded – undo
19 19
  */
20 20
 class Ezpublish implements \Aimeos\MShop\Common\Item\Helper\Password\Iface
21 21
 {
22
-	/**
23
-	 * Returns the hashed password
24
-	 *
25
-	 * @param string $password Clear text password string
26
-	 * @param string|null $salt Password salt
27
-	 * @return string Hashed password
28
-	 */
29
-	public function encode( $password, $salt = null )
30
-	{
31
-		return md5( $salt . "\n" . $password );
32
-	}
22
+    /**
23
+     * Returns the hashed password
24
+     *
25
+     * @param string $password Clear text password string
26
+     * @param string|null $salt Password salt
27
+     * @return string Hashed password
28
+     */
29
+    public function encode( $password, $salt = null )
30
+    {
31
+        return md5( $salt . "\n" . $password );
32
+    }
33 33
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
 	 * @param string|null $salt Password salt
27 27
 	 * @return string Hashed password
28 28
 	 */
29
-	public function encode( $password, $salt = null )
29
+	public function encode($password, $salt = null)
30 30
 	{
31
-		return md5( $salt . "\n" . $password );
31
+		return md5($salt."\n".$password);
32 32
 	}
33 33
 }
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Item/Ezpublish.php 2 patches
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -19,62 +19,62 @@
 block discarded – undo
19 19
  */
20 20
 class Ezpublish extends Standard implements Iface
21 21
 {
22
-	private $password = '';
23
-	private $helper;
24
-
25
-
26
-	/**
27
-	 * Initializes the customer item object
28
-	 *
29
-	 * @param \Aimeos\MShop\Common\Item\Address\Iface $address Payment address item object
30
-	 * @param array $values List of attributes that belong to the customer item
31
-	 * @param \Aimeos\MShop\Common\Lists\Item\Iface[] $listItems List of list items
32
-	 * @param \Aimeos\MShop\Common\Item\Iface[] $refItems List of referenced items
33
-	 * @param string $salt Password salt (optional)
34
-	 * @param \Aimeos\MShop\Common\Item\Helper\Password\Iface|null $helper Password encryption helper object
35
-	 */
36
-	public function __construct( \Aimeos\MShop\Common\Item\Address\Iface $address, array $values = array(),
37
-		array $listItems = array(), array $refItems = array(), $salt = '',
38
-		\Aimeos\MShop\Common\Item\Helper\Password\Iface $helper = null )
39
-	{
40
-		parent::__construct( $address, $values, $listItems, $refItems );
41
-
42
-		if( isset( $values['customer.password'] ) ) {
43
-			$this->password = $values['customer.password'];
44
-		}
45
-
46
-		$this->helper = $helper;
47
-	}
48
-
49
-
50
-	/**
51
-	 * Returns the password of the customer item
52
-	 *
53
-	 * @return string
54
-	 */
55
-	public function getPassword()
56
-	{
57
-		return $this->password;
58
-	}
59
-
60
-
61
-	/**
62
-	 * Sets the password of the customer item
63
-	 *
64
-	 * @param string $value password of the customer item
65
-	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item for chaining method calls
66
-	 */
67
-	public function setPassword( $value )
68
-	{
69
-		if( $value == $this->getPassword() ) { return $this; }
70
-
71
-		if( $this->helper !== null ) {
72
-			$value = $this->helper->encode( $value, $this->getCode() );
73
-		}
74
-
75
-		$this->password = (string) $value;
76
-		$this->setModified();
77
-
78
-		return $this;
79
-	}
22
+    private $password = '';
23
+    private $helper;
24
+
25
+
26
+    /**
27
+     * Initializes the customer item object
28
+     *
29
+     * @param \Aimeos\MShop\Common\Item\Address\Iface $address Payment address item object
30
+     * @param array $values List of attributes that belong to the customer item
31
+     * @param \Aimeos\MShop\Common\Lists\Item\Iface[] $listItems List of list items
32
+     * @param \Aimeos\MShop\Common\Item\Iface[] $refItems List of referenced items
33
+     * @param string $salt Password salt (optional)
34
+     * @param \Aimeos\MShop\Common\Item\Helper\Password\Iface|null $helper Password encryption helper object
35
+     */
36
+    public function __construct( \Aimeos\MShop\Common\Item\Address\Iface $address, array $values = array(),
37
+        array $listItems = array(), array $refItems = array(), $salt = '',
38
+        \Aimeos\MShop\Common\Item\Helper\Password\Iface $helper = null )
39
+    {
40
+        parent::__construct( $address, $values, $listItems, $refItems );
41
+
42
+        if( isset( $values['customer.password'] ) ) {
43
+            $this->password = $values['customer.password'];
44
+        }
45
+
46
+        $this->helper = $helper;
47
+    }
48
+
49
+
50
+    /**
51
+     * Returns the password of the customer item
52
+     *
53
+     * @return string
54
+     */
55
+    public function getPassword()
56
+    {
57
+        return $this->password;
58
+    }
59
+
60
+
61
+    /**
62
+     * Sets the password of the customer item
63
+     *
64
+     * @param string $value password of the customer item
65
+     * @return \Aimeos\MShop\Customer\Item\Iface Customer item for chaining method calls
66
+     */
67
+    public function setPassword( $value )
68
+    {
69
+        if( $value == $this->getPassword() ) { return $this; }
70
+
71
+        if( $this->helper !== null ) {
72
+            $value = $this->helper->encode( $value, $this->getCode() );
73
+        }
74
+
75
+        $this->password = (string) $value;
76
+        $this->setModified();
77
+
78
+        return $this;
79
+    }
80 80
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 	 * @param string $salt Password salt (optional)
34 34
 	 * @param \Aimeos\MShop\Common\Item\Helper\Password\Iface|null $helper Password encryption helper object
35 35
 	 */
36
-	public function __construct( \Aimeos\MShop\Common\Item\Address\Iface $address, array $values = array(),
36
+	public function __construct(\Aimeos\MShop\Common\Item\Address\Iface $address, array $values = array(),
37 37
 		array $listItems = array(), array $refItems = array(), $salt = '',
38
-		\Aimeos\MShop\Common\Item\Helper\Password\Iface $helper = null )
38
+		\Aimeos\MShop\Common\Item\Helper\Password\Iface $helper = null)
39 39
 	{
40
-		parent::__construct( $address, $values, $listItems, $refItems );
40
+		parent::__construct($address, $values, $listItems, $refItems);
41 41
 
42
-		if( isset( $values['customer.password'] ) ) {
42
+		if (isset($values['customer.password'])) {
43 43
 			$this->password = $values['customer.password'];
44 44
 		}
45 45
 
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
 	 * @param string $value password of the customer item
65 65
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item for chaining method calls
66 66
 	 */
67
-	public function setPassword( $value )
67
+	public function setPassword($value)
68 68
 	{
69
-		if( $value == $this->getPassword() ) { return $this; }
69
+		if ($value == $this->getPassword()) { return $this; }
70 70
 
71
-		if( $this->helper !== null ) {
72
-			$value = $this->helper->encode( $value, $this->getCode() );
71
+		if ($this->helper !== null) {
72
+			$value = $this->helper->encode($value, $this->getCode());
73 73
 		}
74 74
 
75 75
 		$this->password = (string) $value;
Please login to merge, or discard this patch.