@@ -9,57 +9,57 @@ |
||
9 | 9 | |
10 | 10 | if( !function_exists( 'aiconfig' ) ) |
11 | 11 | { |
12 | - /** |
|
13 | - * Returns the configuration setting for the given key |
|
14 | - * |
|
15 | - * @param string $key Configuration key |
|
16 | - * @param mixed $default Default value if the configuration key isn't found |
|
17 | - * @return mixed Configuration value |
|
18 | - */ |
|
19 | - function aiconfig( $key, $default = null ) |
|
20 | - { |
|
21 | - return app( '\Aimeos\Shop\Base\Config' )->get()->get( $key, $default ); |
|
22 | - } |
|
12 | + /** |
|
13 | + * Returns the configuration setting for the given key |
|
14 | + * |
|
15 | + * @param string $key Configuration key |
|
16 | + * @param mixed $default Default value if the configuration key isn't found |
|
17 | + * @return mixed Configuration value |
|
18 | + */ |
|
19 | + function aiconfig( $key, $default = null ) |
|
20 | + { |
|
21 | + return app( '\Aimeos\Shop\Base\Config' )->get()->get( $key, $default ); |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | if( !function_exists( 'aitrans' ) ) |
27 | 27 | { |
28 | - /** |
|
29 | - * Translates the given message |
|
30 | - * |
|
31 | - * @param string $singular Message to translate |
|
32 | - * @param array $params List of paramters for replacing the placeholders in that order |
|
33 | - * @param string $domain Translation domain |
|
34 | - * @param string $locale ISO language code, maybe combine with ISO currency code, e.g. "en_US" |
|
35 | - * @return string Translated string |
|
36 | - */ |
|
37 | - function aitrans( $singular, array $params = array(), $domain = 'client', $locale = null ) |
|
38 | - { |
|
39 | - $i18n = app( '\Aimeos\Shop\Base\Context' )->get()->getI18n( $locale ); |
|
28 | + /** |
|
29 | + * Translates the given message |
|
30 | + * |
|
31 | + * @param string $singular Message to translate |
|
32 | + * @param array $params List of paramters for replacing the placeholders in that order |
|
33 | + * @param string $domain Translation domain |
|
34 | + * @param string $locale ISO language code, maybe combine with ISO currency code, e.g. "en_US" |
|
35 | + * @return string Translated string |
|
36 | + */ |
|
37 | + function aitrans( $singular, array $params = array(), $domain = 'client', $locale = null ) |
|
38 | + { |
|
39 | + $i18n = app( '\Aimeos\Shop\Base\Context' )->get()->getI18n( $locale ); |
|
40 | 40 | |
41 | - return vsprintf( $i18n->dt( $domain, $singular ), $params ); |
|
42 | - } |
|
41 | + return vsprintf( $i18n->dt( $domain, $singular ), $params ); |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
46 | 46 | if( !function_exists( 'aitransplural' ) ) |
47 | 47 | { |
48 | - /** |
|
49 | - * Translates the given messages based on the number |
|
50 | - * |
|
51 | - * @param string $singular Message to translate |
|
52 | - * @param string $plural Message for plural translations |
|
53 | - * @param integer $number Count of items to chose the correct plural translation |
|
54 | - * @param array $params List of paramters for replacing the placeholders in that order |
|
55 | - * @param string $domain Translation domain |
|
56 | - * @param string $locale ISO language code, maybe combine with ISO currency code, e.g. "en_US" |
|
57 | - * @return string Translated string |
|
58 | - */ |
|
59 | - function aitransplural( $singular, $plural, $number, array $params = array(), $domain = 'client', $locale = null ) |
|
60 | - { |
|
61 | - $i18n = app( '\Aimeos\Shop\Base\Context' )->get()->getI18n( $locale ); |
|
48 | + /** |
|
49 | + * Translates the given messages based on the number |
|
50 | + * |
|
51 | + * @param string $singular Message to translate |
|
52 | + * @param string $plural Message for plural translations |
|
53 | + * @param integer $number Count of items to chose the correct plural translation |
|
54 | + * @param array $params List of paramters for replacing the placeholders in that order |
|
55 | + * @param string $domain Translation domain |
|
56 | + * @param string $locale ISO language code, maybe combine with ISO currency code, e.g. "en_US" |
|
57 | + * @return string Translated string |
|
58 | + */ |
|
59 | + function aitransplural( $singular, $plural, $number, array $params = array(), $domain = 'client', $locale = null ) |
|
60 | + { |
|
61 | + $i18n = app( '\Aimeos\Shop\Base\Context' )->get()->getI18n( $locale ); |
|
62 | 62 | |
63 | - return vsprintf( $i18n->dn( $domain, $singular, $plural, $number ), $params ); |
|
64 | - } |
|
63 | + return vsprintf( $i18n->dn( $domain, $singular, $plural, $number ), $params ); |
|
64 | + } |
|
65 | 65 | } |
@@ -18,13 +18,13 @@ |
||
18 | 18 | */ |
19 | 19 | class Shop extends \Illuminate\Support\Facades\Facade |
20 | 20 | { |
21 | - /** |
|
22 | - * Get the registered name of the component. |
|
23 | - * |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - protected static function getFacadeAccessor() |
|
27 | - { |
|
28 | - return 'aimeos.shop'; |
|
29 | - } |
|
21 | + /** |
|
22 | + * Get the registered name of the component. |
|
23 | + * |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + protected static function getFacadeAccessor() |
|
27 | + { |
|
28 | + return 'aimeos.shop'; |
|
29 | + } |
|
30 | 30 | } |
@@ -5,66 +5,66 @@ |
||
5 | 5 | public function setUp() |
6 | 6 | { |
7 | 7 | parent::setUp(); |
8 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
8 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | |
12 | 12 | public function testCountAction() |
13 | 13 | { |
14 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@countAction', ['site' => 'unittest']); |
|
14 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@countAction', ['site' => 'unittest'] ); |
|
15 | 15 | |
16 | 16 | $this->assertResponseOk(); |
17 | - $this->assertContains('.catalog-filter-count', $response->getContent()); |
|
18 | - $this->assertContains('.catalog-filter-attribute', $response->getContent()); |
|
17 | + $this->assertContains( '.catalog-filter-count', $response->getContent() ); |
|
18 | + $this->assertContains( '.catalog-filter-attribute', $response->getContent() ); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | |
22 | 22 | public function testDetailAction() |
23 | 23 | { |
24 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@detailAction', ['site' => 'unittest']); |
|
24 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@detailAction', ['site' => 'unittest'] ); |
|
25 | 25 | |
26 | 26 | $this->assertResponseOk(); |
27 | - $this->assertContains('<section class="aimeos catalog-stage"', $response->getContent()); |
|
28 | - $this->assertContains('<section class="aimeos catalog-detail"', $response->getContent()); |
|
29 | - $this->assertContains('<section class="aimeos catalog-session"', $response->getContent()); |
|
27 | + $this->assertContains( '<section class="aimeos catalog-stage"', $response->getContent() ); |
|
28 | + $this->assertContains( '<section class="aimeos catalog-detail"', $response->getContent() ); |
|
29 | + $this->assertContains( '<section class="aimeos catalog-session"', $response->getContent() ); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testListAction() |
34 | 34 | { |
35 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@listAction', ['site' => 'unittest']); |
|
35 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@listAction', ['site' => 'unittest'] ); |
|
36 | 36 | |
37 | 37 | $this->assertResponseOk(); |
38 | - $this->assertContains('<section class="aimeos catalog-filter"', $response->getContent()); |
|
39 | - $this->assertContains('<section class="aimeos catalog-list"', $response->getContent()); |
|
38 | + $this->assertContains( '<section class="aimeos catalog-filter"', $response->getContent() ); |
|
39 | + $this->assertContains( '<section class="aimeos catalog-list"', $response->getContent() ); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | 43 | public function testStockAction() |
44 | 44 | { |
45 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@stockAction', ['site' => 'unittest']); |
|
45 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@stockAction', ['site' => 'unittest'] ); |
|
46 | 46 | |
47 | 47 | $this->assertResponseOk(); |
48 | - $this->assertContains('.aimeos .product .stock', $response->getContent()); |
|
48 | + $this->assertContains( '.aimeos .product .stock', $response->getContent() ); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testSuggestAction() |
53 | 53 | { |
54 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@suggestAction', ['site' => 'unittest'], ['f_search' => 'Cafe']); |
|
54 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@suggestAction', ['site' => 'unittest'], ['f_search' => 'Cafe'] ); |
|
55 | 55 | |
56 | 56 | $this->assertResponseOk(); |
57 | - $this->assertRegexp('/[{.*}]/', $response->getContent()); |
|
57 | + $this->assertRegexp( '/[{.*}]/', $response->getContent() ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | 61 | public function testTreeAction() |
62 | 62 | { |
63 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@treeAction', ['site' => 'unittest', 'f_catid' => 1, 'f_name' => 'test']); |
|
63 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@treeAction', ['site' => 'unittest', 'f_catid' => 1, 'f_name' => 'test'] ); |
|
64 | 64 | |
65 | 65 | $this->assertResponseOk(); |
66 | - $this->assertContains('<section class="aimeos catalog-filter', $response->getContent()); |
|
67 | - $this->assertContains('<section class="aimeos catalog-stage', $response->getContent()); |
|
68 | - $this->assertContains('<section class="aimeos catalog-list', $response->getContent()); |
|
66 | + $this->assertContains( '<section class="aimeos catalog-filter', $response->getContent() ); |
|
67 | + $this->assertContains( '<section class="aimeos catalog-stage', $response->getContent() ); |
|
68 | + $this->assertContains( '<section class="aimeos catalog-list', $response->getContent() ); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | \ No newline at end of file |
@@ -5,33 +5,33 @@ |
||
5 | 5 | public function setUp() |
6 | 6 | { |
7 | 7 | parent::setUp(); |
8 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
8 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | |
12 | 12 | public function testConfirmAction() |
13 | 13 | { |
14 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CheckoutController@confirmAction', ['site' => 'unittest']); |
|
14 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CheckoutController@confirmAction', ['site' => 'unittest'] ); |
|
15 | 15 | |
16 | 16 | $this->assertResponseOk(); |
17 | - $this->assertContains('<section class="aimeos checkout-confirm"', $response->getContent()); |
|
17 | + $this->assertContains( '<section class="aimeos checkout-confirm"', $response->getContent() ); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | |
21 | 21 | public function testIndexAction() |
22 | 22 | { |
23 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CheckoutController@indexAction', ['site' => 'unittest']); |
|
23 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CheckoutController@indexAction', ['site' => 'unittest'] ); |
|
24 | 24 | |
25 | 25 | $this->assertResponseOk(); |
26 | - $this->assertContains('<section class="checkout-standard-address"', $response->getContent()); |
|
26 | + $this->assertContains( '<section class="checkout-standard-address"', $response->getContent() ); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testUpdateAction() |
31 | 31 | { |
32 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CheckoutController@updateAction', ['site' => 'unittest'], ['code' => 'paypalexpress']); |
|
32 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CheckoutController@updateAction', ['site' => 'unittest'], ['code' => 'paypalexpress'] ); |
|
33 | 33 | |
34 | 34 | $this->assertResponseOk(); |
35 | - $this->assertEquals('', $response->getContent()); |
|
35 | + $this->assertEquals( '', $response->getContent() ); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | \ No newline at end of file |
@@ -5,32 +5,32 @@ discard block |
||
5 | 5 | public function setUp() |
6 | 6 | { |
7 | 7 | parent::setUp(); |
8 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
8 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | |
12 | 12 | public function testFileActionCss() |
13 | 13 | { |
14 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JqadmController@fileAction', ['site' => 'unittest', 'type' => 'css']); |
|
14 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JqadmController@fileAction', ['site' => 'unittest', 'type' => 'css'] ); |
|
15 | 15 | |
16 | 16 | $this->assertResponseOk(); |
17 | - $this->assertContains('.aimeos', $response->getContent()); |
|
17 | + $this->assertContains( '.aimeos', $response->getContent() ); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | |
21 | 21 | public function testFileActionJs() |
22 | 22 | { |
23 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JqadmController@fileAction', ['site' => 'unittest', 'type' => 'js']); |
|
23 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JqadmController@fileAction', ['site' => 'unittest', 'type' => 'js'] ); |
|
24 | 24 | |
25 | 25 | $this->assertResponseOk(); |
26 | - $this->assertContains('Aimeos = {', $response->getContent()); |
|
26 | + $this->assertContains( 'Aimeos = {', $response->getContent() ); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testCopyAction() |
31 | 31 | { |
32 | 32 | $params = ['site' => 'unittest', 'resource' => 'product', 'id' => '0']; |
33 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JqadmController@copyAction', $params); |
|
33 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JqadmController@copyAction', $params ); |
|
34 | 34 | |
35 | 35 | $this->assertEquals( 200, $response->getStatusCode() ); |
36 | 36 | $this->assertContains( 'item-product', $response->getContent() ); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public function testCreateAction() |
41 | 41 | { |
42 | 42 | $params = ['site' => 'unittest', 'resource' => 'product']; |
43 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JqadmController@createAction', $params); |
|
43 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JqadmController@createAction', $params ); |
|
44 | 44 | |
45 | 45 | $this->assertEquals( 200, $response->getStatusCode() ); |
46 | 46 | $this->assertContains( 'item-product', $response->getContent() ); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function testDeleteAction() |
51 | 51 | { |
52 | 52 | $params = ['site' => 'unittest', 'resource' => 'product', 'id' => '0']; |
53 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JqadmController@deleteAction', $params); |
|
53 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JqadmController@deleteAction', $params ); |
|
54 | 54 | |
55 | 55 | $this->assertEquals( 200, $response->getStatusCode() ); |
56 | 56 | $this->assertContains( 'list-items', $response->getContent() ); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function testExportAction() |
61 | 61 | { |
62 | 62 | $params = ['site' => 'unittest', 'resource' => 'order']; |
63 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JqadmController@exportAction', $params); |
|
63 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JqadmController@exportAction', $params ); |
|
64 | 64 | |
65 | 65 | $this->assertEquals( 200, $response->getStatusCode() ); |
66 | 66 | $this->assertContains( 'list-items', $response->getContent() ); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | public function testGetAction() |
71 | 71 | { |
72 | 72 | $params = ['site' => 'unittest', 'resource' => 'product', 'id' => '0']; |
73 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JqadmController@getAction', $params); |
|
73 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JqadmController@getAction', $params ); |
|
74 | 74 | |
75 | 75 | $this->assertEquals( 200, $response->getStatusCode() ); |
76 | 76 | $this->assertContains( 'item-product', $response->getContent() ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | public function testSaveAction() |
81 | 81 | { |
82 | 82 | $params = ['site' => 'unittest', 'resource' => 'product', 'id' => '0']; |
83 | - $response = $this->action('POST', '\Aimeos\Shop\Controller\JqadmController@saveAction', $params); |
|
83 | + $response = $this->action( 'POST', '\Aimeos\Shop\Controller\JqadmController@saveAction', $params ); |
|
84 | 84 | |
85 | 85 | $this->assertEquals( 200, $response->getStatusCode() ); |
86 | 86 | $this->assertContains( 'item-product', $response->getContent() ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function testSearchAction() |
91 | 91 | { |
92 | 92 | $params = ['site' => 'unittest', 'resource' => 'product']; |
93 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JqadmController@searchAction', $params); |
|
93 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JqadmController@searchAction', $params ); |
|
94 | 94 | |
95 | 95 | $this->assertEquals( 200, $response->getStatusCode() ); |
96 | 96 | $this->assertContains( 'list-items', $response->getContent() ); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | public function testSearchActionSite() |
101 | 101 | { |
102 | 102 | $params = ['site' => 'invalid', 'resource' => 'product']; |
103 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JqadmController@searchAction', $params); |
|
103 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JqadmController@searchAction', $params ); |
|
104 | 104 | |
105 | 105 | $this->assertEquals( 500, $response->getStatusCode() ); |
106 | 106 | } |
@@ -5,25 +5,25 @@ |
||
5 | 5 | public function setUp() |
6 | 6 | { |
7 | 7 | parent::setUp(); |
8 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
8 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | |
12 | 12 | public function testActions() |
13 | 13 | { |
14 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\AccountController@indexAction', ['site' => 'unittest']); |
|
14 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\AccountController@indexAction', ['site' => 'unittest'] ); |
|
15 | 15 | |
16 | 16 | $this->assertResponseOk(); |
17 | - $this->assertContains('<section class="aimeos account-profile"', $response->getContent()); |
|
18 | - $this->assertContains('<section class="aimeos account-history"', $response->getContent()); |
|
19 | - $this->assertContains('<section class="aimeos account-favorite"', $response->getContent()); |
|
20 | - $this->assertContains('<section class="aimeos account-watch"', $response->getContent()); |
|
17 | + $this->assertContains( '<section class="aimeos account-profile"', $response->getContent() ); |
|
18 | + $this->assertContains( '<section class="aimeos account-history"', $response->getContent() ); |
|
19 | + $this->assertContains( '<section class="aimeos account-favorite"', $response->getContent() ); |
|
20 | + $this->assertContains( '<section class="aimeos account-watch"', $response->getContent() ); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testDownload() |
25 | 25 | { |
26 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\AccountController@downloadAction', ['site' => 'unittest', 'dl_id' => 0]); |
|
26 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\AccountController@downloadAction', ['site' => 'unittest', 'dl_id' => 0] ); |
|
27 | 27 | |
28 | 28 | $this->assertEquals( 401, $response->getStatusCode() ); |
29 | 29 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | { |
5 | 5 | public function testIndexAction() |
6 | 6 | { |
7 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\AdminController@indexAction'); |
|
7 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\AdminController@indexAction' ); |
|
8 | 8 | |
9 | 9 | $this->assertEquals( '302', $response->getStatusCode() ); |
10 | 10 | } |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | public function setUp() |
6 | 6 | { |
7 | 7 | parent::setUp(); |
8 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
8 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | |
12 | 12 | public function testOptionsAction() |
13 | 13 | { |
14 | 14 | $params = ['site' => 'unittest']; |
15 | - $response = $this->action('OPTIONS', '\Aimeos\Shop\Controller\JsonapiController@optionsAction', $params); |
|
15 | + $response = $this->action( 'OPTIONS', '\Aimeos\Shop\Controller\JsonapiController@optionsAction', $params ); |
|
16 | 16 | |
17 | 17 | $json = json_decode( $response->getContent(), true ); |
18 | 18 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $params = ['site' => 'unittest', 'resource' => 'product']; |
29 | 29 | $getParams = ['filter' => ['f_search' => 'Cafe Noire Cap']]; |
30 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JsonapiController@getAction', $params, $getParams); |
|
30 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JsonapiController@getAction', $params, $getParams ); |
|
31 | 31 | |
32 | 32 | $json = json_decode( $response->getContent(), true ); |
33 | 33 | |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | $id = $json['data'][0]['id']; |
42 | 42 | |
43 | 43 | |
44 | - $params = ['site' => 'unittest', 'resource' => 'product', 'id' => $id ]; |
|
45 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JsonapiController@getAction', $params); |
|
44 | + $params = ['site' => 'unittest', 'resource' => 'product', 'id' => $id]; |
|
45 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JsonapiController@getAction', $params ); |
|
46 | 46 | |
47 | 47 | $json = json_decode( $response->getContent(), true ); |
48 | 48 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | // get CNC product |
60 | 60 | $params = ['site' => 'unittest', 'resource' => 'product']; |
61 | 61 | $getParams = ['filter' => ['f_search' => 'Cafe Noire Cap', 'f_listtype' => 'unittype19']]; |
62 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\JsonapiController@getAction', $params, $getParams); |
|
62 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\JsonapiController@getAction', $params, $getParams ); |
|
63 | 63 | |
64 | 64 | $json = json_decode( $response->getContent(), true ); |
65 | 65 | $this->assertEquals( 'CNC', $json['data'][0]['attributes']['product.code'] ); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | // add CNC product to basket |
68 | 68 | $params = ['site' => 'unittest', 'resource' => 'basket', 'id' => 'default', 'related' => 'product']; |
69 | 69 | $content = json_encode( ['data' => ['attributes' => ['product.id' => $json['data'][0]['id']]]] ); |
70 | - $response = $this->action('POST', '\Aimeos\Shop\Controller\JsonapiController@postAction', $params, [], [], [], [], $content); |
|
70 | + $response = $this->action( 'POST', '\Aimeos\Shop\Controller\JsonapiController@postAction', $params, [], [], [], [], $content ); |
|
71 | 71 | |
72 | 72 | $json = json_decode( $response->getContent(), true ); |
73 | 73 | $this->assertEquals( 'CNC', $json['included'][0]['attributes']['order.base.product.prodcode'] ); |
@@ -75,14 +75,14 @@ discard block |
||
75 | 75 | // change product quantity in basket |
76 | 76 | $params = ['site' => 'unittest', 'resource' => 'basket', 'id' => 'default', 'related' => 'product', 'relatedid' => 0]; |
77 | 77 | $content = json_encode( ['data' => ['attributes' => ['quantity' => 2]]] ); |
78 | - $response = $this->action('PATCH', '\Aimeos\Shop\Controller\JsonapiController@patchAction', $params, [], [], [], [], $content); |
|
78 | + $response = $this->action( 'PATCH', '\Aimeos\Shop\Controller\JsonapiController@patchAction', $params, [], [], [], [], $content ); |
|
79 | 79 | |
80 | 80 | $json = json_decode( $response->getContent(), true ); |
81 | 81 | $this->assertEquals( 2, $json['included'][0]['attributes']['order.base.product.quantity'] ); |
82 | 82 | |
83 | 83 | // delete product from basket |
84 | 84 | $params = ['site' => 'unittest', 'resource' => 'basket', 'id' => 'default', 'related' => 'product', 'relatedid' => 0]; |
85 | - $response = $this->action('DELETE', '\Aimeos\Shop\Controller\JsonapiController@deleteAction', $params); |
|
85 | + $response = $this->action( 'DELETE', '\Aimeos\Shop\Controller\JsonapiController@deleteAction', $params ); |
|
86 | 86 | |
87 | 87 | $json = json_decode( $response->getContent(), true ); |
88 | 88 | $this->assertEquals( 0, count( $json['included'] ) ); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | public function testPutAction() |
93 | 93 | { |
94 | 94 | $params = ['site' => 'unittest', 'resource' => 'basket']; |
95 | - $response = $this->action('PUT', '\Aimeos\Shop\Controller\JsonapiController@putAction', $params); |
|
95 | + $response = $this->action( 'PUT', '\Aimeos\Shop\Controller\JsonapiController@putAction', $params ); |
|
96 | 96 | |
97 | 97 | $json = json_decode( $response->getContent(), true ); |
98 | 98 | $this->assertArrayHasKey( 'errors', $json ); |
@@ -5,20 +5,20 @@ |
||
5 | 5 | public function setUp() |
6 | 6 | { |
7 | 7 | parent::setUp(); |
8 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
8 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | |
12 | 12 | public function testPrivacyAction() |
13 | 13 | { |
14 | - $this->action('GET', '\Aimeos\Shop\Controller\PageController@privacyAction', ['site' => 'unittest']); |
|
14 | + $this->action( 'GET', '\Aimeos\Shop\Controller\PageController@privacyAction', ['site' => 'unittest'] ); |
|
15 | 15 | $this->assertResponseOk(); |
16 | 16 | } |
17 | 17 | |
18 | 18 | |
19 | 19 | public function testTermsAction() |
20 | 20 | { |
21 | - $this->action('GET', '\Aimeos\Shop\Controller\PageController@termsAction', ['site' => 'unittest']); |
|
21 | + $this->action( 'GET', '\Aimeos\Shop\Controller\PageController@termsAction', ['site' => 'unittest'] ); |
|
22 | 22 | $this->assertResponseOk(); |
23 | 23 | } |
24 | 24 | } |
25 | 25 | \ No newline at end of file |