@@ -17,144 +17,144 @@ |
||
| 17 | 17 | |
| 18 | 18 | public function testGetId() |
| 19 | 19 | { |
| 20 | - $this->assertEquals( null, $this->object->getId() ); |
|
| 20 | + $this->assertEquals(null, $this->object->getId()); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | public function testGetSetCompany() |
| 25 | 25 | { |
| 26 | - $this->object->setCompany( 'ABC' ); |
|
| 27 | - $this->assertEquals( 'ABC', $this->object->getCompany() ); |
|
| 26 | + $this->object->setCompany('ABC'); |
|
| 27 | + $this->assertEquals('ABC', $this->object->getCompany()); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testGetSetVatID() |
| 32 | 32 | { |
| 33 | - $this->object->setVatID( 'AT0000' ); |
|
| 34 | - $this->assertEquals( 'AT0000', $this->object->getVatID() ); |
|
| 33 | + $this->object->setVatID('AT0000'); |
|
| 34 | + $this->assertEquals('AT0000', $this->object->getVatID()); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testGetSetSalutation() |
| 39 | 39 | { |
| 40 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN ); |
|
| 41 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN, $this->object->getSalutation() ); |
|
| 40 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN); |
|
| 41 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN, $this->object->getSalutation()); |
|
| 42 | 42 | |
| 43 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY ); |
|
| 44 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY, $this->object->getSalutation() ); |
|
| 43 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY); |
|
| 44 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY, $this->object->getSalutation()); |
|
| 45 | 45 | |
| 46 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS ); |
|
| 47 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS, $this->object->getSalutation() ); |
|
| 46 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS); |
|
| 47 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS, $this->object->getSalutation()); |
|
| 48 | 48 | |
| 49 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS ); |
|
| 50 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS, $this->object->getSalutation() ); |
|
| 49 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS); |
|
| 50 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS, $this->object->getSalutation()); |
|
| 51 | 51 | |
| 52 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR ); |
|
| 53 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, $this->object->getSalutation() ); |
|
| 52 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR); |
|
| 53 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, $this->object->getSalutation()); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | public function testGetSetTitle() |
| 58 | 58 | { |
| 59 | - $this->object->setTitle( 'Prof. Dr.' ); |
|
| 60 | - $this->assertEquals( 'Prof. Dr.', $this->object->getTitle() ); |
|
| 59 | + $this->object->setTitle('Prof. Dr.'); |
|
| 60 | + $this->assertEquals('Prof. Dr.', $this->object->getTitle()); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | public function testGetSetFirstname() |
| 65 | 65 | { |
| 66 | - $this->object->setFirstname( 'first' ); |
|
| 67 | - $this->assertEquals( 'first', $this->object->getFirstname() ); |
|
| 66 | + $this->object->setFirstname('first'); |
|
| 67 | + $this->assertEquals('first', $this->object->getFirstname()); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | public function testGetSetLastname() |
| 72 | 72 | { |
| 73 | - $this->object->setLastname( 'last' ); |
|
| 74 | - $this->assertEquals( 'last', $this->object->getLastname() ); |
|
| 73 | + $this->object->setLastname('last'); |
|
| 74 | + $this->assertEquals('last', $this->object->getLastname()); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | public function testGetSetAddress1() |
| 79 | 79 | { |
| 80 | - $this->object->setAddress1( 'test street' ); |
|
| 81 | - $this->assertEquals( 'test street', $this->object->getAddress1() ); |
|
| 80 | + $this->object->setAddress1('test street'); |
|
| 81 | + $this->assertEquals('test street', $this->object->getAddress1()); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | public function testGetSetAddress2() |
| 86 | 86 | { |
| 87 | - $this->object->setAddress2( '1' ); |
|
| 88 | - $this->assertEquals( '1', $this->object->getAddress2() ); |
|
| 87 | + $this->object->setAddress2('1'); |
|
| 88 | + $this->assertEquals('1', $this->object->getAddress2()); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | public function testGetSetAddress3() |
| 93 | 93 | { |
| 94 | - $this->object->setAddress3( 'EG' ); |
|
| 95 | - $this->assertEquals( 'EG', $this->object->getAddress3() ); |
|
| 94 | + $this->object->setAddress3('EG'); |
|
| 95 | + $this->assertEquals('EG', $this->object->getAddress3()); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | public function testGetSetPostal() |
| 100 | 100 | { |
| 101 | - $this->object->setPostal( '12345' ); |
|
| 102 | - $this->assertEquals( '12345', $this->object->getPostal() ); |
|
| 101 | + $this->object->setPostal('12345'); |
|
| 102 | + $this->assertEquals('12345', $this->object->getPostal()); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | public function testGetSetCity() |
| 107 | 107 | { |
| 108 | - $this->object->setCity( 'Munich' ); |
|
| 109 | - $this->assertEquals( 'Munich', $this->object->getCity() ); |
|
| 108 | + $this->object->setCity('Munich'); |
|
| 109 | + $this->assertEquals('Munich', $this->object->getCity()); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | public function testGetSetState() |
| 114 | 114 | { |
| 115 | - $this->object->setState( 'Bayern' ); |
|
| 116 | - $this->assertEquals( 'Bayern', $this->object->getState() ); |
|
| 115 | + $this->object->setState('Bayern'); |
|
| 116 | + $this->assertEquals('Bayern', $this->object->getState()); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
| 120 | 120 | public function testGetSetCountryId() |
| 121 | 121 | { |
| 122 | - $this->object->setCountryId( 'DE' ); |
|
| 123 | - $this->assertEquals( 'DE', $this->object->getCountryId() ); |
|
| 122 | + $this->object->setCountryId('DE'); |
|
| 123 | + $this->assertEquals('DE', $this->object->getCountryId()); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | public function testGetSetLanguageId() |
| 128 | 128 | { |
| 129 | - $this->object->setLanguageId( 'de' ); |
|
| 130 | - $this->assertEquals( 'de', $this->object->getLanguageId() ); |
|
| 129 | + $this->object->setLanguageId('de'); |
|
| 130 | + $this->assertEquals('de', $this->object->getLanguageId()); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | public function testGetSetTelephone() |
| 135 | 135 | { |
| 136 | - $this->object->setTelephone( '089123456789' ); |
|
| 137 | - $this->assertEquals( '089123456789', $this->object->getTelephone() ); |
|
| 136 | + $this->object->setTelephone('089123456789'); |
|
| 137 | + $this->assertEquals('089123456789', $this->object->getTelephone()); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | public function testGetSetTelefax() |
| 142 | 142 | { |
| 143 | - $this->object->setTelefax( '089987654321' ); |
|
| 144 | - $this->assertEquals( '089987654321', $this->object->getTelefax() ); |
|
| 143 | + $this->object->setTelefax('089987654321'); |
|
| 144 | + $this->assertEquals('089987654321', $this->object->getTelefax()); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | public function testGetSetWebsite() |
| 149 | 149 | { |
| 150 | - $this->object->setWebsite( 'http://aimeos.org' ); |
|
| 151 | - $this->assertEquals( 'http://aimeos.org', $this->object->getWebsite() ); |
|
| 150 | + $this->object->setWebsite('http://aimeos.org'); |
|
| 151 | + $this->assertEquals('http://aimeos.org', $this->object->getWebsite()); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | public function testSetWebsiteInvalid() |
| 156 | 156 | { |
| 157 | - $this->setExpectedException( 'Exception' ); |
|
| 158 | - $this->object->setWebsite( 'aimeos+org' ); |
|
| 157 | + $this->setExpectedException('Exception'); |
|
| 158 | + $this->object->setWebsite('aimeos+org'); |
|
| 159 | 159 | } |
| 160 | 160 | } |
@@ -11,17 +11,17 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | $client = static::createClient(); |
| 13 | 13 | |
| 14 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 14 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 15 | 15 | |
| 16 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 17 | - $crawler = $client->click( $link ); |
|
| 16 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 17 | + $crawler = $client->click($link); |
|
| 18 | 18 | |
| 19 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 20 | - $crawler = $client->submit( $form ); |
|
| 19 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 20 | + $crawler = $client->submit($form); |
|
| 21 | 21 | |
| 22 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard' )->count() ); |
|
| 23 | - $this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() ); |
|
| 24 | - $this->assertEquals( 1, $crawler->filter( '.basket .product .quantity .value' )->attr('value') ); |
|
| 22 | + $this->assertEquals(1, $crawler->filter('.basket-standard')->count()); |
|
| 23 | + $this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count()); |
|
| 24 | + $this->assertEquals(1, $crawler->filter('.basket .product .quantity .value')->attr('value')); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -29,18 +29,18 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | $client = static::createClient(); |
| 31 | 31 | |
| 32 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 32 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 33 | 33 | |
| 34 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 35 | - $crawler = $client->click( $link ); |
|
| 34 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 35 | + $crawler = $client->click($link); |
|
| 36 | 36 | |
| 37 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 37 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 38 | 38 | $form['b_prod[0][quantity]'] = 2; |
| 39 | - $crawler = $client->submit( $form ); |
|
| 39 | + $crawler = $client->submit($form); |
|
| 40 | 40 | |
| 41 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard' )->count() ); |
|
| 42 | - $this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() ); |
|
| 43 | - $this->assertEquals( 2, $crawler->filter( '.basket .product .quantity .value' )->attr('value') ); |
|
| 41 | + $this->assertEquals(1, $crawler->filter('.basket-standard')->count()); |
|
| 42 | + $this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count()); |
|
| 43 | + $this->assertEquals(2, $crawler->filter('.basket .product .quantity .value')->attr('value')); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
@@ -48,26 +48,26 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | $client = static::createClient(); |
| 50 | 50 | |
| 51 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 51 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 52 | 52 | |
| 53 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 54 | - $crawler = $client->click( $link ); |
|
| 53 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 54 | + $crawler = $client->click($link); |
|
| 55 | 55 | |
| 56 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 57 | - $crawler = $client->submit( $form ); |
|
| 56 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 57 | + $crawler = $client->submit($form); |
|
| 58 | 58 | |
| 59 | - $this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() ); |
|
| 60 | - $this->assertEquals( 1, $crawler->filter( '.basket .product .quantity .value' )->attr('value') ); |
|
| 59 | + $this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count()); |
|
| 60 | + $this->assertEquals(1, $crawler->filter('.basket .product .quantity .value')->attr('value')); |
|
| 61 | 61 | |
| 62 | 62 | |
| 63 | - $link = $crawler->filter( '.basket-standard .btn-back' )->link(); |
|
| 64 | - $crawler = $client->click( $link ); |
|
| 63 | + $link = $crawler->filter('.basket-standard .btn-back')->link(); |
|
| 64 | + $crawler = $client->click($link); |
|
| 65 | 65 | |
| 66 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 67 | - $crawler = $client->submit( $form ); |
|
| 66 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 67 | + $crawler = $client->submit($form); |
|
| 68 | 68 | |
| 69 | - $this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() ); |
|
| 70 | - $this->assertEquals( 2, $crawler->filter( '.basket .product .quantity .value' )->attr('value') ); |
|
| 69 | + $this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count()); |
|
| 70 | + $this->assertEquals(2, $crawler->filter('.basket .product .quantity .value')->attr('value')); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
@@ -75,19 +75,19 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | $client = static::createClient(); |
| 77 | 77 | |
| 78 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 78 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 79 | 79 | |
| 80 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 81 | - $crawler = $client->click( $link ); |
|
| 80 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 81 | + $crawler = $client->click($link); |
|
| 82 | 82 | |
| 83 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 84 | - $crawler = $client->submit( $form ); |
|
| 83 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 84 | + $crawler = $client->submit($form); |
|
| 85 | 85 | |
| 86 | 86 | |
| 87 | - $link = $crawler->filter( '.basket-standard .product .action .change' )->link(); |
|
| 88 | - $crawler = $client->click( $link ); |
|
| 87 | + $link = $crawler->filter('.basket-standard .product .action .change')->link(); |
|
| 88 | + $crawler = $client->click($link); |
|
| 89 | 89 | |
| 90 | - $this->assertEquals( 0, $crawler->filter( '.basket-standard .product' )->count() ); |
|
| 90 | + $this->assertEquals(0, $crawler->filter('.basket-standard .product')->count()); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
@@ -95,25 +95,25 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | $client = static::createClient(); |
| 97 | 97 | |
| 98 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 98 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 99 | 99 | |
| 100 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 101 | - $crawler = $client->click( $link ); |
|
| 100 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 101 | + $crawler = $client->click($link); |
|
| 102 | 102 | |
| 103 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 104 | - $crawler = $client->submit( $form ); |
|
| 103 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 104 | + $crawler = $client->submit($form); |
|
| 105 | 105 | |
| 106 | 106 | |
| 107 | - $link = $crawler->filter( '.basket-standard .product .quantity .change' )->link(); |
|
| 108 | - $crawler = $client->click( $link ); |
|
| 107 | + $link = $crawler->filter('.basket-standard .product .quantity .change')->link(); |
|
| 108 | + $crawler = $client->click($link); |
|
| 109 | 109 | |
| 110 | - $this->assertEquals( 2, $crawler->filter( '.basket-standard .product .quantity .value' )->attr( 'value' ) ); |
|
| 110 | + $this->assertEquals(2, $crawler->filter('.basket-standard .product .quantity .value')->attr('value')); |
|
| 111 | 111 | |
| 112 | 112 | |
| 113 | - $link = $crawler->filter( '.basket-standard .product .quantity .change' )->eq( 0 )->link(); |
|
| 114 | - $crawler = $client->click( $link ); |
|
| 113 | + $link = $crawler->filter('.basket-standard .product .quantity .change')->eq(0)->link(); |
|
| 114 | + $crawler = $client->click($link); |
|
| 115 | 115 | |
| 116 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard .product .quantity .value' )->attr( 'value' ) ); |
|
| 116 | + $this->assertEquals(1, $crawler->filter('.basket-standard .product .quantity .value')->attr('value')); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -121,20 +121,20 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $client = static::createClient(); |
| 123 | 123 | |
| 124 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 124 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 125 | 125 | |
| 126 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 127 | - $crawler = $client->click( $link ); |
|
| 126 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 127 | + $crawler = $client->click($link); |
|
| 128 | 128 | |
| 129 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 130 | - $crawler = $client->submit( $form ); |
|
| 129 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 130 | + $crawler = $client->submit($form); |
|
| 131 | 131 | |
| 132 | 132 | |
| 133 | - $form = $crawler->filter( '.basket-standard .btn-update' )->form(); |
|
| 133 | + $form = $crawler->filter('.basket-standard .btn-update')->form(); |
|
| 134 | 134 | $form['b_prod[0][quantity]'] = 3; |
| 135 | - $crawler = $client->submit( $form ); |
|
| 135 | + $crawler = $client->submit($form); |
|
| 136 | 136 | |
| 137 | - $this->assertEquals( 3, $crawler->filter( '.basket-standard .product .quantity .value' )->attr( 'value' ) ); |
|
| 137 | + $this->assertEquals(3, $crawler->filter('.basket-standard .product .quantity .value')->attr('value')); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
@@ -142,26 +142,26 @@ discard block |
||
| 142 | 142 | { |
| 143 | 143 | $client = static::createClient(); |
| 144 | 144 | |
| 145 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 145 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 146 | 146 | |
| 147 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 148 | - $crawler = $client->click( $link ); |
|
| 147 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 148 | + $crawler = $client->click($link); |
|
| 149 | 149 | |
| 150 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 151 | - $crawler = $client->submit( $form ); |
|
| 150 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 151 | + $crawler = $client->submit($form); |
|
| 152 | 152 | |
| 153 | 153 | |
| 154 | - $form = $crawler->filter( '.basket-standard-coupon .coupon-new button' )->form(); |
|
| 154 | + $form = $crawler->filter('.basket-standard-coupon .coupon-new button')->form(); |
|
| 155 | 155 | $form['b_coupon'] = '90AB'; |
| 156 | - $crawler = $client->submit( $form ); |
|
| 156 | + $crawler = $client->submit($form); |
|
| 157 | 157 | |
| 158 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard .product:contains("Geldwerter Nachlass")' )->count() ); |
|
| 158 | + $this->assertEquals(1, $crawler->filter('.basket-standard .product:contains("Geldwerter Nachlass")')->count()); |
|
| 159 | 159 | |
| 160 | 160 | |
| 161 | - $link = $crawler->filter( '.basket-standard-coupon .change' )->link(); |
|
| 162 | - $crawler = $client->click( $link ); |
|
| 161 | + $link = $crawler->filter('.basket-standard-coupon .change')->link(); |
|
| 162 | + $crawler = $client->click($link); |
|
| 163 | 163 | |
| 164 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard .product' )->count() ); |
|
| 164 | + $this->assertEquals(1, $crawler->filter('.basket-standard .product')->count()); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | |
@@ -169,15 +169,15 @@ discard block |
||
| 169 | 169 | { |
| 170 | 170 | $client = static::createClient(); |
| 171 | 171 | |
| 172 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 172 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 173 | 173 | |
| 174 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->link(); |
|
| 175 | - $crawler = $client->click( $link ); |
|
| 174 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->link(); |
|
| 175 | + $crawler = $client->click($link); |
|
| 176 | 176 | |
| 177 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 178 | - $crawler = $client->submit( $form ); |
|
| 177 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 178 | + $crawler = $client->submit($form); |
|
| 179 | 179 | |
| 180 | - $this->assertEquals( 1, $crawler->filter( '.basket-related-bought .bought-item' )->count() ); |
|
| 180 | + $this->assertEquals(1, $crawler->filter('.basket-related-bought .bought-item')->count()); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
@@ -185,17 +185,17 @@ discard block |
||
| 185 | 185 | { |
| 186 | 186 | $client = static::createClient(); |
| 187 | 187 | |
| 188 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 188 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 189 | 189 | |
| 190 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 191 | - $crawler = $client->click( $link ); |
|
| 190 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 191 | + $crawler = $client->click($link); |
|
| 192 | 192 | |
| 193 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
| 194 | - $crawler = $client->submit( $form ); |
|
| 193 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
| 194 | + $crawler = $client->submit($form); |
|
| 195 | 195 | |
| 196 | - $link = $crawler->filter( '.basket-standard .btn-back' )->link(); |
|
| 197 | - $crawler = $client->click( $link ); |
|
| 196 | + $link = $crawler->filter('.basket-standard .btn-back')->link(); |
|
| 197 | + $crawler = $client->click($link); |
|
| 198 | 198 | |
| 199 | - $this->assertEquals( 1, $crawler->filter( '.catalog-detail .product:contains("Unittest: Bundle")' )->count() ); |
|
| 199 | + $this->assertEquals(1, $crawler->filter('.catalog-detail .product:contains("Unittest: Bundle")')->count()); |
|
| 200 | 200 | } |
| 201 | 201 | } |
@@ -10,17 +10,17 @@ |
||
| 10 | 10 | public function testTerms() |
| 11 | 11 | { |
| 12 | 12 | $client = static::createClient(); |
| 13 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/terms' ); |
|
| 13 | + $crawler = $client->request('GET', '/unittest/de/EUR/terms'); |
|
| 14 | 14 | |
| 15 | - $this->assertEquals( 1, $crawler->filter( 'body:contains("Terms")' )->count() ); |
|
| 15 | + $this->assertEquals(1, $crawler->filter('body:contains("Terms")')->count()); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | public function testPrivacy() |
| 20 | 20 | { |
| 21 | 21 | $client = static::createClient(); |
| 22 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/privacy' ); |
|
| 22 | + $crawler = $client->request('GET', '/unittest/de/EUR/privacy'); |
|
| 23 | 23 | |
| 24 | - $this->assertEquals( 1, $crawler->filter( 'body:contains("Privacy")' )->count() ); |
|
| 24 | + $this->assertEquals(1, $crawler->filter('body:contains("Privacy")')->count()); |
|
| 25 | 25 | } |
| 26 | 26 | } |
@@ -10,210 +10,210 @@ |
||
| 10 | 10 | public function testCount() |
| 11 | 11 | { |
| 12 | 12 | $client = static::createClient(); |
| 13 | - $client->request( 'GET', '/unittest/de/EUR/count' ); |
|
| 13 | + $client->request('GET', '/unittest/de/EUR/count'); |
|
| 14 | 14 | $content = $client->getResponse()->getContent(); |
| 15 | 15 | |
| 16 | - $this->assertContains( '".catalog-filter-count li.cat-item"', $content ); |
|
| 17 | - $this->assertContains( '".catalog-filter-attribute .attribute-lists li.attr-item"', $content ); |
|
| 16 | + $this->assertContains('".catalog-filter-count li.cat-item"', $content); |
|
| 17 | + $this->assertContains('".catalog-filter-attribute .attribute-lists li.attr-item"', $content); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | public function testFilterSearch() |
| 22 | 22 | { |
| 23 | 23 | $client = static::createClient(); |
| 24 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 24 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 25 | 25 | |
| 26 | - $this->assertEquals( 1, $crawler->filter( '.catalog-filter-search' )->count() ); |
|
| 26 | + $this->assertEquals(1, $crawler->filter('.catalog-filter-search')->count()); |
|
| 27 | 27 | |
| 28 | - $form = $crawler->filter( '.catalog-filter-search button' )->form(); |
|
| 28 | + $form = $crawler->filter('.catalog-filter-search button')->form(); |
|
| 29 | 29 | $form['f_search'] = 'Unit'; |
| 30 | - $crawler = $client->submit( $form ); |
|
| 30 | + $crawler = $client->submit($form); |
|
| 31 | 31 | |
| 32 | - $this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Test Selection")' )->count() ); |
|
| 33 | - $this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Empty Selection")' )->count() ); |
|
| 34 | - $this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->count() ); |
|
| 32 | + $this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Unittest: Test Selection")')->count()); |
|
| 33 | + $this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Unittest: Empty Selection")')->count()); |
|
| 34 | + $this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->count()); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testFilterTree() |
| 39 | 39 | { |
| 40 | 40 | $client = static::createClient(); |
| 41 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 41 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 42 | 42 | |
| 43 | - $this->assertEquals( 1, $crawler->filter( '.catalog-filter-tree' )->count() ); |
|
| 43 | + $this->assertEquals(1, $crawler->filter('.catalog-filter-tree')->count()); |
|
| 44 | 44 | |
| 45 | - $link = $crawler->filter( '.catalog-filter-tree a.cat-item' )->link(); |
|
| 46 | - $crawler = $client->click( $link ); |
|
| 45 | + $link = $crawler->filter('.catalog-filter-tree a.cat-item')->link(); |
|
| 46 | + $crawler = $client->click($link); |
|
| 47 | 47 | |
| 48 | - $link = $crawler->filter( '.catalog-filter-tree .categories a.cat-item' )->link(); |
|
| 49 | - $crawler = $client->click( $link ); |
|
| 48 | + $link = $crawler->filter('.catalog-filter-tree .categories a.cat-item')->link(); |
|
| 49 | + $crawler = $client->click($link); |
|
| 50 | 50 | |
| 51 | - $link = $crawler->filter( '.catalog-filter-tree .coffee a.cat-item' )->link(); |
|
| 52 | - $crawler = $client->click( $link ); |
|
| 51 | + $link = $crawler->filter('.catalog-filter-tree .coffee a.cat-item')->link(); |
|
| 52 | + $crawler = $client->click($link); |
|
| 53 | 53 | |
| 54 | - $this->assertEquals( 3, $crawler->filter( '.catalog-stage-breadcrumb li' )->count() ); |
|
| 55 | - $this->assertEquals( 1, $crawler->filter( '.catalog-list-promo .product a:contains("Cafe Noire Expresso")' )->count() ); |
|
| 54 | + $this->assertEquals(3, $crawler->filter('.catalog-stage-breadcrumb li')->count()); |
|
| 55 | + $this->assertEquals(1, $crawler->filter('.catalog-list-promo .product a:contains("Cafe Noire Expresso")')->count()); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | public function testFilterAttribute() |
| 60 | 60 | { |
| 61 | 61 | $client = static::createClient(); |
| 62 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 62 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 63 | 63 | |
| 64 | - $this->assertEquals( 1, $crawler->filter( '.catalog-filter-attribute' )->count() ); |
|
| 64 | + $this->assertEquals(1, $crawler->filter('.catalog-filter-attribute')->count()); |
|
| 65 | 65 | |
| 66 | - $nodes = $crawler->filter( '.catalog-filter-attribute .attr-size span:contains("XS")' ); |
|
| 67 | - $id = $nodes->parents()->filter( '.attr-item' )->attr( 'data-id'); |
|
| 66 | + $nodes = $crawler->filter('.catalog-filter-attribute .attr-size span:contains("XS")'); |
|
| 67 | + $id = $nodes->parents()->filter('.attr-item')->attr('data-id'); |
|
| 68 | 68 | |
| 69 | - $form = $crawler->filter( '.catalog-filter .btn-action' )->form(); |
|
| 70 | - $form['f_attrid'] = array( $id => 'xs' ); |
|
| 71 | - $crawler = $client->submit( $form ); |
|
| 69 | + $form = $crawler->filter('.catalog-filter .btn-action')->form(); |
|
| 70 | + $form['f_attrid'] = array($id => 'xs'); |
|
| 71 | + $crawler = $client->submit($form); |
|
| 72 | 72 | |
| 73 | - $this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->count() ); |
|
| 74 | - $this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Cappuccino")' )->count() ); |
|
| 73 | + $this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->count()); |
|
| 74 | + $this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Cappuccino")')->count()); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | public function testStageBreadcrumb() |
| 79 | 79 | { |
| 80 | 80 | $client = static::createClient(); |
| 81 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 81 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 82 | 82 | |
| 83 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->link(); |
|
| 84 | - $crawler = $client->click( $link ); |
|
| 83 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->link(); |
|
| 84 | + $crawler = $client->click($link); |
|
| 85 | 85 | |
| 86 | - $this->assertEquals( 1, $crawler->filter( '.catalog-stage-breadcrumb li' )->count() ); |
|
| 86 | + $this->assertEquals(1, $crawler->filter('.catalog-stage-breadcrumb li')->count()); |
|
| 87 | 87 | |
| 88 | - $link = $crawler->filter( '.catalog-stage-breadcrumb a' )->link(); |
|
| 89 | - $crawler = $client->click( $link ); |
|
| 88 | + $link = $crawler->filter('.catalog-stage-breadcrumb a')->link(); |
|
| 89 | + $crawler = $client->click($link); |
|
| 90 | 90 | |
| 91 | - $this->assertEquals( 1, $crawler->filter( '.catalog-list' )->count() ); |
|
| 92 | - $this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->count() ); |
|
| 93 | - $this->assertEquals( 1, $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Cappuccino")' )->count() ); |
|
| 91 | + $this->assertEquals(1, $crawler->filter('.catalog-list')->count()); |
|
| 92 | + $this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->count()); |
|
| 93 | + $this->assertEquals(1, $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Cappuccino")')->count()); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | public function testStageNavigator() |
| 98 | 98 | { |
| 99 | 99 | $client = static::createClient(); |
| 100 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 100 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 101 | 101 | |
| 102 | - $link = $crawler->filter( '.catalog-list-pagination .option-name' )->link(); |
|
| 103 | - $crawler = $client->click( $link ); |
|
| 102 | + $link = $crawler->filter('.catalog-list-pagination .option-name')->link(); |
|
| 103 | + $crawler = $client->click($link); |
|
| 104 | 104 | |
| 105 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
| 106 | - $crawler = $client->click( $link ); |
|
| 105 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
| 106 | + $crawler = $client->click($link); |
|
| 107 | 107 | |
| 108 | - $this->assertEquals( 1, $crawler->filter( '.catalog-detail' )->count() ); |
|
| 109 | - $this->assertEquals( 1, $crawler->filter( '.catalog-detail:contains("Unittest: Bundle")' )->count() ); |
|
| 108 | + $this->assertEquals(1, $crawler->filter('.catalog-detail')->count()); |
|
| 109 | + $this->assertEquals(1, $crawler->filter('.catalog-detail:contains("Unittest: Bundle")')->count()); |
|
| 110 | 110 | |
| 111 | - $link = $crawler->filter( '.catalog-stage-navigator a.next' )->link(); |
|
| 112 | - $crawler = $client->click( $link ); |
|
| 111 | + $link = $crawler->filter('.catalog-stage-navigator a.next')->link(); |
|
| 112 | + $crawler = $client->click($link); |
|
| 113 | 113 | |
| 114 | - $this->assertEquals( 1, $crawler->filter( '.catalog-detail' )->count() ); |
|
| 115 | - $this->assertEquals( 1, $crawler->filter( '.catalog-detail:contains("Unittest: Empty Selection")' )->count() ); |
|
| 114 | + $this->assertEquals(1, $crawler->filter('.catalog-detail')->count()); |
|
| 115 | + $this->assertEquals(1, $crawler->filter('.catalog-detail:contains("Unittest: Empty Selection")')->count()); |
|
| 116 | 116 | |
| 117 | - $link = $crawler->filter( '.catalog-stage-navigator a.prev' )->link(); |
|
| 118 | - $crawler = $client->click( $link ); |
|
| 117 | + $link = $crawler->filter('.catalog-stage-navigator a.prev')->link(); |
|
| 118 | + $crawler = $client->click($link); |
|
| 119 | 119 | |
| 120 | - $this->assertEquals( 1, $crawler->filter( '.catalog-detail' )->count() ); |
|
| 121 | - $this->assertEquals( 1, $crawler->filter( '.catalog-detail:contains("Unittest: Bundle")' )->count() ); |
|
| 120 | + $this->assertEquals(1, $crawler->filter('.catalog-detail')->count()); |
|
| 121 | + $this->assertEquals(1, $crawler->filter('.catalog-detail:contains("Unittest: Bundle")')->count()); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| 125 | 125 | public function testListSortationName() |
| 126 | 126 | { |
| 127 | 127 | $client = static::createClient(); |
| 128 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 128 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 129 | 129 | |
| 130 | - $link = $crawler->filter( '.catalog-list-pagination .option-name' )->link(); |
|
| 131 | - $crawler = $client->click( $link ); |
|
| 130 | + $link = $crawler->filter('.catalog-list-pagination .option-name')->link(); |
|
| 131 | + $crawler = $client->click($link); |
|
| 132 | 132 | |
| 133 | - $products = $crawler->filter( '.catalog-list-items .product' ); |
|
| 134 | - $this->assertEquals( 1, $products->eq( 1 )->filter( 'h2:contains("Unittest: Bundle")' )->count() ); |
|
| 135 | - $this->assertEquals( 1, $products->eq( 2 )->filter( 'h2:contains("Unittest: Empty Selection")' )->count() ); |
|
| 133 | + $products = $crawler->filter('.catalog-list-items .product'); |
|
| 134 | + $this->assertEquals(1, $products->eq(1)->filter('h2:contains("Unittest: Bundle")')->count()); |
|
| 135 | + $this->assertEquals(1, $products->eq(2)->filter('h2:contains("Unittest: Empty Selection")')->count()); |
|
| 136 | 136 | |
| 137 | - $link = $crawler->filter( '.catalog-list-pagination .option-name' )->link(); |
|
| 138 | - $crawler = $client->click( $link ); |
|
| 137 | + $link = $crawler->filter('.catalog-list-pagination .option-name')->link(); |
|
| 138 | + $crawler = $client->click($link); |
|
| 139 | 139 | |
| 140 | - $products = $crawler->filter( '.catalog-list-items .product' ); |
|
| 140 | + $products = $crawler->filter('.catalog-list-items .product'); |
|
| 141 | 141 | $count = $products->count(); |
| 142 | 142 | |
| 143 | - $this->assertGreaterThan( 2, $count ); |
|
| 144 | - $this->assertEquals( 1, $products->eq( $count - 3 )->filter( 'h2:contains("Unittest: Empty Selection")' )->count() ); |
|
| 145 | - $this->assertEquals( 1, $products->eq( $count - 2 )->filter( 'h2:contains("Unittest: Bundle")' )->count() ); |
|
| 143 | + $this->assertGreaterThan(2, $count); |
|
| 144 | + $this->assertEquals(1, $products->eq($count - 3)->filter('h2:contains("Unittest: Empty Selection")')->count()); |
|
| 145 | + $this->assertEquals(1, $products->eq($count - 2)->filter('h2:contains("Unittest: Bundle")')->count()); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| 149 | 149 | public function testListSortationPrice() |
| 150 | 150 | { |
| 151 | 151 | $client = static::createClient(); |
| 152 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 152 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 153 | 153 | |
| 154 | - $link = $crawler->filter( '.catalog-list-pagination .option-price' )->link(); |
|
| 155 | - $crawler = $client->click( $link ); |
|
| 154 | + $link = $crawler->filter('.catalog-list-pagination .option-price')->link(); |
|
| 155 | + $crawler = $client->click($link); |
|
| 156 | 156 | |
| 157 | - $products = $crawler->filter( '.catalog-list-items .product' ); |
|
| 157 | + $products = $crawler->filter('.catalog-list-items .product'); |
|
| 158 | 158 | $count = $products->count(); |
| 159 | 159 | |
| 160 | - $this->assertGreaterThan( 2, $count ); |
|
| 161 | - $this->assertEquals( 1, $products->eq( $count - 2 )->filter( '.value:contains("600.00 €")' )->count() ); |
|
| 162 | - $this->assertEquals( 1, $products->eq( $count - 1 )->filter( '.value:contains("600.00 €")' )->count() ); |
|
| 160 | + $this->assertGreaterThan(2, $count); |
|
| 161 | + $this->assertEquals(1, $products->eq($count - 2)->filter('.value:contains("600.00 €")')->count()); |
|
| 162 | + $this->assertEquals(1, $products->eq($count - 1)->filter('.value:contains("600.00 €")')->count()); |
|
| 163 | 163 | |
| 164 | - $link = $crawler->filter( '.catalog-list-pagination .option-price' )->link(); |
|
| 165 | - $crawler = $client->click( $link ); |
|
| 164 | + $link = $crawler->filter('.catalog-list-pagination .option-price')->link(); |
|
| 165 | + $crawler = $client->click($link); |
|
| 166 | 166 | |
| 167 | - $products = $crawler->filter( '.catalog-list-items .product' ); |
|
| 168 | - $this->assertEquals( 1, $products->eq( 0 )->filter( '.value:contains("600.00 €")' )->count() ); |
|
| 169 | - $this->assertEquals( 1, $products->eq( 1 )->filter( '.value:contains("600.00 €")' )->count() ); |
|
| 167 | + $products = $crawler->filter('.catalog-list-items .product'); |
|
| 168 | + $this->assertEquals(1, $products->eq(0)->filter('.value:contains("600.00 €")')->count()); |
|
| 169 | + $this->assertEquals(1, $products->eq(1)->filter('.value:contains("600.00 €")')->count()); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
| 173 | 173 | public function testDetailPinned() |
| 174 | 174 | { |
| 175 | 175 | $client = static::createClient(); |
| 176 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 176 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 177 | 177 | |
| 178 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->link(); |
|
| 179 | - $crawler = $client->click( $link ); |
|
| 178 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->link(); |
|
| 179 | + $crawler = $client->click($link); |
|
| 180 | 180 | |
| 181 | - $link = $crawler->filter( '.catalog-detail a.actions-button-pin' )->link(); |
|
| 182 | - $crawler = $client->click( $link ); |
|
| 181 | + $link = $crawler->filter('.catalog-detail a.actions-button-pin')->link(); |
|
| 182 | + $crawler = $client->click($link); |
|
| 183 | 183 | |
| 184 | - $this->assertEquals( 1, $crawler->filter( '.catalog-session-pinned .pinned-item' )->count() ); |
|
| 184 | + $this->assertEquals(1, $crawler->filter('.catalog-session-pinned .pinned-item')->count()); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | |
| 188 | 188 | public function testDetailLastSeen() |
| 189 | 189 | { |
| 190 | 190 | $client = static::createClient(); |
| 191 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
| 191 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
| 192 | 192 | |
| 193 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->link(); |
|
| 194 | - $crawler = $client->click( $link ); |
|
| 193 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->link(); |
|
| 194 | + $crawler = $client->click($link); |
|
| 195 | 195 | |
| 196 | - $this->assertEquals( 1, $crawler->filter( '.catalog-session-seen .seen-item' )->count() ); |
|
| 196 | + $this->assertEquals(1, $crawler->filter('.catalog-session-seen .seen-item')->count()); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | |
| 200 | 200 | public function testSuggest() |
| 201 | 201 | { |
| 202 | 202 | $client = static::createClient(); |
| 203 | - $client->request( 'GET', '/unittest/de/EUR/suggest', array( 'f_search' => 'unit' ) ); |
|
| 203 | + $client->request('GET', '/unittest/de/EUR/suggest', array('f_search' => 'unit')); |
|
| 204 | 204 | $content = $client->getResponse()->getContent(); |
| 205 | 205 | |
| 206 | - $this->assertStringStartsWith( '[{', $content ); |
|
| 206 | + $this->assertStringStartsWith('[{', $content); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
| 210 | 210 | public function testStock() |
| 211 | 211 | { |
| 212 | 212 | $client = static::createClient(); |
| 213 | - $client->request( 'GET', '/unittest/de/EUR/stock' ); |
|
| 213 | + $client->request('GET', '/unittest/de/EUR/stock'); |
|
| 214 | 214 | $content = $client->getResponse()->getContent(); |
| 215 | 215 | |
| 216 | - $this->assertContains( '.aimeos .product .stock', $content ); |
|
| 217 | - $this->assertContains( '.aimeos .catalog-detail-basket', $content ); |
|
| 216 | + $this->assertContains('.aimeos .product .stock', $content); |
|
| 217 | + $this->assertContains('.aimeos .catalog-detail-basket', $content); |
|
| 218 | 218 | } |
| 219 | 219 | } |
@@ -14,13 +14,13 @@ |
||
| 14 | 14 | $kernel = $this->createKernel(); |
| 15 | 15 | $kernel->boot(); |
| 16 | 16 | |
| 17 | - $application = new Application( $kernel ); |
|
| 18 | - $application->add( new Command\SetupCommand() ); |
|
| 17 | + $application = new Application($kernel); |
|
| 18 | + $application->add(new Command\SetupCommand()); |
|
| 19 | 19 | |
| 20 | - $command = $application->find( 'aimeos:setup' ); |
|
| 21 | - $commandTester = new CommandTester( $command ); |
|
| 22 | - $commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'tplsite' => 'unittest', '--option' => 'setup/default/demo:0' ) ); |
|
| 20 | + $command = $application->find('aimeos:setup'); |
|
| 21 | + $commandTester = new CommandTester($command); |
|
| 22 | + $commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest', 'tplsite' => 'unittest', '--option' => 'setup/default/demo:0')); |
|
| 23 | 23 | |
| 24 | - $this->assertEquals( 0, $commandTester->getStatusCode() ); |
|
| 24 | + $this->assertEquals(0, $commandTester->getStatusCode()); |
|
| 25 | 25 | } |
| 26 | 26 | } |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | |
| 59 | 59 | $i18n = $this->container->get('aimeos_i18n')->get( array( $locale ) ); |
| 60 | 60 | $translation = $i18n[$locale]; |
| 61 | - } |
|
| 62 | - else |
|
| 61 | + } else |
|
| 63 | 62 | { |
| 64 | 63 | $translation = new \Aimeos\MW\Translation\None( 'en' ); |
| 65 | 64 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @param RequestStack $requestStack Current request stack |
| 33 | 33 | * @param Container $container Container object to access parameters |
| 34 | 34 | */ |
| 35 | - public function __construct( RequestStack $requestStack, Container $container ) |
|
| 35 | + public function __construct(RequestStack $requestStack, Container $container) |
|
| 36 | 36 | { |
| 37 | 37 | $this->requestStack = $requestStack; |
| 38 | 38 | $this->container = $container; |
@@ -47,61 +47,61 @@ discard block |
||
| 47 | 47 | * @param string|null $locale Code of the current language or null for no translation |
| 48 | 48 | * @return \Aimeos\MW\View\Iface View object |
| 49 | 49 | */ |
| 50 | - public function create( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null ) |
|
| 50 | + public function create(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null) |
|
| 51 | 51 | { |
| 52 | 52 | $params = $fixed = array(); |
| 53 | 53 | $config = $context->getConfig(); |
| 54 | 54 | $request = $this->requestStack->getMasterRequest(); |
| 55 | 55 | |
| 56 | - if( $locale !== null ) |
|
| 56 | + if ($locale !== null) |
|
| 57 | 57 | { |
| 58 | - $params = $request->request->all() + $request->query->all() + $request->attributes->get( '_route_params' ); |
|
| 58 | + $params = $request->request->all() + $request->query->all() + $request->attributes->get('_route_params'); |
|
| 59 | 59 | $fixed = $this->getFixedParams(); |
| 60 | 60 | |
| 61 | - $i18n = $this->container->get('aimeos_i18n')->get( array( $locale ) ); |
|
| 61 | + $i18n = $this->container->get('aimeos_i18n')->get(array($locale)); |
|
| 62 | 62 | $translation = $i18n[$locale]; |
| 63 | 63 | } |
| 64 | 64 | else |
| 65 | 65 | { |
| 66 | - $translation = new \Aimeos\MW\Translation\None( 'en' ); |
|
| 66 | + $translation = new \Aimeos\MW\Translation\None('en'); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| 70 | - $view = new \Aimeos\MW\View\Standard( $templatePaths ); |
|
| 70 | + $view = new \Aimeos\MW\View\Standard($templatePaths); |
|
| 71 | 71 | |
| 72 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation ); |
|
| 73 | - $view->addHelper( 'translate', $helper ); |
|
| 72 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation); |
|
| 73 | + $view->addHelper('translate', $helper); |
|
| 74 | 74 | |
| 75 | - $helper = new \Aimeos\MW\View\Helper\Url\Symfony2( $view, $this->container->get( 'router' ), $fixed ); |
|
| 76 | - $view->addHelper( 'url', $helper ); |
|
| 75 | + $helper = new \Aimeos\MW\View\Helper\Url\Symfony2($view, $this->container->get('router'), $fixed); |
|
| 76 | + $view->addHelper('url', $helper); |
|
| 77 | 77 | |
| 78 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params ); |
|
| 79 | - $view->addHelper( 'param', $helper ); |
|
| 78 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params); |
|
| 79 | + $view->addHelper('param', $helper); |
|
| 80 | 80 | |
| 81 | - $config = new \Aimeos\MW\Config\Decorator\Protect( clone $config, array( 'admin', 'client' ) ); |
|
| 82 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 83 | - $view->addHelper( 'config', $helper ); |
|
| 81 | + $config = new \Aimeos\MW\Config\Decorator\Protect(clone $config, array('admin', 'client')); |
|
| 82 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 83 | + $view->addHelper('config', $helper); |
|
| 84 | 84 | |
| 85 | - $sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' ); |
|
| 86 | - $sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' ); |
|
| 87 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000 ); |
|
| 88 | - $view->addHelper( 'number', $helper ); |
|
| 85 | + $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.'); |
|
| 86 | + $sep1000 = $config->get('client/html/common/format/seperator1000', ' '); |
|
| 87 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000); |
|
| 88 | + $view->addHelper('number', $helper); |
|
| 89 | 89 | |
| 90 | - if( $request !== null ) |
|
| 90 | + if ($request !== null) |
|
| 91 | 91 | { |
| 92 | - $helper = new \Aimeos\MW\View\Helper\Request\Symfony2( $view, $request ); |
|
| 93 | - $view->addHelper( 'request', $helper ); |
|
| 92 | + $helper = new \Aimeos\MW\View\Helper\Request\Symfony2($view, $request); |
|
| 93 | + $view->addHelper('request', $helper); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - $helper = new \Aimeos\MW\View\Helper\Response\Symfony2( $view ); |
|
| 97 | - $view->addHelper( 'response', $helper ); |
|
| 96 | + $helper = new \Aimeos\MW\View\Helper\Response\Symfony2($view); |
|
| 97 | + $view->addHelper('response', $helper); |
|
| 98 | 98 | |
| 99 | - $token = $this->container->get( 'security.csrf.token_manager' )->getToken( '_token' ); |
|
| 100 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', $token->getValue() ); |
|
| 101 | - $view->addHelper( 'csrf', $helper ); |
|
| 99 | + $token = $this->container->get('security.csrf.token_manager')->getToken('_token'); |
|
| 100 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', $token->getValue()); |
|
| 101 | + $view->addHelper('csrf', $helper); |
|
| 102 | 102 | |
| 103 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $this->getGroups( $context ) ); |
|
| 104 | - $view->addHelper( 'access', $helper ); |
|
| 103 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $this->getGroups($context)); |
|
| 104 | + $view->addHelper('access', $helper); |
|
| 105 | 105 | |
| 106 | 106 | return $view; |
| 107 | 107 | } |
@@ -117,15 +117,15 @@ discard block |
||
| 117 | 117 | $urlparams = array(); |
| 118 | 118 | $attr = $this->requestStack->getMasterRequest()->attributes; |
| 119 | 119 | |
| 120 | - if( ( $site = $attr->get( 'site' ) ) !== null ) { |
|
| 120 | + if (($site = $attr->get('site')) !== null) { |
|
| 121 | 121 | $urlparams['site'] = $site; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - if( ( $lang = $attr->get( 'locale' ) ) !== null ) { |
|
| 124 | + if (($lang = $attr->get('locale')) !== null) { |
|
| 125 | 125 | $urlparams['locale'] = $lang; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - if( ( $currency = $attr->get( 'currency' ) ) !== null ) { |
|
| 128 | + if (($currency = $attr->get('currency')) !== null) { |
|
| 129 | 129 | $urlparams['currency'] = $currency; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -139,17 +139,17 @@ discard block |
||
| 139 | 139 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 140 | 140 | * @return \Closure Function which returns the user group codes |
| 141 | 141 | */ |
| 142 | - protected function getGroups( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 142 | + protected function getGroups(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 143 | 143 | { |
| 144 | - return function() use ( $context ) |
|
| 144 | + return function() use ($context) |
|
| 145 | 145 | { |
| 146 | 146 | $list = array(); |
| 147 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' ); |
|
| 147 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer/group'); |
|
| 148 | 148 | |
| 149 | 149 | $search = $manager->createSearch(); |
| 150 | - $search->setConditions( $search->compare( '==', 'customer.group.id', $context->getGroupIds() ) ); |
|
| 150 | + $search->setConditions($search->compare('==', 'customer.group.id', $context->getGroupIds())); |
|
| 151 | 151 | |
| 152 | - foreach( $manager->searchItems( $search ) as $item ) { |
|
| 152 | + foreach ($manager->searchItems($search) as $item) { |
|
| 153 | 153 | $list[] = $item->getCode(); |
| 154 | 154 | } |
| 155 | 155 | |
@@ -107,8 +107,7 @@ |
||
| 107 | 107 | |
| 108 | 108 | if( $this->container->has( 'security.token_storage' ) ) { |
| 109 | 109 | $token = $this->container->get( 'security.token_storage' )->getToken(); |
| 110 | - } |
|
| 111 | - else if( $this->container->has( 'security.context' ) ) { |
|
| 110 | + } else if( $this->container->has( 'security.context' ) ) { |
|
| 112 | 111 | $token = $this->container->get( 'security.context' )->getToken(); |
| 113 | 112 | } |
| 114 | 113 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @param RequestStack $requestStack Current request stack |
| 35 | 35 | * @param Container $container Container object to access parameters |
| 36 | 36 | */ |
| 37 | - public function __construct( RequestStack $requestStack, Container $container ) |
|
| 37 | + public function __construct(RequestStack $requestStack, Container $container) |
|
| 38 | 38 | { |
| 39 | 39 | $this->requestStack = $requestStack; |
| 40 | 40 | $this->container = $container; |
@@ -47,52 +47,52 @@ discard block |
||
| 47 | 47 | * @param boolean $locale True to add locale object to context, false if not |
| 48 | 48 | * @return \Aimeos\MShop\Context\Item\Iface Context object |
| 49 | 49 | */ |
| 50 | - public function get( $locale = true ) |
|
| 50 | + public function get($locale = true) |
|
| 51 | 51 | { |
| 52 | - if( self::$context === null ) |
|
| 52 | + if (self::$context === null) |
|
| 53 | 53 | { |
| 54 | 54 | $context = new \Aimeos\MShop\Context\Item\Standard(); |
| 55 | 55 | |
| 56 | 56 | $config = $this->getConfig(); |
| 57 | - $context->setConfig( $config ); |
|
| 57 | + $context->setConfig($config); |
|
| 58 | 58 | |
| 59 | - $dbm = new \Aimeos\MW\DB\Manager\DBAL( $config ); |
|
| 60 | - $context->setDatabaseManager( $dbm ); |
|
| 59 | + $dbm = new \Aimeos\MW\DB\Manager\DBAL($config); |
|
| 60 | + $context->setDatabaseManager($dbm); |
|
| 61 | 61 | |
| 62 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $config ); |
|
| 63 | - $context->setFilesystemManager( $fs ); |
|
| 62 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard($config); |
|
| 63 | + $context->setFilesystemManager($fs); |
|
| 64 | 64 | |
| 65 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $config ); |
|
| 66 | - $context->setMessageQueueManager( $mq ); |
|
| 65 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard($config); |
|
| 66 | + $context->setMessageQueueManager($mq); |
|
| 67 | 67 | |
| 68 | 68 | $container = $this->container; |
| 69 | - $mail = new \Aimeos\MW\Mail\Swift( function() use ( $container) { return $container->get( 'mailer' ); } ); |
|
| 70 | - $context->setMail( $mail ); |
|
| 69 | + $mail = new \Aimeos\MW\Mail\Swift(function() use ($container) { return $container->get('mailer'); } ); |
|
| 70 | + $context->setMail($mail); |
|
| 71 | 71 | |
| 72 | - $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context ); |
|
| 73 | - $context->setLogger( $logger ); |
|
| 72 | + $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context); |
|
| 73 | + $context->setLogger($logger); |
|
| 74 | 74 | |
| 75 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context ); |
|
| 76 | - $context->setCache( $cache ); |
|
| 75 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context); |
|
| 76 | + $context->setCache($cache); |
|
| 77 | 77 | |
| 78 | 78 | self::$context = $context; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | $context = self::$context; |
| 82 | 82 | |
| 83 | - if( $locale === true ) |
|
| 83 | + if ($locale === true) |
|
| 84 | 84 | { |
| 85 | - $localeItem = $this->getLocale( $context ); |
|
| 85 | + $localeItem = $this->getLocale($context); |
|
| 86 | 86 | $langid = $localeItem->getLanguageId(); |
| 87 | 87 | |
| 88 | - $context->setLocale( $localeItem ); |
|
| 89 | - $context->setI18n( $this->container->get('aimeos_i18n')->get( array( $langid ) ) ); |
|
| 88 | + $context->setLocale($localeItem); |
|
| 89 | + $context->setI18n($this->container->get('aimeos_i18n')->get(array($langid))); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $session = new \Aimeos\MW\Session\Symfony2( $this->container->get( 'session' ) ); |
|
| 93 | - $context->setSession( $session ); |
|
| 92 | + $session = new \Aimeos\MW\Session\Symfony2($this->container->get('session')); |
|
| 93 | + $context->setSession($session); |
|
| 94 | 94 | |
| 95 | - $this->addUser( $context ); |
|
| 95 | + $this->addUser($context); |
|
| 96 | 96 | |
| 97 | 97 | return $context; |
| 98 | 98 | } |
@@ -103,39 +103,39 @@ discard block |
||
| 103 | 103 | * |
| 104 | 104 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 105 | 105 | */ |
| 106 | - protected function addUser( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 106 | + protected function addUser(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 107 | 107 | { |
| 108 | 108 | $token = null; |
| 109 | 109 | $username = ''; |
| 110 | 110 | |
| 111 | - if( $this->container->has( 'security.token_storage' ) ) { |
|
| 112 | - $token = $this->container->get( 'security.token_storage' )->getToken(); |
|
| 111 | + if ($this->container->has('security.token_storage')) { |
|
| 112 | + $token = $this->container->get('security.token_storage')->getToken(); |
|
| 113 | 113 | } |
| 114 | - else if( $this->container->has( 'security.context' ) ) { |
|
| 115 | - $token = $this->container->get( 'security.context' )->getToken(); |
|
| 114 | + else if ($this->container->has('security.context')) { |
|
| 115 | + $token = $this->container->get('security.context')->getToken(); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - if( is_object( $token ) ) |
|
| 118 | + if (is_object($token)) |
|
| 119 | 119 | { |
| 120 | - if( method_exists( $token->getUser(), 'getId' ) ) |
|
| 120 | + if (method_exists($token->getUser(), 'getId')) |
|
| 121 | 121 | { |
| 122 | 122 | $userid = $token->getUser()->getId(); |
| 123 | - $context->setUserId( $userid ); |
|
| 124 | - $context->setGroupIds( function() use ( $context, $userid ) |
|
| 123 | + $context->setUserId($userid); |
|
| 124 | + $context->setGroupIds(function() use ($context, $userid) |
|
| 125 | 125 | { |
| 126 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
|
| 127 | - return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups(); |
|
| 126 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); |
|
| 127 | + return $manager->getItem($userid, array('customer/group'))->getGroups(); |
|
| 128 | 128 | } ); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if( is_object( $token->getUser() ) ) { |
|
| 132 | - $username = $token->getUser()->getUsername(); |
|
| 131 | + if (is_object($token->getUser())) { |
|
| 132 | + $username = $token->getUser()->getUsername(); |
|
| 133 | 133 | } else { |
| 134 | 134 | $username = $token->getUser(); |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - $context->setEditor( $username ); |
|
| 138 | + $context->setEditor($username); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
@@ -148,25 +148,25 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | $configPaths = $this->container->get('aimeos')->get()->getConfigPaths(); |
| 150 | 150 | |
| 151 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $configPaths ); |
|
| 151 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), $configPaths); |
|
| 152 | 152 | |
| 153 | - $apc = (bool) $this->container->getParameter( 'aimeos_shop.apc_enable' ); |
|
| 154 | - $prefix = $this->container->getParameter( 'aimeos_shop.apc_prefix' ); |
|
| 153 | + $apc = (bool) $this->container->getParameter('aimeos_shop.apc_enable'); |
|
| 154 | + $prefix = $this->container->getParameter('aimeos_shop.apc_prefix'); |
|
| 155 | 155 | |
| 156 | - if( function_exists( 'apc_store' ) === true && $apc === true ) { |
|
| 157 | - $conf = new \Aimeos\MW\Config\Decorator\APC( $conf, $prefix ); |
|
| 156 | + if (function_exists('apc_store') === true && $apc === true) { |
|
| 157 | + $conf = new \Aimeos\MW\Config\Decorator\APC($conf, $prefix); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | $local = array( |
| 161 | - 'admin' => $this->container->getParameter( 'aimeos_shop.admin' ), |
|
| 162 | - 'client' => $this->container->getParameter( 'aimeos_shop.client' ), |
|
| 163 | - 'controller' => $this->container->getParameter( 'aimeos_shop.controller' ), |
|
| 164 | - 'madmin' => $this->container->getParameter( 'aimeos_shop.madmin' ), |
|
| 165 | - 'mshop' => $this->container->getParameter( 'aimeos_shop.mshop' ), |
|
| 166 | - 'resource' => $this->container->getParameter( 'aimeos_shop.resource' ), |
|
| 161 | + 'admin' => $this->container->getParameter('aimeos_shop.admin'), |
|
| 162 | + 'client' => $this->container->getParameter('aimeos_shop.client'), |
|
| 163 | + 'controller' => $this->container->getParameter('aimeos_shop.controller'), |
|
| 164 | + 'madmin' => $this->container->getParameter('aimeos_shop.madmin'), |
|
| 165 | + 'mshop' => $this->container->getParameter('aimeos_shop.mshop'), |
|
| 166 | + 'resource' => $this->container->getParameter('aimeos_shop.resource'), |
|
| 167 | 167 | ); |
| 168 | 168 | |
| 169 | - return new \Aimeos\MW\Config\Decorator\Memory( $conf, $local ); |
|
| 169 | + return new \Aimeos\MW\Config\Decorator\Memory($conf, $local); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
@@ -176,19 +176,19 @@ discard block |
||
| 176 | 176 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 177 | 177 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object |
| 178 | 178 | */ |
| 179 | - protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 179 | + protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 180 | 180 | { |
| 181 | - if( $this->locale === null ) |
|
| 181 | + if ($this->locale === null) |
|
| 182 | 182 | { |
| 183 | - $status = $this->container->getParameter( 'aimeos_shop.disable_sites' ); |
|
| 183 | + $status = $this->container->getParameter('aimeos_shop.disable_sites'); |
|
| 184 | 184 | $request = $this->requestStack->getMasterRequest(); |
| 185 | 185 | |
| 186 | - $site = $request->attributes->get( 'site', $request->query->get( 'site', 'default' ) ); |
|
| 187 | - $currency = $request->attributes->get( 'currency', $request->query->get( 'currency', '' ) ); |
|
| 188 | - $lang = $request->attributes->get( 'locale', $request->query->get( 'locale', '' ) ); |
|
| 186 | + $site = $request->attributes->get('site', $request->query->get('site', 'default')); |
|
| 187 | + $currency = $request->attributes->get('currency', $request->query->get('currency', '')); |
|
| 188 | + $lang = $request->attributes->get('locale', $request->query->get('locale', '')); |
|
| 189 | 189 | |
| 190 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 191 | - $this->locale = $localeManager->bootstrap( $site, $lang, $currency, $status ); |
|
| 190 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 191 | + $this->locale = $localeManager->bootstrap($site, $lang, $currency, $status); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | return $this->locale; |
@@ -210,8 +210,7 @@ |
||
| 210 | 210 | $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
| 211 | 211 | $localeItem->setLanguageId( null ); |
| 212 | 212 | $localeItem->setCurrencyId( null ); |
| 213 | - } |
|
| 214 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 213 | + } catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 215 | 214 | { |
| 216 | 215 | $localeItem = $localeManager->createItem(); |
| 217 | 216 | } |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | * @param string $site Unique site code |
| 150 | 150 | * @param string Resource location, e.g. "product/stock/wareshouse" |
| 151 | 151 | * @param string $lang Language code |
| 152 | - * @return \Aimeos\MShop\Context\Item\Iface Context item |
|
| 152 | + * @return \Aimeos\Admin\JsonAdm\Iface Context item |
|
| 153 | 153 | */ |
| 154 | 154 | protected function createClient( $site, $resource, $lang ) |
| 155 | 155 | { |
@@ -31,15 +31,15 @@ discard block |
||
| 31 | 31 | * @param string $site Unique site code |
| 32 | 32 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
| 33 | 33 | */ |
| 34 | - public function deleteAction( Request $request, $resource, $site = 'default' ) |
|
| 34 | + public function deleteAction(Request $request, $resource, $site = 'default') |
|
| 35 | 35 | { |
| 36 | 36 | $status = 500; |
| 37 | 37 | $header = $request->headers->all(); |
| 38 | 38 | |
| 39 | - $client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
| 40 | - $result = $client->delete( $request->getContent(), $header, $status ); |
|
| 39 | + $client = $this->createClient($site, $resource, $request->get('lang', 'en')); |
|
| 40 | + $result = $client->delete($request->getContent(), $header, $status); |
|
| 41 | 41 | |
| 42 | - return $this->createResponse( $result, $status, $header ); |
|
| 42 | + return $this->createResponse($result, $status, $header); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
@@ -51,15 +51,15 @@ discard block |
||
| 51 | 51 | * @param string $site Unique site code |
| 52 | 52 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
| 53 | 53 | */ |
| 54 | - public function getAction( Request $request, $resource, $site = 'default' ) |
|
| 54 | + public function getAction(Request $request, $resource, $site = 'default') |
|
| 55 | 55 | { |
| 56 | 56 | $status = 500; |
| 57 | 57 | $header = $request->headers->all(); |
| 58 | 58 | |
| 59 | - $client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
| 60 | - $result = $client->get( $request->getContent(), $header, $status ); |
|
| 59 | + $client = $this->createClient($site, $resource, $request->get('lang', 'en')); |
|
| 60 | + $result = $client->get($request->getContent(), $header, $status); |
|
| 61 | 61 | |
| 62 | - return $this->createResponse( $result, $status, $header ); |
|
| 62 | + return $this->createResponse($result, $status, $header); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
@@ -71,15 +71,15 @@ discard block |
||
| 71 | 71 | * @param string $site Unique site code |
| 72 | 72 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
| 73 | 73 | */ |
| 74 | - public function patchAction( Request $request, $resource, $site = 'default' ) |
|
| 74 | + public function patchAction(Request $request, $resource, $site = 'default') |
|
| 75 | 75 | { |
| 76 | 76 | $status = 500; |
| 77 | 77 | $header = $request->headers->all(); |
| 78 | 78 | |
| 79 | - $client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
| 80 | - $result = $client->patch( $request->getContent(), $header, $status ); |
|
| 79 | + $client = $this->createClient($site, $resource, $request->get('lang', 'en')); |
|
| 80 | + $result = $client->patch($request->getContent(), $header, $status); |
|
| 81 | 81 | |
| 82 | - return $this->createResponse( $result, $status, $header ); |
|
| 82 | + return $this->createResponse($result, $status, $header); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
@@ -91,15 +91,15 @@ discard block |
||
| 91 | 91 | * @param string $site Unique site code |
| 92 | 92 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
| 93 | 93 | */ |
| 94 | - public function postAction( Request $request, $resource, $site = 'default' ) |
|
| 94 | + public function postAction(Request $request, $resource, $site = 'default') |
|
| 95 | 95 | { |
| 96 | 96 | $status = 500; |
| 97 | 97 | $header = $request->headers->all(); |
| 98 | 98 | |
| 99 | - $client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
| 100 | - $result = $client->post( $request->getContent(), $header, $status ); |
|
| 99 | + $client = $this->createClient($site, $resource, $request->get('lang', 'en')); |
|
| 100 | + $result = $client->post($request->getContent(), $header, $status); |
|
| 101 | 101 | |
| 102 | - return $this->createResponse( $result, $status, $header ); |
|
| 102 | + return $this->createResponse($result, $status, $header); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
@@ -111,15 +111,15 @@ discard block |
||
| 111 | 111 | * @param string $site Unique site code |
| 112 | 112 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
| 113 | 113 | */ |
| 114 | - public function putAction( Request $request, $resource, $site = 'default' ) |
|
| 114 | + public function putAction(Request $request, $resource, $site = 'default') |
|
| 115 | 115 | { |
| 116 | 116 | $status = 500; |
| 117 | 117 | $header = $request->headers->all(); |
| 118 | 118 | |
| 119 | - $client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
| 120 | - $result = $client->put( $request->getContent(), $header, $status ); |
|
| 119 | + $client = $this->createClient($site, $resource, $request->get('lang', 'en')); |
|
| 120 | + $result = $client->put($request->getContent(), $header, $status); |
|
| 121 | 121 | |
| 122 | - return $this->createResponse( $result, $status, $header ); |
|
| 122 | + return $this->createResponse($result, $status, $header); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
@@ -131,15 +131,15 @@ discard block |
||
| 131 | 131 | * @param string $site Unique site code |
| 132 | 132 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
| 133 | 133 | */ |
| 134 | - public function optionsAction( Request $request, $resource = '', $site = 'default' ) |
|
| 134 | + public function optionsAction(Request $request, $resource = '', $site = 'default') |
|
| 135 | 135 | { |
| 136 | 136 | $status = 500; |
| 137 | 137 | $header = $request->headers->all(); |
| 138 | 138 | |
| 139 | - $client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
| 140 | - $result = $client->options( $request->getContent(), $header, $status ); |
|
| 139 | + $client = $this->createClient($site, $resource, $request->get('lang', 'en')); |
|
| 140 | + $result = $client->options($request->getContent(), $header, $status); |
|
| 141 | 141 | |
| 142 | - return $this->createResponse( $result, $status, $header ); |
|
| 142 | + return $this->createResponse($result, $status, $header); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
@@ -151,18 +151,18 @@ discard block |
||
| 151 | 151 | * @param string $lang Language code |
| 152 | 152 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
| 153 | 153 | */ |
| 154 | - protected function createClient( $site, $resource, $lang ) |
|
| 154 | + protected function createClient($site, $resource, $lang) |
|
| 155 | 155 | { |
| 156 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
| 157 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' ); |
|
| 156 | + $aimeos = $this->get('aimeos')->get(); |
|
| 157 | + $templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates'); |
|
| 158 | 158 | |
| 159 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
| 160 | - $context = $this->setLocale( $context, $site, $lang ); |
|
| 159 | + $context = $this->get('aimeos_context')->get(false); |
|
| 160 | + $context = $this->setLocale($context, $site, $lang); |
|
| 161 | 161 | |
| 162 | - $view = $this->get('aimeos_view')->create( $context, $templatePaths, $lang ); |
|
| 163 | - $context->setView( $view ); |
|
| 162 | + $view = $this->get('aimeos_view')->create($context, $templatePaths, $lang); |
|
| 163 | + $context->setView($view); |
|
| 164 | 164 | |
| 165 | - return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
| 165 | + return \Aimeos\Admin\JsonAdm\Factory::createClient($context, $templatePaths, $resource); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
@@ -174,14 +174,14 @@ discard block |
||
| 174 | 174 | * @param array $header List of HTTP headers |
| 175 | 175 | * @return Response HTTP response object |
| 176 | 176 | */ |
| 177 | - protected function createResponse( $content, $status, array $header ) |
|
| 177 | + protected function createResponse($content, $status, array $header) |
|
| 178 | 178 | { |
| 179 | 179 | $response = new Response(); |
| 180 | - $response->setContent( $content ); |
|
| 181 | - $response->setStatusCode( $status ); |
|
| 180 | + $response->setContent($content); |
|
| 181 | + $response->setStatusCode($status); |
|
| 182 | 182 | |
| 183 | - foreach( $header as $key => $value ) { |
|
| 184 | - $response->headers->set( $key, $value ); |
|
| 183 | + foreach ($header as $key => $value) { |
|
| 184 | + $response->headers->set($key, $value); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | return $response; |
@@ -196,23 +196,23 @@ discard block |
||
| 196 | 196 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
| 197 | 197 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 198 | 198 | */ |
| 199 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $site, $lang ) |
|
| 199 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $site, $lang) |
|
| 200 | 200 | { |
| 201 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
| 201 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
| 202 | 202 | |
| 203 | 203 | try |
| 204 | 204 | { |
| 205 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
| 206 | - $localeItem->setLanguageId( null ); |
|
| 207 | - $localeItem->setCurrencyId( null ); |
|
| 205 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
| 206 | + $localeItem->setLanguageId(null); |
|
| 207 | + $localeItem->setCurrencyId(null); |
|
| 208 | 208 | } |
| 209 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 209 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
| 210 | 210 | { |
| 211 | 211 | $localeItem = $localeManager->createItem(); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - $context->setLocale( $localeItem ); |
|
| 215 | - $context->setI18n( $this->get('aimeos_i18n')->get( array( $lang ) ) ); |
|
| 214 | + $context->setLocale($localeItem); |
|
| 215 | + $context->setI18n($this->get('aimeos_i18n')->get(array($lang))); |
|
| 216 | 216 | |
| 217 | 217 | return $context; |
| 218 | 218 | } |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function confirmAction() |
| 30 | 30 | { |
| 31 | - $params = $this->get( 'aimeos_page' )->getSections( 'checkout-confirm' ); |
|
| 32 | - return $this->render( 'AimeosShopBundle:Checkout:confirm.html.twig', $params ); |
|
| 31 | + $params = $this->get('aimeos_page')->getSections('checkout-confirm'); |
|
| 32 | + return $this->render('AimeosShopBundle:Checkout:confirm.html.twig', $params); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function indexAction() |
| 42 | 42 | { |
| 43 | - $params = $this->get( 'aimeos_page' )->getSections( 'checkout-index' ); |
|
| 44 | - return $this->render( 'AimeosShopBundle:Checkout:index.html.twig', $params ); |
|
| 43 | + $params = $this->get('aimeos_page')->getSections('checkout-index'); |
|
| 44 | + return $this->render('AimeosShopBundle:Checkout:index.html.twig', $params); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function updateAction() |
| 54 | 54 | { |
| 55 | - $params = $this->get( 'aimeos_page' )->getSections( 'checkout-update' ); |
|
| 56 | - return $this->render( 'AimeosShopBundle:Checkout:update.html.twig', $params ); |
|
| 55 | + $params = $this->get('aimeos_page')->getSections('checkout-update'); |
|
| 56 | + return $this->render('AimeosShopBundle:Checkout:update.html.twig', $params); |
|
| 57 | 57 | } |
| 58 | 58 | } |