@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | 'customer.address.position' => 1, |
23 | 23 | ); |
24 | 24 | |
25 | - $this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.', $addressValues ); |
|
25 | + $this->address = new \Aimeos\MShop\Common\Item\Address\Standard('common.address.', $addressValues); |
|
26 | 26 | |
27 | 27 | $values = array( |
28 | 28 | 'customer.id' => 541, |
@@ -54,71 +54,71 @@ discard block |
||
54 | 54 | 'customer.mtime'=> '2010-01-05 00:00:05', |
55 | 55 | 'customer.ctime'=> '2010-01-01 00:00:00', |
56 | 56 | 'customer.editor' => 'unitTestUser', |
57 | - 'roles' => array( 'ROLE_ADMIN' ), |
|
57 | + 'roles' => array('ROLE_ADMIN'), |
|
58 | 58 | 'salt' => 'test', |
59 | 59 | ); |
60 | 60 | |
61 | - $this->object = new \Aimeos\MShop\Customer\Item\FosUser( $this->address, $values ); |
|
61 | + $this->object = new \Aimeos\MShop\Customer\Item\FosUser($this->address, $values); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | protected function tearDown() |
65 | 65 | { |
66 | - unset( $this->object ); |
|
66 | + unset($this->object); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | public function testGetPassword() |
70 | 70 | { |
71 | - $this->assertEquals( 'testpwd', $this->object->getPassword() ); |
|
71 | + $this->assertEquals('testpwd', $this->object->getPassword()); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function testSetPassword() |
75 | 75 | { |
76 | - $this->object->setPassword( 'new' ); |
|
77 | - $this->assertTrue( $this->object->isModified() ); |
|
78 | - $this->assertEquals( 'new', $this->object->getPassword() ); |
|
76 | + $this->object->setPassword('new'); |
|
77 | + $this->assertTrue($this->object->isModified()); |
|
78 | + $this->assertEquals('new', $this->object->getPassword()); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function testSetPasswordGenerated() |
82 | 82 | { |
83 | - $helper = new \Aimeos\MShop\Common\Item\Helper\Password\Standard( array( 'format' => '%1$s{%2$s}' ) ); |
|
84 | - $object = new \Aimeos\MShop\Customer\Item\FosUser( $this->address, [], [], [], null, $helper ); |
|
83 | + $helper = new \Aimeos\MShop\Common\Item\Helper\Password\Standard(array('format' => '%1$s{%2$s}')); |
|
84 | + $object = new \Aimeos\MShop\Customer\Item\FosUser($this->address, [], [], [], null, $helper); |
|
85 | 85 | |
86 | - $object->setPassword( 'newpwd' ); |
|
87 | - $this->assertEquals( sha1( 'newpwd{' . $object->getSalt() . '}' ), $object->getPassword() ); |
|
86 | + $object->setPassword('newpwd'); |
|
87 | + $this->assertEquals(sha1('newpwd{' . $object->getSalt() . '}'), $object->getPassword()); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | public function testGetRoles() |
91 | 91 | { |
92 | - $this->assertEquals( array( 'ROLE_ADMIN' ), $this->object->getRoles() ); |
|
92 | + $this->assertEquals(array('ROLE_ADMIN'), $this->object->getRoles()); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | public function testSetRoles() |
96 | 96 | { |
97 | - $this->object->setRoles( array( 'ROLE_USER' ) ); |
|
98 | - $this->assertTrue( $this->object->isModified() ); |
|
99 | - $this->assertEquals( array( 'ROLE_USER' ), $this->object->getRoles() ); |
|
97 | + $this->object->setRoles(array('ROLE_USER')); |
|
98 | + $this->assertTrue($this->object->isModified()); |
|
99 | + $this->assertEquals(array('ROLE_USER'), $this->object->getRoles()); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | public function testGetSalt() |
103 | 103 | { |
104 | - $this->assertEquals( 'test', $this->object->getSalt() ); |
|
104 | + $this->assertEquals('test', $this->object->getSalt()); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | public function testGetSaltGenerated() |
108 | 108 | { |
109 | - $object = new \Aimeos\MShop\Customer\Item\FosUser( $this->address, [] ); |
|
110 | - $this->assertEquals( '', $object->getSalt() ); |
|
109 | + $object = new \Aimeos\MShop\Customer\Item\FosUser($this->address, []); |
|
110 | + $this->assertEquals('', $object->getSalt()); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | public function testSetSalt() |
114 | 114 | { |
115 | - $this->object->setSalt( 'new' ); |
|
116 | - $this->assertTrue( $this->object->isModified() ); |
|
117 | - $this->assertEquals( 'new', $this->object->getSalt() ); |
|
115 | + $this->object->setSalt('new'); |
|
116 | + $this->assertTrue($this->object->isModified()); |
|
117 | + $this->assertEquals('new', $this->object->getSalt()); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | public function testIsModified() |
121 | 121 | { |
122 | - $this->assertFalse( $this->object->isModified() ); |
|
122 | + $this->assertFalse($this->object->isModified()); |
|
123 | 123 | } |
124 | 124 | } |
@@ -5,19 +5,19 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2014-2017 |
6 | 6 | */ |
7 | 7 | |
8 | -return array ( |
|
9 | - 'customer/lists/type' => array ( |
|
10 | - 'customer/group/default' => array( 'domain' => 'customer/group', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
|
11 | - 'order/download' => array( 'domain' => 'order', 'code' => 'download', 'label' => 'Download', 'status' => 1 ), |
|
12 | - 'product/favorite' => array( 'domain' => 'product', 'code' => 'favorite', 'label' => 'Favorite', 'status' => 1 ), |
|
13 | - 'product/watch' => array( 'domain' => 'product', 'code' => 'watch', 'label' => 'Watch list', 'status' => 1 ), |
|
14 | - 'text/default' => array( 'domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
|
8 | +return array( |
|
9 | + 'customer/lists/type' => array( |
|
10 | + 'customer/group/default' => array('domain' => 'customer/group', 'code' => 'default', 'label' => 'Standard', 'status' => 1), |
|
11 | + 'order/download' => array('domain' => 'order', 'code' => 'download', 'label' => 'Download', 'status' => 1), |
|
12 | + 'product/favorite' => array('domain' => 'product', 'code' => 'favorite', 'label' => 'Favorite', 'status' => 1), |
|
13 | + 'product/watch' => array('domain' => 'product', 'code' => 'watch', 'label' => 'Watch list', 'status' => 1), |
|
14 | + 'text/default' => array('domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1), |
|
15 | 15 | ), |
16 | 16 | |
17 | - 'customer/lists' => array ( |
|
18 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1 ), |
|
19 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/notify', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 2, 'status' => 1 ), |
|
20 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/newsletter', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 3, 'status' => 1 ), |
|
21 | - array( 'parentid' => 'customer/UTC001', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1 ), |
|
17 | + 'customer/lists' => array( |
|
18 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1), |
|
19 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/notify', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 2, 'status' => 1), |
|
20 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/newsletter', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 3, 'status' => 1), |
|
21 | + array('parentid' => 'customer/UTC001', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1), |
|
22 | 22 | ), |
23 | 23 | ); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getPostDependencies() |
42 | 42 | { |
43 | - return array( 'TablesCreateFosUser' ); |
|
43 | + return array('TablesCreateFosUser'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function migrate() |
51 | 51 | { |
52 | - $this->process( $this->mysql ); |
|
52 | + $this->process($this->mysql); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -58,22 +58,22 @@ discard block |
||
58 | 58 | * |
59 | 59 | * array string $stmts List of SQL statements for changing the columns |
60 | 60 | */ |
61 | - protected function process( array $stmts ) |
|
61 | + protected function process(array $stmts) |
|
62 | 62 | { |
63 | 63 | $table = 'fos_user_address'; |
64 | - $this->msg( sprintf( 'Rename "refid" to "parentid" in table "%1$s"', $table ), 0 ); $this->status( '' ); |
|
64 | + $this->msg(sprintf('Rename "refid" to "parentid" in table "%1$s"', $table), 0); $this->status(''); |
|
65 | 65 | |
66 | - foreach( $stmts as $column => $stmts ) |
|
66 | + foreach ($stmts as $column => $stmts) |
|
67 | 67 | { |
68 | - $this->msg( sprintf( 'Checking column "%1$s"', $column ), 1 ); |
|
68 | + $this->msg(sprintf('Checking column "%1$s"', $column), 1); |
|
69 | 69 | |
70 | - if( $this->schema->tableExists( $table ) |
|
71 | - && $this->schema->columnExists( $table, $column ) === true |
|
70 | + if ($this->schema->tableExists($table) |
|
71 | + && $this->schema->columnExists($table, $column) === true |
|
72 | 72 | ) { |
73 | - $this->executeList( $stmts ); |
|
74 | - $this->status( 'done' ); |
|
73 | + $this->executeList($stmts); |
|
74 | + $this->status('done'); |
|
75 | 75 | } else { |
76 | - $this->status( 'OK' ); |
|
76 | + $this->status('OK'); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | } |
@@ -5,12 +5,12 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2018 |
6 | 6 | */ |
7 | 7 | |
8 | -return array ( |
|
8 | +return array( |
|
9 | 9 | 'customer/property/type' => array( |
10 | - 'customer/property/type/newsletter' => array( 'domain' => 'customer', 'code' => 'newsletter', 'label' => 'Newsletter', 'status' => 1 ), |
|
10 | + 'customer/property/type/newsletter' => array('domain' => 'customer', 'code' => 'newsletter', 'label' => 'Newsletter', 'status' => 1), |
|
11 | 11 | ), |
12 | 12 | |
13 | 13 | 'customer/property' => array( |
14 | - 'customer/property/UTC001/newsletter' => array( 'parentid' => 'customer/UTC001', 'typeid' => 'customer/property/type/newsletter', 'langid' => null, 'value' => '1' ), |
|
14 | + 'customer/property/UTC001/newsletter' => array('parentid' => 'customer/UTC001', 'typeid' => 'customer/property/type/newsletter', 'langid' => null, 'value' => '1'), |
|
15 | 15 | ), |
16 | 16 | ); |
17 | 17 | \ No newline at end of file |
@@ -20,91 +20,91 @@ discard block |
||
20 | 20 | $context = \TestHelper::getContext(); |
21 | 21 | $this->editor = $context->getEditor(); |
22 | 22 | |
23 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'FosUser' ); |
|
24 | - $this->object = $manager->getSubManager( 'property', 'FosUser' ); |
|
23 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'FosUser'); |
|
24 | + $this->object = $manager->getSubManager('property', 'FosUser'); |
|
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 testCreateItem() |
41 | 41 | { |
42 | 42 | $item = $this->object->createItem(); |
43 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item ); |
|
43 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testSaveInvalid() |
48 | 48 | { |
49 | - $this->setExpectedException( '\Aimeos\MShop\Exception' ); |
|
50 | - $this->object->saveItem( new \Aimeos\MShop\Locale\Item\Standard() ); |
|
49 | + $this->setExpectedException('\Aimeos\MShop\Exception'); |
|
50 | + $this->object->saveItem(new \Aimeos\MShop\Locale\Item\Standard()); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | public function testSaveUpdateDeleteItem() |
55 | 55 | { |
56 | 56 | $search = $this->object->createSearch(); |
57 | - $search->setConditions( $search->compare( '==', 'customer.property.editor', $this->editor ) ); |
|
58 | - $results = $this->object->searchItems( $search ); |
|
57 | + $search->setConditions($search->compare('==', 'customer.property.editor', $this->editor)); |
|
58 | + $results = $this->object->searchItems($search); |
|
59 | 59 | |
60 | - if( ( $item = reset($results) ) === false ) { |
|
61 | - throw new \RuntimeException( 'No property item found' ); |
|
60 | + if (($item = reset($results)) === false) { |
|
61 | + throw new \RuntimeException('No property item found'); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $item->setId(null); |
65 | - $item->setLanguageId( 'en' ); |
|
66 | - $resultSaved = $this->object->saveItem( $item ); |
|
67 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
65 | + $item->setLanguageId('en'); |
|
66 | + $resultSaved = $this->object->saveItem($item); |
|
67 | + $itemSaved = $this->object->getItem($item->getId()); |
|
68 | 68 | |
69 | 69 | $itemExp = clone $itemSaved; |
70 | - $itemExp->setValue( 'unittest' ); |
|
71 | - $resultUpd = $this->object->saveItem( $itemExp ); |
|
72 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
70 | + $itemExp->setValue('unittest'); |
|
71 | + $resultUpd = $this->object->saveItem($itemExp); |
|
72 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
73 | 73 | |
74 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
74 | + $this->object->deleteItem($itemSaved->getId()); |
|
75 | 75 | |
76 | 76 | $context = \TestHelper::getContext(); |
77 | 77 | |
78 | - $this->assertTrue( $item->getId() !== null ); |
|
79 | - $this->assertTrue( $itemSaved->getType() !== null ); |
|
80 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
81 | - $this->assertEquals( $item->getParentId(), $itemSaved->getParentId() ); |
|
82 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
83 | - $this->assertEquals( $item->getTypeId(), $itemSaved->getTypeId() ); |
|
84 | - $this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId() ); |
|
85 | - $this->assertEquals( $item->getValue(), $itemSaved->getValue() ); |
|
86 | - |
|
87 | - $this->assertEquals( $context->getEditor(), $itemSaved->getEditor() ); |
|
88 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
89 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
90 | - |
|
91 | - $this->assertTrue( $itemUpd->getType() !== null ); |
|
92 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
93 | - $this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId() ); |
|
94 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
95 | - $this->assertEquals( $itemExp->getTypeId(), $itemUpd->getTypeId() ); |
|
96 | - $this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId() ); |
|
97 | - $this->assertEquals( $itemExp->getValue(), $itemUpd->getValue() ); |
|
98 | - |
|
99 | - $this->assertEquals( $context->getEditor(), $itemUpd->getEditor() ); |
|
100 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
101 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
102 | - |
|
103 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved ); |
|
104 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd ); |
|
105 | - |
|
106 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
107 | - $this->object->getItem( $itemSaved->getId() ); |
|
78 | + $this->assertTrue($item->getId() !== null); |
|
79 | + $this->assertTrue($itemSaved->getType() !== null); |
|
80 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
81 | + $this->assertEquals($item->getParentId(), $itemSaved->getParentId()); |
|
82 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
83 | + $this->assertEquals($item->getTypeId(), $itemSaved->getTypeId()); |
|
84 | + $this->assertEquals($item->getLanguageId(), $itemSaved->getLanguageId()); |
|
85 | + $this->assertEquals($item->getValue(), $itemSaved->getValue()); |
|
86 | + |
|
87 | + $this->assertEquals($context->getEditor(), $itemSaved->getEditor()); |
|
88 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
89 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
90 | + |
|
91 | + $this->assertTrue($itemUpd->getType() !== null); |
|
92 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
93 | + $this->assertEquals($itemExp->getParentId(), $itemUpd->getParentId()); |
|
94 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
95 | + $this->assertEquals($itemExp->getTypeId(), $itemUpd->getTypeId()); |
|
96 | + $this->assertEquals($itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
97 | + $this->assertEquals($itemExp->getValue(), $itemUpd->getValue()); |
|
98 | + |
|
99 | + $this->assertEquals($context->getEditor(), $itemUpd->getEditor()); |
|
100 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
101 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
102 | + |
|
103 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved); |
|
104 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd); |
|
105 | + |
|
106 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
107 | + $this->object->getItem($itemSaved->getId()); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
@@ -112,19 +112,19 @@ discard block |
||
112 | 112 | { |
113 | 113 | $search = $this->object->createSearch(); |
114 | 114 | $conditions = array( |
115 | - $search->compare( '~=', 'customer.property.value', '1'), |
|
116 | - $search->compare( '==', 'customer.property.editor', $this->editor ) |
|
115 | + $search->compare('~=', 'customer.property.value', '1'), |
|
116 | + $search->compare('==', 'customer.property.editor', $this->editor) |
|
117 | 117 | ); |
118 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
119 | - $results = $this->object->searchItems( $search ); |
|
118 | + $search->setConditions($search->combine('&&', $conditions)); |
|
119 | + $results = $this->object->searchItems($search); |
|
120 | 120 | |
121 | - if( ($expected = reset($results)) === false ) { |
|
122 | - throw new \RuntimeException( sprintf( 'No customer property item found for value "%1$s".', '1' ) ); |
|
121 | + if (($expected = reset($results)) === false) { |
|
122 | + throw new \RuntimeException(sprintf('No customer property item found for value "%1$s".', '1')); |
|
123 | 123 | } |
124 | 124 | |
125 | - $actual = $this->object->getItem( $expected->getId() ); |
|
126 | - $this->assertNotEquals( '', $actual->getTypeName() ); |
|
127 | - $this->assertEquals( $expected, $actual ); |
|
125 | + $actual = $this->object->getItem($expected->getId()); |
|
126 | + $this->assertNotEquals('', $actual->getTypeName()); |
|
127 | + $this->assertEquals($expected, $actual); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
@@ -132,15 +132,15 @@ discard block |
||
132 | 132 | { |
133 | 133 | $result = $this->object->getResourceType(); |
134 | 134 | |
135 | - $this->assertContains( 'customer/property', $result ); |
|
136 | - $this->assertContains( 'customer/property/type', $result ); |
|
135 | + $this->assertContains('customer/property', $result); |
|
136 | + $this->assertContains('customer/property/type', $result); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | |
140 | 140 | public function testGetSearchAttributes() |
141 | 141 | { |
142 | - foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
143 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
142 | + foreach ($this->object->getSearchAttributes() as $attribute) { |
|
143 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
@@ -151,51 +151,51 @@ discard block |
||
151 | 151 | $search = $this->object->createSearch(); |
152 | 152 | |
153 | 153 | $expr = []; |
154 | - $expr[] = $search->compare( '!=', 'customer.property.id', null ); |
|
155 | - $expr[] = $search->compare( '!=', 'customer.property.parentid', null ); |
|
156 | - $expr[] = $search->compare( '!=', 'customer.property.siteid', null ); |
|
157 | - $expr[] = $search->compare( '!=', 'customer.property.typeid', null ); |
|
158 | - $expr[] = $search->compare( '==', 'customer.property.languageid', null ); |
|
159 | - $expr[] = $search->compare( '==', 'customer.property.value', '1' ); |
|
160 | - $expr[] = $search->compare( '==', 'customer.property.editor', $this->editor ); |
|
161 | - |
|
162 | - $expr[] = $search->compare( '!=', 'customer.property.type.id', null ); |
|
163 | - $expr[] = $search->compare( '!=', 'customer.property.type.siteid', null ); |
|
164 | - $expr[] = $search->compare( '==', 'customer.property.type.domain', 'customer' ); |
|
165 | - $expr[] = $search->compare( '==', 'customer.property.type.code', 'newsletter' ); |
|
166 | - $expr[] = $search->compare( '>', 'customer.property.type.label', '' ); |
|
167 | - $expr[] = $search->compare( '==', 'customer.property.type.status', 1 ); |
|
168 | - $expr[] = $search->compare( '>=', 'customer.property.type.mtime', '1970-01-01 00:00:00' ); |
|
169 | - $expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' ); |
|
170 | - $expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor ); |
|
171 | - |
|
172 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
173 | - $results = $this->object->searchItems( $search, [], $total ); |
|
174 | - $this->assertEquals( 1, count( $results ) ); |
|
154 | + $expr[] = $search->compare('!=', 'customer.property.id', null); |
|
155 | + $expr[] = $search->compare('!=', 'customer.property.parentid', null); |
|
156 | + $expr[] = $search->compare('!=', 'customer.property.siteid', null); |
|
157 | + $expr[] = $search->compare('!=', 'customer.property.typeid', null); |
|
158 | + $expr[] = $search->compare('==', 'customer.property.languageid', null); |
|
159 | + $expr[] = $search->compare('==', 'customer.property.value', '1'); |
|
160 | + $expr[] = $search->compare('==', 'customer.property.editor', $this->editor); |
|
161 | + |
|
162 | + $expr[] = $search->compare('!=', 'customer.property.type.id', null); |
|
163 | + $expr[] = $search->compare('!=', 'customer.property.type.siteid', null); |
|
164 | + $expr[] = $search->compare('==', 'customer.property.type.domain', 'customer'); |
|
165 | + $expr[] = $search->compare('==', 'customer.property.type.code', 'newsletter'); |
|
166 | + $expr[] = $search->compare('>', 'customer.property.type.label', ''); |
|
167 | + $expr[] = $search->compare('==', 'customer.property.type.status', 1); |
|
168 | + $expr[] = $search->compare('>=', 'customer.property.type.mtime', '1970-01-01 00:00:00'); |
|
169 | + $expr[] = $search->compare('>=', 'customer.property.type.ctime', '1970-01-01 00:00:00'); |
|
170 | + $expr[] = $search->compare('==', 'customer.property.type.editor', $this->editor); |
|
171 | + |
|
172 | + $search->setConditions($search->combine('&&', $expr)); |
|
173 | + $results = $this->object->searchItems($search, [], $total); |
|
174 | + $this->assertEquals(1, count($results)); |
|
175 | 175 | |
176 | 176 | |
177 | 177 | $search = $this->object->createSearch(); |
178 | 178 | $conditions = array( |
179 | - $search->compare( '=~', 'customer.property.type.code', 'newsletter' ), |
|
180 | - $search->compare( '==', 'customer.property.editor', $this->editor ) |
|
179 | + $search->compare('=~', 'customer.property.type.code', 'newsletter'), |
|
180 | + $search->compare('==', 'customer.property.editor', $this->editor) |
|
181 | 181 | ); |
182 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
182 | + $search->setConditions($search->combine('&&', $conditions)); |
|
183 | 183 | $search->setSlice(0, 1); |
184 | - $items = $this->object->searchItems( $search, [], $total ); |
|
184 | + $items = $this->object->searchItems($search, [], $total); |
|
185 | 185 | |
186 | - $this->assertEquals( 1, count( $items ) ); |
|
187 | - $this->assertEquals( 1, $total ); |
|
186 | + $this->assertEquals(1, count($items)); |
|
187 | + $this->assertEquals(1, $total); |
|
188 | 188 | |
189 | - foreach($items as $itemId => $item) { |
|
190 | - $this->assertEquals( $itemId, $item->getId() ); |
|
189 | + foreach ($items as $itemId => $item) { |
|
190 | + $this->assertEquals($itemId, $item->getId()); |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 | |
194 | 194 | |
195 | 195 | public function testGetSubManager() |
196 | 196 | { |
197 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') ); |
|
198 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard') ); |
|
197 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type')); |
|
198 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Standard')); |
|
199 | 199 | |
200 | 200 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
201 | 201 | $this->object->getSubManager('unknown'); |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | $context = \TestHelper::getContext(); |
21 | 21 | $this->editor = $context->getEditor(); |
22 | 22 | |
23 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'FosUser' ); |
|
24 | - $this->object = $manager->getSubManager( 'property', 'FosUser' )->getSubManager( 'type', 'FosUser' ); |
|
23 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'FosUser'); |
|
24 | + $this->object = $manager->getSubManager('property', 'FosUser')->getSubManager('type', 'FosUser'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -33,13 +33,13 @@ discard block |
||
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 testCreateItem() |
41 | 41 | { |
42 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $this->object->createItem() ); |
|
42 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $this->object->createItem()); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | { |
48 | 48 | $result = $this->object->getResourceType(); |
49 | 49 | |
50 | - $this->assertContains( 'customer/property/type', $result ); |
|
50 | + $this->assertContains('customer/property/type', $result); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | public function testGetSearchAttributes() |
55 | 55 | { |
56 | - foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
57 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
56 | + foreach ($this->object->getSearchAttributes() as $attribute) { |
|
57 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -63,82 +63,82 @@ discard block |
||
63 | 63 | { |
64 | 64 | $search = $this->object->createSearch(); |
65 | 65 | $conditions = array( |
66 | - $search->compare( '==', 'customer.property.type.code', 'newsletter' ), |
|
67 | - $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
|
66 | + $search->compare('==', 'customer.property.type.code', 'newsletter'), |
|
67 | + $search->compare('==', 'customer.property.type.editor', $this->editor) |
|
68 | 68 | ); |
69 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
69 | + $search->setConditions($search->combine('&&', $conditions)); |
|
70 | 70 | |
71 | - $results = $this->object->searchItems( $search ); |
|
71 | + $results = $this->object->searchItems($search); |
|
72 | 72 | |
73 | - if( ($expected = reset($results) ) === false ) |
|
73 | + if (($expected = reset($results)) === false) |
|
74 | 74 | { |
75 | - throw new \RuntimeException( 'No property type item found.' ); |
|
75 | + throw new \RuntimeException('No property type item found.'); |
|
76 | 76 | } |
77 | 77 | |
78 | - $actual = $this->object->getItem( $expected->getId() ); |
|
78 | + $actual = $this->object->getItem($expected->getId()); |
|
79 | 79 | |
80 | - $this->assertEquals( $expected, $actual ); |
|
80 | + $this->assertEquals($expected, $actual); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | 84 | public function testSaveInvalid() |
85 | 85 | { |
86 | - $this->setExpectedException( '\Aimeos\MShop\Exception' ); |
|
87 | - $this->object->saveItem( new \Aimeos\MShop\Locale\Item\Standard() ); |
|
86 | + $this->setExpectedException('\Aimeos\MShop\Exception'); |
|
87 | + $this->object->saveItem(new \Aimeos\MShop\Locale\Item\Standard()); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | |
91 | 91 | public function testSaveUpdateDeleteItem() |
92 | 92 | { |
93 | 93 | $search = $this->object->createSearch(); |
94 | - $search->setConditions( $search->compare( '==', 'customer.property.type.editor', $this->editor ) ); |
|
94 | + $search->setConditions($search->compare('==', 'customer.property.type.editor', $this->editor)); |
|
95 | 95 | $results = $this->object->searchItems($search); |
96 | 96 | |
97 | - if( ( $item = reset($results) ) === false ) { |
|
98 | - throw new \RuntimeException( 'No type item found' ); |
|
97 | + if (($item = reset($results)) === false) { |
|
98 | + throw new \RuntimeException('No type item found'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $item->setId(null); |
102 | - $item->setCode( 'unitTestSave' ); |
|
103 | - $resultSaved = $this->object->saveItem( $item ); |
|
104 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
102 | + $item->setCode('unitTestSave'); |
|
103 | + $resultSaved = $this->object->saveItem($item); |
|
104 | + $itemSaved = $this->object->getItem($item->getId()); |
|
105 | 105 | |
106 | 106 | $itemExp = clone $itemSaved; |
107 | - $itemExp->setCode( 'unitTestSave2' ); |
|
108 | - $resultUpd = $this->object->saveItem( $itemExp ); |
|
109 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
107 | + $itemExp->setCode('unitTestSave2'); |
|
108 | + $resultUpd = $this->object->saveItem($itemExp); |
|
109 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
110 | 110 | |
111 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
111 | + $this->object->deleteItem($itemSaved->getId()); |
|
112 | 112 | |
113 | 113 | |
114 | - $this->assertTrue( $item->getId() !== null ); |
|
115 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
116 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
117 | - $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
118 | - $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() ); |
|
119 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
120 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
114 | + $this->assertTrue($item->getId() !== null); |
|
115 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
116 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
117 | + $this->assertEquals($item->getCode(), $itemSaved->getCode()); |
|
118 | + $this->assertEquals($item->getDomain(), $itemSaved->getDomain()); |
|
119 | + $this->assertEquals($item->getLabel(), $itemSaved->getLabel()); |
|
120 | + $this->assertEquals($item->getStatus(), $itemSaved->getStatus()); |
|
121 | 121 | |
122 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
123 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
124 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
122 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
123 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
124 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
125 | 125 | |
126 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
127 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
128 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
129 | - $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() ); |
|
130 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
131 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
126 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
127 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
128 | + $this->assertEquals($itemExp->getCode(), $itemUpd->getCode()); |
|
129 | + $this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain()); |
|
130 | + $this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel()); |
|
131 | + $this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus()); |
|
132 | 132 | |
133 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
134 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
135 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
133 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
134 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
135 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
136 | 136 | |
137 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved ); |
|
138 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd ); |
|
137 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved); |
|
138 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd); |
|
139 | 139 | |
140 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
141 | - $this->object->getItem( $itemSaved->getId() ); |
|
140 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
141 | + $this->object->getItem($itemSaved->getId()); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
@@ -148,36 +148,36 @@ discard block |
||
148 | 148 | $search = $this->object->createSearch(); |
149 | 149 | |
150 | 150 | $expr = []; |
151 | - $expr[] = $search->compare( '!=', 'customer.property.type.id', null ); |
|
152 | - $expr[] = $search->compare( '!=', 'customer.property.type.siteid', null ); |
|
153 | - $expr[] = $search->compare( '==', 'customer.property.type.domain', 'customer' ); |
|
154 | - $expr[] = $search->compare( '==', 'customer.property.type.code', 'newsletter' ); |
|
155 | - $expr[] = $search->compare( '>', 'customer.property.type.label', '' ); |
|
156 | - $expr[] = $search->compare( '==', 'customer.property.type.status', 1 ); |
|
157 | - $expr[] = $search->compare( '>=', 'customer.property.type.mtime', '1970-01-01 00:00:00' ); |
|
158 | - $expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' ); |
|
159 | - $expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor ); |
|
151 | + $expr[] = $search->compare('!=', 'customer.property.type.id', null); |
|
152 | + $expr[] = $search->compare('!=', 'customer.property.type.siteid', null); |
|
153 | + $expr[] = $search->compare('==', 'customer.property.type.domain', 'customer'); |
|
154 | + $expr[] = $search->compare('==', 'customer.property.type.code', 'newsletter'); |
|
155 | + $expr[] = $search->compare('>', 'customer.property.type.label', ''); |
|
156 | + $expr[] = $search->compare('==', 'customer.property.type.status', 1); |
|
157 | + $expr[] = $search->compare('>=', 'customer.property.type.mtime', '1970-01-01 00:00:00'); |
|
158 | + $expr[] = $search->compare('>=', 'customer.property.type.ctime', '1970-01-01 00:00:00'); |
|
159 | + $expr[] = $search->compare('==', 'customer.property.type.editor', $this->editor); |
|
160 | 160 | |
161 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
162 | - $results = $this->object->searchItems( $search, [], $total ); |
|
163 | - $this->assertEquals( 1, count( $results ) ); |
|
161 | + $search->setConditions($search->combine('&&', $expr)); |
|
162 | + $results = $this->object->searchItems($search, [], $total); |
|
163 | + $this->assertEquals(1, count($results)); |
|
164 | 164 | |
165 | 165 | |
166 | 166 | $search = $this->object->createSearch(); |
167 | 167 | $conditions = array( |
168 | - $search->compare( '=~', 'customer.property.type.code', 'newsletter'), |
|
169 | - $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
|
168 | + $search->compare('=~', 'customer.property.type.code', 'newsletter'), |
|
169 | + $search->compare('==', 'customer.property.type.editor', $this->editor) |
|
170 | 170 | ); |
171 | - $search->setConditions( $search->combine('&&', $conditions ) ); |
|
172 | - $search->setSortations( [$search->sort('-', 'customer.property.type.position' )] ); |
|
171 | + $search->setConditions($search->combine('&&', $conditions)); |
|
172 | + $search->setSortations([$search->sort('-', 'customer.property.type.position')]); |
|
173 | 173 | $search->setSlice(0, 1); |
174 | - $items = $this->object->searchItems( $search, [], $total); |
|
174 | + $items = $this->object->searchItems($search, [], $total); |
|
175 | 175 | |
176 | - $this->assertEquals( 1, count( $items ) ); |
|
177 | - $this->assertEquals( 1, $total ); |
|
176 | + $this->assertEquals(1, count($items)); |
|
177 | + $this->assertEquals(1, $total); |
|
178 | 178 | |
179 | - foreach($items as $itemId => $item) { |
|
180 | - $this->assertEquals( $itemId, $item->getId() ); |
|
179 | + foreach ($items as $itemId => $item) { |
|
180 | + $this->assertEquals($itemId, $item->getId()); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 |
@@ -5,17 +5,17 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2014-2017 |
6 | 6 | */ |
7 | 7 | |
8 | -return array ( |
|
8 | +return array( |
|
9 | 9 | 'customer' => array( |
10 | - 'customer/UTC001' => array( 'code' => 'UTC001', 'label' => 'unitCustomer1', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Dr.', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234567890', 'email' => '[email protected]', 'telefax' => '01234567890', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ), |
|
11 | - 'customer/UTC002' => array( 'code' => 'UTC002', 'label' => 'unitCustomer2', 'salutation' => 'mrs', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'birthday' => '1970-01-01', 'status' => '0','password' => 'test' ), |
|
12 | - 'customer/UTC003' => array( 'code' => 'UTC003', 'label' => 'unitCustomer3', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => 'Berlin', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ), |
|
10 | + 'customer/UTC001' => array('code' => 'UTC001', 'label' => 'unitCustomer1', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Dr.', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234567890', 'email' => '[email protected]', 'telefax' => '01234567890', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'), |
|
11 | + 'customer/UTC002' => array('code' => 'UTC002', 'label' => 'unitCustomer2', 'salutation' => 'mrs', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'birthday' => '1970-01-01', 'status' => '0', 'password' => 'test'), |
|
12 | + 'customer/UTC003' => array('code' => 'UTC003', 'label' => 'unitCustomer3', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => 'Berlin', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'), |
|
13 | 13 | ), |
14 | 14 | |
15 | 15 | 'customer/address' => array( |
16 | - array( 'parentid' => 'customer/UTC001', 'company' => 'ABC', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Our', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '0' ), |
|
17 | - array( 'parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'flag' => 0, 'pos' => '1' ), |
|
18 | - array( 'parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'flag' => 0, 'pos' => '1' ), |
|
19 | - array( 'parentid' => 'customer/UTC003', 'company' => 'unitcompany', 'vatid' => 'DE999999999', 'salutation' => 'company', 'title' => 'unittitle', 'firstname' => 'unitfirstname', 'lastname' => 'unitlastname', 'address1' => 'unitaddress1', 'address2' => 'unitaddress2', 'address3' => 'unitaddress3', 'postal' => 'unitpostal', 'city' => 'unitcity', 'state' => 'unitstate', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '1234567890', 'email' => '[email protected]', 'telefax' => '1234567891', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '2' ), |
|
16 | + array('parentid' => 'customer/UTC001', 'company' => 'ABC', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Our', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '0'), |
|
17 | + array('parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'flag' => 0, 'pos' => '1'), |
|
18 | + array('parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'flag' => 0, 'pos' => '1'), |
|
19 | + array('parentid' => 'customer/UTC003', 'company' => 'unitcompany', 'vatid' => 'DE999999999', 'salutation' => 'company', 'title' => 'unittitle', 'firstname' => 'unitfirstname', 'lastname' => 'unitlastname', 'address1' => 'unitaddress1', 'address2' => 'unitaddress2', 'address3' => 'unitaddress3', 'postal' => 'unitpostal', 'city' => 'unitcity', 'state' => 'unitstate', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '1234567890', 'email' => '[email protected]', 'telefax' => '1234567891', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '2'), |
|
20 | 20 | ), |
21 | 21 | ); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function getPreDependencies() |
25 | 25 | { |
26 | - return array( 'TablesCreateFosUser', 'CustomerAddFosUserTestData', 'LocaleAddTestData' ); |
|
26 | + return array('TablesCreateFosUser', 'CustomerAddFosUserTestData', 'LocaleAddTestData'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -33,22 +33,22 @@ discard block |
||
33 | 33 | public function migrate() |
34 | 34 | { |
35 | 35 | $iface = '\\Aimeos\\MShop\\Context\\Item\\Iface'; |
36 | - if( !( $this->additional instanceof $iface ) ) { |
|
37 | - throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) ); |
|
36 | + if (!($this->additional instanceof $iface)) { |
|
37 | + throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface)); |
|
38 | 38 | } |
39 | 39 | |
40 | - $this->msg( 'Adding customer property Fos user bundle test data', 0 ); |
|
41 | - $this->additional->setEditor( 'ai-fosuser:unittest' ); |
|
40 | + $this->msg('Adding customer property Fos user bundle test data', 0); |
|
41 | + $this->additional->setEditor('ai-fosuser:unittest'); |
|
42 | 42 | |
43 | 43 | $ds = DIRECTORY_SEPARATOR; |
44 | 44 | $path = __DIR__ . $ds . 'data' . $ds . 'customer-property.php'; |
45 | 45 | |
46 | - if( ( $testdata = include( $path ) ) == false ) { |
|
47 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) ); |
|
46 | + if (($testdata = include($path)) == false) { |
|
47 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path)); |
|
48 | 48 | } |
49 | 49 | |
50 | - $this->addCustomerPropertyData( $testdata, 'FosUser' ); |
|
50 | + $this->addCustomerPropertyData($testdata, 'FosUser'); |
|
51 | 51 | |
52 | - $this->status( 'done' ); |
|
52 | + $this->status('done'); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | \ No newline at end of file |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | * @param \Aimeos\MShop\Common\Item\Iface[] $refItems List of referenced items |
33 | 33 | * @param \Aimeos\MShop\Common\Item\Helper\Password\Iface|null $helper Password encryption helper object |
34 | 34 | */ |
35 | - public function __construct( \Aimeos\MShop\Common\Item\Address\Iface $address, |
|
35 | + public function __construct(\Aimeos\MShop\Common\Item\Address\Iface $address, |
|
36 | 36 | array $values = [], array $listItems = [], array $refItems = [], $salt = '', |
37 | - \Aimeos\MShop\Common\Item\Helper\Password\Iface $helper = null, array $addresses = [], array $propItems = [] ) |
|
37 | + \Aimeos\MShop\Common\Item\Helper\Password\Iface $helper = null, array $addresses = [], array $propItems = []) |
|
38 | 38 | { |
39 | - parent::__construct( $address, $values, $listItems, $refItems, $salt, $helper, $addresses, $propItems, $propItems ); |
|
39 | + parent::__construct($address, $values, $listItems, $refItems, $salt, $helper, $addresses, $propItems, $propItems); |
|
40 | 40 | |
41 | 41 | $this->values = $values; |
42 | 42 | $this->helper = $helper; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function getPassword() |
53 | 53 | { |
54 | - if( isset( $this->values['customer.password'] ) ) { |
|
54 | + if (isset($this->values['customer.password'])) { |
|
55 | 55 | return (string) $this->values['customer.password']; |
56 | 56 | } |
57 | 57 | |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | * @param string $value Password of the customer item |
66 | 66 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item for chaining method calls |
67 | 67 | */ |
68 | - public function setPassword( $value ) |
|
68 | + public function setPassword($value) |
|
69 | 69 | { |
70 | - if( (string) $value !== $this->getPassword() ) |
|
70 | + if ((string) $value !== $this->getPassword()) |
|
71 | 71 | { |
72 | - if( $this->helper !== null ) { |
|
73 | - $value = $this->helper->encode( $value, $this->getSalt() ); |
|
72 | + if ($this->helper !== null) { |
|
73 | + $value = $this->helper->encode($value, $this->getSalt()); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | $this->values['customer.password'] = (string) $value; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function getRoles() |
90 | 90 | { |
91 | - if( isset( $this->values['roles'] ) ) { |
|
91 | + if (isset($this->values['roles'])) { |
|
92 | 92 | return (array) $this->values['roles']; |
93 | 93 | } |
94 | 94 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * |
102 | 102 | * @param array $roles List of Symfony roles |
103 | 103 | */ |
104 | - public function setRoles( array $roles ) |
|
104 | + public function setRoles(array $roles) |
|
105 | 105 | { |
106 | 106 | $this->values['roles'] = $roles; |
107 | 107 | $this->setModified(); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getSalt() |
119 | 119 | { |
120 | - if( isset( $this->values['salt'] ) ) { |
|
120 | + if (isset($this->values['salt'])) { |
|
121 | 121 | return $this->values['salt']; |
122 | 122 | } |
123 | 123 | |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @param string $value Password salt |
132 | 132 | */ |
133 | - public function setSalt( $value ) |
|
133 | + public function setSalt($value) |
|
134 | 134 | { |
135 | - if( (string) $value !== $this->getSalt() ) |
|
135 | + if ((string) $value !== $this->getSalt()) |
|
136 | 136 | { |
137 | 137 | $this->values['salt'] = (string) $value; |
138 | 138 | $this->setModified(); |