From 3fcb93fda751966e1903300e68637be2fdeabd66 Mon Sep 17 00:00:00 2001 From: Annika Wolff Date: Thu, 16 Jan 2020 13:57:03 +0100 Subject: [PATCH 01/34] add docker-compose-collection to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index fa1eccb1e..00fbc0be4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/docker-compose-collection +/bin /node_modules /public/hot /public/storage From 132dd6c0f0ef466f7e726350667e032df450d7ee Mon Sep 17 00:00:00 2001 From: Annika Wolff Date: Fri, 17 Jan 2020 14:42:47 +0100 Subject: [PATCH 02/34] introduce guest checkout configuration --- package.json | 10 +- packages/Webkul/Admin/src/Config/system.php | 13 +- .../Admin/src/Resources/lang/en/app.php | 3 + .../views/catalog/products/edit.blade.php | 4 + .../views/configuration/index.blade.php | 5 + .../Seeders/AttributeFamilyTableSeeder.php | 6 +- .../Seeders/AttributeGroupTableSeeder.php | 16 +- .../Seeders/AttributeOptionTableSeeder.php | 3 +- .../Database/Seeders/AttributeTableSeeder.php | 14 +- .../src/Database/Seeders/DatabaseSeeder.php | 4 +- .../Database/Seeders/CMSPagesTableSeeder.php | 5 +- packages/Webkul/Checkout/src/Models/Cart.php | 20 +- .../Database/Seeders/ConfigTableSeeder.php | 27 ++ .../src/Database/Seeders/DatabaseSeeder.php | 1 + .../Core/src/Helpers/Laravel5Helper.php | 115 ++++++++ .../Factories/InventorySourceFactory.php | 27 ++ .../ProductAttributeValueFactory.php | 261 ++++++++++++++++++ .../src/Database/Factories/ProductFactory.php | 23 ++ .../Factories/ProductInventoryFactory.php | 20 ++ .../src/Providers/ProductServiceProvider.php | 30 +- .../Webkul/Product/src/Type/Downloadable.php | 16 +- .../Http/Controllers/OnepageController.php | 11 +- tests/_support/AcceptanceTester.php | 16 ++ tests/_support/FunctionalTester.php | 23 ++ tests/acceptance.suite.yml | 24 +- tests/acceptance/GuestCheckoutCest.php | 59 ++++ tests/functional.suite.yml | 4 +- tests/functional/Product/ProductCest.php | 2 +- tests/functional/Shop/GuestCheckoutCest.php | 90 ++++++ 29 files changed, 812 insertions(+), 40 deletions(-) create mode 100644 packages/Webkul/Core/src/Database/Seeders/ConfigTableSeeder.php create mode 100644 packages/Webkul/Core/src/Helpers/Laravel5Helper.php create mode 100644 packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php create mode 100644 packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php create mode 100644 packages/Webkul/Product/src/Database/Factories/ProductFactory.php create mode 100644 packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php create mode 100644 tests/acceptance/GuestCheckoutCest.php create mode 100644 tests/functional/Shop/GuestCheckoutCest.php diff --git a/package.json b/package.json index 88cbe757f..103d618f3 100755 --- a/package.json +++ b/package.json @@ -13,12 +13,16 @@ "devDependencies": { "axios": "^0.18", "bootstrap": "^4.0.0", - "popper.js": "^1.12", "cross-env": "^5.1", "jquery": "^3.2", - "laravel-mix": "^2.0", + "laravel-mix": "^5.0.1", "lodash": "^4.17.4", - "vue": "^2.5.7" + "popper.js": "^1.12", + "resolve-url-loader": "^3.1.0", + "sass": "^1.24.5", + "sass-loader": "^8.0.2", + "vue": "^2.5.7", + "vue-template-compiler": "^2.6.11" }, "dependencies": { "opencollective-postinstall": "^2.0.1", diff --git a/packages/Webkul/Admin/src/Config/system.php b/packages/Webkul/Admin/src/Config/system.php index d9a39ee19..39148ce20 100644 --- a/packages/Webkul/Admin/src/Config/system.php +++ b/packages/Webkul/Admin/src/Config/system.php @@ -87,10 +87,21 @@ return [ 'key' => 'catalog.products', 'name' => 'admin::app.admin.system.products', 'sort' => 2 + ], [ + 'key' => 'catalog.products.guest-checkout', + 'name' => 'admin::app.admin.system.guest-checkout', + 'sort' => 1, + 'fields' => [ + [ + 'name' => 'allow-guest-checkout', + 'title' => 'admin::app.admin.system.allow-guest-checkout', + 'type' => 'boolean' + ] + ] ], [ 'key' => 'catalog.products.review', 'name' => 'admin::app.admin.system.review', - 'sort' => 1, + 'sort' => 2, 'fields' => [ [ 'name' => 'guest_review', diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 71aa08dac..adae4ecc7 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -1202,6 +1202,9 @@ return [ 'system' => [ 'catalog' => 'Catalog', 'products' => 'Products', + 'guest-checkout' => 'Guest Checkout', + 'allow-guest-checkout' => 'Allow Guest Checkout', + 'allow-guest-checkout-hint' => 'Hint: If turned on, this option can be configured for each product specifically.', 'review' => 'Review', 'allow-guest-review' => 'Allow Guest Review', 'inventory' => 'Inventory', diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php index e76ff2035..6adba4afc 100755 --- a/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php @@ -77,6 +77,10 @@ @foreach ($customAttributes as $attribute) code == 'guest_checkout' && ! core()->getConfigData('catalog.products.guest-checkout.allow-guest-checkout')) { + continue; + } + $validations = []; if ($attribute->is_required) { diff --git a/packages/Webkul/Admin/src/Resources/views/configuration/index.blade.php b/packages/Webkul/Admin/src/Resources/views/configuration/index.blade.php index cf1de3a02..a8b39c936 100755 --- a/packages/Webkul/Admin/src/Resources/views/configuration/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/configuration/index.blade.php @@ -65,6 +65,11 @@ @include ('admin::configuration.field-type', ['field' => $field]) + @php ($hint = $field['title'] . '-hint') + @if ($hint !== __($hint)) + {{ __($hint) }} + @endif + @endforeach diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php index c93bec117..9926ecd3d 100755 --- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php +++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php @@ -3,16 +3,20 @@ namespace Webkul\Attribute\Database\Seeders; use Illuminate\Database\Seeder; -use DB; +use Illuminate\Support\Facades\DB; class AttributeFamilyTableSeeder extends Seeder { public function run() { + DB::statement('SET FOREIGN_KEY_CHECKS=0;'); + DB::table('attribute_families')->delete(); DB::table('attribute_families')->insert([ ['id' => '1','code' => 'default','name' => 'Default','status' => '0','is_user_defined' => '1'] ]); + + DB::statement('SET FOREIGN_KEY_CHECKS=1;'); } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php index 92fa5db6c..394c5ac48 100755 --- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php +++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php @@ -3,12 +3,17 @@ namespace Webkul\Attribute\Database\Seeders; use Illuminate\Database\Seeder; -use DB; +use Illuminate\Support\Facades\DB; class AttributeGroupTableSeeder extends Seeder { public function run() { + DB::statement('SET FOREIGN_KEY_CHECKS=0;'); + + DB::table('attribute_groups')->delete(); + DB::table('attribute_group_mappings')->delete(); + DB::table('attribute_groups')->delete(); DB::table('attribute_groups')->insert([ @@ -42,9 +47,12 @@ class AttributeGroupTableSeeder extends Seeder ['attribute_id' => '20','attribute_group_id' => '5','position' => '2'], ['attribute_id' => '21','attribute_group_id' => '5','position' => '3'], ['attribute_id' => '22','attribute_group_id' => '5','position' => '4'], - ['attribute_id' => '23','attribute_group_id' => '1','position' => '9'], - ['attribute_id' => '24','attribute_group_id' => '1','position' => '10'], - ['attribute_id' => '25','attribute_group_id' => '1','position' => '11'] + ['attribute_id' => '23','attribute_group_id' => '1','position' => '10'], + ['attribute_id' => '24','attribute_group_id' => '1','position' => '11'], + ['attribute_id' => '25','attribute_group_id' => '1','position' => '12'], + ['attribute_id' => '26','attribute_group_id' => '1','position' => '9'] ]); + + DB::statement('SET FOREIGN_KEY_CHECKS=0;'); } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php index 992c625c0..5bdc0ba9e 100755 --- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php +++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php @@ -3,7 +3,7 @@ namespace Webkul\Attribute\Database\Seeders; use Illuminate\Database\Seeder; -use DB; +use Illuminate\Support\Facades\DB; class AttributeOptionTableSeeder extends Seeder { @@ -11,6 +11,7 @@ class AttributeOptionTableSeeder extends Seeder public function run() { DB::table('attribute_options')->delete(); + DB::table('attribute_option_translations')->delete(); DB::table('attribute_options')->insert([ ['id' => '1', 'admin_name' => 'Red', 'sort_order' => '1', 'attribute_id' => '23'], diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php index 595b37411..829ce982f 100755 --- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php +++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php @@ -2,9 +2,9 @@ namespace Webkul\Attribute\Database\Seeders; -use Illuminate\Database\Seeder; -use DB; use Carbon\Carbon; +use Illuminate\Database\Seeder; +use Illuminate\Support\Facades\DB; class AttributeTableSeeder extends Seeder { @@ -12,6 +12,7 @@ class AttributeTableSeeder extends Seeder public function run() { DB::table('attributes')->delete(); + DB::table('attribute_translations')->delete(); $now = Carbon::now(); @@ -59,9 +60,11 @@ class AttributeTableSeeder extends Seeder ['id' => '23','code' => 'color','admin_name' => 'Color','type' => 'select','validation' => NULL,'position' => '23','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0', 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now], ['id' => '24','code' => 'size','admin_name' => 'Size','type' => 'select','validation' => NULL,'position' => '24','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0', - 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now], + 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now], ['id' => '25','code' => 'brand','admin_name' => 'Brand','type' => 'select','validation' => NULL,'position' => '25','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '1', - 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now] + 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now], + ['id' => '26','code' => 'guest_checkout','admin_name' => 'Guest Checkout','type' => 'boolean','validation' => NULL,'position' => '8','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0', + 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now], ]); @@ -90,7 +93,8 @@ class AttributeTableSeeder extends Seeder ['id' => '22','locale' => 'en','name' => 'Weight','attribute_id' => '22'], ['id' => '23','locale' => 'en','name' => 'Color','attribute_id' => '23'], ['id' => '24','locale' => 'en','name' => 'Size','attribute_id' => '24'], - ['id' => '25','locale' => 'en','name' => 'Brand','attribute_id' => '25'] + ['id' => '25','locale' => 'en','name' => 'Brand','attribute_id' => '25'], + ['id' => '26','locale' => 'en','name' => 'Allow Guest Checkout','attribute_id' => '26'] ]); } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php index b1f9df4a8..148b85486 100755 --- a/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php +++ b/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php @@ -13,9 +13,9 @@ class DatabaseSeeder extends Seeder */ public function run() { - $this->call(AttributeTableSeeder::class); - $this->call(AttributeOptionTableSeeder::class); $this->call(AttributeFamilyTableSeeder::class); $this->call(AttributeGroupTableSeeder::class); + $this->call(AttributeTableSeeder::class); + $this->call(AttributeOptionTableSeeder::class); } } diff --git a/packages/Webkul/CMS/src/Database/Seeders/CMSPagesTableSeeder.php b/packages/Webkul/CMS/src/Database/Seeders/CMSPagesTableSeeder.php index c8ab922f7..92430ab43 100644 --- a/packages/Webkul/CMS/src/Database/Seeders/CMSPagesTableSeeder.php +++ b/packages/Webkul/CMS/src/Database/Seeders/CMSPagesTableSeeder.php @@ -2,15 +2,16 @@ namespace Webkul\CMS\Database\Seeders; -use Illuminate\Database\Seeder; -use DB; use Carbon\Carbon; +use Illuminate\Database\Seeder; +use Illuminate\Support\Facades\DB; class CMSPagesTableSeeder extends Seeder { public function run() { DB::table('cms_pages')->delete(); + DB::table('cms_page_translations')->delete(); DB::table('cms_pages')->insert([ [ diff --git a/packages/Webkul/Checkout/src/Models/Cart.php b/packages/Webkul/Checkout/src/Models/Cart.php index 9088531fa..936215c1c 100755 --- a/packages/Webkul/Checkout/src/Models/Cart.php +++ b/packages/Webkul/Checkout/src/Models/Cart.php @@ -116,11 +116,11 @@ class Cart extends Model implements CartContract } /** - * Checks if cart have downloadable items + * Checks if cart has downloadable items * * @return boolean */ - public function haveDownloadableItems() + public function hasDownloadableItems() { foreach ($this->items as $item) { if ($item->type == 'downloadable') @@ -129,4 +129,20 @@ class Cart extends Model implements CartContract return false; } + + /** + * Checks if cart has items that allow guest checkout + * + * @return boolean + */ + public function hasGuestCheckoutItems() + { + foreach ($this->items as $item) { + if ($item->product->getAttribute('guest_checkout') === 0) { + return false; + } + } + + return true; + } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Database/Seeders/ConfigTableSeeder.php b/packages/Webkul/Core/src/Database/Seeders/ConfigTableSeeder.php new file mode 100644 index 000000000..fc8e7ec13 --- /dev/null +++ b/packages/Webkul/Core/src/Database/Seeders/ConfigTableSeeder.php @@ -0,0 +1,27 @@ +delete(); + + $now = Carbon::now(); + + DB::table('core_config')->insert([ + 'id' => 1, + 'code' => 'catalog.products.guest-checkout.allow-guest-checkout', + 'value' => '1', + 'channel_code' => null, + 'locale_code' => null, + 'created_at' => $now, + 'updated_at' => $now + ]); + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php b/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php index 919a033ef..6d5013d4f 100755 --- a/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php +++ b/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php @@ -18,5 +18,6 @@ class DatabaseSeeder extends Seeder $this->call(CountriesTableSeeder::class); $this->call(StatesTableSeeder::class); $this->call(ChannelTableSeeder::class); + $this->call(ConfigTableSeeder::class); } } diff --git a/packages/Webkul/Core/src/Helpers/Laravel5Helper.php b/packages/Webkul/Core/src/Helpers/Laravel5Helper.php new file mode 100644 index 000000000..99a4f1a1e --- /dev/null +++ b/packages/Webkul/Core/src/Helpers/Laravel5Helper.php @@ -0,0 +1,115 @@ + 'integer_value', + 'sku' => 'text_value', + 'name' => 'text_value', + 'url_key' => 'text_value', + 'tax_category_id' => 'integer_value', + 'new' => 'boolean_value', + 'featured' => 'boolean_value', + 'visible_individually' => 'boolean_value', + 'status' => 'boolean_value', + 'short_description' => 'text_value', + 'description' => 'text_value', + 'price' => 'float_value', + 'cost' => 'float_value', + 'special_price' => 'float_value', + 'special_price_from' => 'date_value', + 'special_price_to' => 'date_value', + 'meta_title' => 'text_value', + 'meta_keywords' => 'text_value', + 'meta_description' => 'text_value', + 'width' => 'integer_value', + 'height' => 'integer_value', + 'depth' => 'integer_value', + 'weight' => 'integer_value', + 'color' => 'integer_value', + 'size' => 'integer_value', + 'brand' => 'text_value', + 'guest_checkout' => 'boolean_value', + ]; + if (!array_key_exists($attribute, $attributes)) { + return null; + } + return $attributes[$attribute]; + } + /** + * @param array $attributeValueStates + * + * @return \Webkul\Product\Models\Product + * @part ORM + */ + public function haveProduct( + array $configs = [], + array $productStates = [] + ): Product { + $I = $this; + /** @var Product $product */ + $product = factory(Product::class)->states($productStates)->create($configs['productAttributes'] ?? []);; + $I->createAttributeValues($product->id,$configs['attributeValues'] ?? []); + $I->have(ProductInventory::class, array_merge($configs['productInventory'] ?? [], [ + 'product_id' => $product->id, + 'inventory_source_id' => 1, + ])); + Event::fire('catalog.product.create.after', $product); + return $product; + } + private function createAttributeValues($id, array $attributeValues = []) + { + $I = $this; + $productAttributeValues = [ + 'sku', + 'url_key', + 'tax_category_id', + 'price', + 'cost', + 'name', + 'new', + 'visible_individually', + 'featured', + 'status', + 'guest_checkout', + 'short_description', + 'description', + 'meta_title', + 'meta_keywords', + 'meta_description', + 'weight', + ]; + foreach ($productAttributeValues as $attribute) { + $data = ['product_id' => $id]; + if (array_key_exists($attribute, $attributeValues)) { + $fieldName = self::getAttributeFieldName($attribute); + if (! array_key_exists($fieldName, $data)) { + $data[$fieldName] = $attributeValues[$attribute]; + } else { + $data = [$fieldName => $attributeValues[$attribute]]; + } + } + $I->have(ProductAttributeValue::class, $data, $attribute); + } + } +} \ No newline at end of file diff --git a/packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php b/packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php new file mode 100644 index 000000000..53234a1a5 --- /dev/null +++ b/packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php @@ -0,0 +1,27 @@ +define(InventorySource::class, function (Faker $faker) { + $now = date("Y-m-d H:i:s"); + $code = $faker->unique()->word; + return [ + 'code' => $faker->unique()->word, + 'name' => $code, + 'description' => $faker->sentence, + 'contact_name' => $faker->name, + 'contact_email' => $faker->safeEmail, + 'contact_number' => $faker->phoneNumber, + 'country' => $faker->countryCode, + 'state' => $faker->state, + 'city' => $faker->city, + 'street' => $faker->streetAddress, + 'postcode' => $faker->postcode, + 'priority' => 0, + 'status' => 1, + 'created_at' => $now, + 'updated_at' => $now, + ]; +}); \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php new file mode 100644 index 000000000..4da6ddaf0 --- /dev/null +++ b/packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php @@ -0,0 +1,261 @@ +defineAs(ProductAttributeValue::class, 'sku', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'text_value' => $faker->uuid, + 'attribute_id' => 1, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'name', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'locale' => 'en', //$faker->languageCode, + 'channel' => 'default', + 'text_value' => $faker->words(2, true), + 'attribute_id' => 2, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'url_key', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'text_value' => $faker->unique()->slug, + 'attribute_id' => 3, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'tax_category_id', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'channel' => 'default', + 'integer_value' => null, // ToDo + 'attribute_id' => 4, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'new', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'boolean_value' => 1, + 'attribute_id' => 5, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'featured', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'boolean_value' => 1, + 'attribute_id' => 6, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'visible_individually', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'boolean_value' => 1, + 'attribute_id' => 7, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'status', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'boolean_value' => 1, + 'attribute_id' => 8, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'short_description', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'locale' => 'en', //$faker->languageCode, + 'channel' => 'default', + 'text_value' => $faker->sentence, + 'attribute_id' => 9, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'description', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'locale' => 'en', //$faker->languageCode, + 'channel' => 'default', + 'text_value' => $faker->sentences(3, true), + 'attribute_id' => 10, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'price', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'float_value' => $faker->randomFloat(4, 0, 1000), + 'attribute_id' => 11, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'cost', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'channel' => 'default', + 'float_value' => $faker->randomFloat(4, 0, 10), + 'attribute_id' => 12, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'special_price', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'float_value' => $faker->randomFloat(4, 0, 100), + 'attribute_id' => 13, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'special_price_from', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'channel' => 'default', + 'date_value' => $faker->dateTimeBetween('-5 days', 'now', 'Europe/Berlin'), + 'attribute_id' => 14, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'special_price_to', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'channel' => 'default', + 'date_value' => $faker->dateTimeBetween('now', '+ 5 days', 'Europe/Berlin'), + 'attribute_id' => 15, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'meta_title', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'locale' => 'en', //$faker->languageCode, + 'channel' => 'default', + 'text_value' => $faker->words(2, true), + 'attribute_id' => 16, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'meta_keywords', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'locale' => 'en', //$faker->languageCode, + 'channel' => 'default', + 'text_value' => $faker->words(5, true), + 'attribute_id' => 17, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'meta_description', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'locale' => 'en', //$faker->languageCode, + 'channel' => 'default', + 'text_value' => $faker->sentence, + 'attribute_id' => 18, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'width', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'integer_value' => $faker->numberBetween(1, 50), + 'attribute_id' => 19, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'height', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'integer_value' => $faker->numberBetween(1, 50), + 'attribute_id' => 20, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'depth', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'integer_value' => $faker->numberBetween(1, 50), + 'attribute_id' => 21, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'weight', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'integer_value' => $faker->numberBetween(1, 50), + 'attribute_id' => 22, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'color', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'integer_value' => $faker->numberBetween(1, 5), + 'attribute_id' => 23, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'size', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'integer_value' => $faker->numberBetween(1, 5), + 'attribute_id' => 24, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'brand', function (Faker $faker) { + return [ + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'attribute_id' => 25, + 'integer_value' => function () { + return factory(AttributeOption::class)->create()->id; + }, + ]; +}); +$factory->defineAs(ProductAttributeValue::class, 'guest_checkout', function ( Faker $faker) { + return [ + 'product_id' => function() { + return factory(Product::class)->create()->id; + }, + 'boolean_value' => 1, + 'attribute_id' => 26, + ]; +}); \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductFactory.php new file mode 100644 index 000000000..0caf3ded5 --- /dev/null +++ b/packages/Webkul/Product/src/Database/Factories/ProductFactory.php @@ -0,0 +1,23 @@ +define(Product::class, function (Faker $faker) { + $now = date("Y-m-d H:i:s"); + return [ + 'sku' => $faker->uuid, + 'created_at' => $now, + 'updated_at' => $now, + 'attribute_family_id' => 1, + ]; +}); + +$factory->state(Product::class, 'simple', [ + 'type' => 'simple', +]); +$factory->state(Product::class, 'downloadable_with_stock', [ + 'type' => 'downloadable', +]); \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php new file mode 100644 index 000000000..fc3b9d122 --- /dev/null +++ b/packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php @@ -0,0 +1,20 @@ +define(ProductInventory::class, function (Faker $faker) { + return [ + 'qty' => $faker->numberBetween(1, 20), + 'product_id' => function () { + return factory(Product::class)->create()->id; + }, + 'inventory_source_id' => function () { + return factory(InventorySource::class)->create()->id; + }, + ]; +}); \ No newline at end of file diff --git a/packages/Webkul/Product/src/Providers/ProductServiceProvider.php b/packages/Webkul/Product/src/Providers/ProductServiceProvider.php index 902f5261b..e95c7563f 100755 --- a/packages/Webkul/Product/src/Providers/ProductServiceProvider.php +++ b/packages/Webkul/Product/src/Providers/ProductServiceProvider.php @@ -2,6 +2,7 @@ namespace Webkul\Product\Providers; +use Illuminate\Database\Eloquent\Factory as EloquentFactory; use Illuminate\Support\ServiceProvider; use Webkul\Product\Models\ProductProxy; use Webkul\Product\Observers\ProductObserver; @@ -32,14 +33,21 @@ class ProductServiceProvider extends ServiceProvider * * @return void */ - public function register() + public function register(): void { $this->registerConfig(); $this->registerCommands(); + + $this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/Factories'); } - public function registerConfig() { + /** + * Register Configuration + * + * @return void + */ + public function registerConfig(): void { $this->mergeConfigFrom( dirname(__DIR__) . '/Config/product_types.php', 'product_types' ); @@ -47,10 +55,24 @@ class ProductServiceProvider extends ServiceProvider /** * Register the console commands of this package + * + * @return void */ - protected function registerCommands() + protected function registerCommands(): void { - if ($this->app->runningInConsole()) + if ($this->app->runningInConsole()) { $this->commands([PriceUpdate::class,]); + } + } + + /** + * Register factories. + * + * @param string $path + * @return void + */ + protected function registerEloquentFactoriesFrom($path): void + { + $this->app->make(EloquentFactory::class)->load($path); } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Type/Downloadable.php b/packages/Webkul/Product/src/Type/Downloadable.php index aaf97acdf..fa7cd8c9b 100644 --- a/packages/Webkul/Product/src/Type/Downloadable.php +++ b/packages/Webkul/Product/src/Type/Downloadable.php @@ -22,14 +22,14 @@ class Downloadable extends AbstractType { /** * ProductDownloadableLinkRepository instance - * + * * @var ProductDownloadableLinkRepository */ protected $productDownloadableLinkRepository; /** * ProductDownloadableSampleRepository instance - * + * * @var ProductDownloadableSampleRepository */ protected $productDownloadableSampleRepository; @@ -39,11 +39,11 @@ class Downloadable extends AbstractType * * @var array */ - protected $skipAttributes = ['width', 'height', 'depth', 'weight']; + protected $skipAttributes = ['width', 'height', 'depth', 'weight', 'guest_checkout']; /** * These blade files will be included in product edit page - * + * * @var array */ protected $additionalViews = [ @@ -111,7 +111,7 @@ class Downloadable extends AbstractType if (request()->route()->getName() != 'admin.catalog.products.massupdate') { $this->productDownloadableLinkRepository->saveLinks($data, $product); - + $this->productDownloadableSampleRepository->saveSamples($data, $product); } @@ -127,11 +127,11 @@ class Downloadable extends AbstractType { if (! $this->product->status) return false; - + if ($this->product->downloadable_links()->count()) return true; - return false; + return false; } /** @@ -177,7 +177,7 @@ class Downloadable extends AbstractType return $products; } - + /** * * @param array $options1 diff --git a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php index 12dad01aa..06fa3dacc 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php @@ -64,13 +64,22 @@ class OnepageController extends Controller */ public function index() { + if (! auth()->guard('customer')->check() && ! core()->getConfigData('catalog.products.guest-checkout.allow-guest-checkout')) { + return redirect()->route('customer.session.index'); + } + if (Cart::hasError()) return redirect()->route('shop.checkout.cart.index'); $cart = Cart::getCart(); - if (! auth()->guard('customer')->check() && $cart->haveDownloadableItems()) + if (! auth()->guard('customer')->check() && $cart->hasDownloadableItems()) { return redirect()->route('customer.session.index'); + } + + if (! auth()->guard('customer')->check() && ! $cart->hasGuestCheckoutItems()) { + return redirect()->route('customer.session.index'); + } Cart::collectTotals(); diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index 95c00ec21..9adb03862 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -23,4 +23,20 @@ class AcceptanceTester extends \Codeception\Actor /** * Define custom actions here */ + + /** + * Logging in as an Admin + */ + public function loginAsAdmin() + { + $I = $this; + $I->amOnPage('/admin'); + $I->see('Sign In'); + $I->fillField('email', 'admin@example.com'); + $I->fillField('password', 'admin123'); + $I->dontSee('The "Email" field is required.'); + $I->dontSee('The "Password" field is required.'); + $I->click('Sign In'); + $I->see('Dashboard', '//h1'); + } } diff --git a/tests/_support/FunctionalTester.php b/tests/_support/FunctionalTester.php index ea07902b1..38b53fd7d 100644 --- a/tests/_support/FunctionalTester.php +++ b/tests/_support/FunctionalTester.php @@ -2,6 +2,7 @@ use Illuminate\Routing\RouteCollection; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Route; use Webkul\User\Models\Admin; @@ -58,4 +59,26 @@ class FunctionalTester extends \Codeception\Actor $I->assertContains('admin', $middlewares, 'check that admin middleware is applied'); } + /** + * Set specific Webkul/Core configuration keys to a given value + * + * // TODO: change method as soon as there is a method to set core config data + * + * @param $data array containing 'code => value' pairs + * @return void + */ + public function setConfigData($data): void { + foreach ($data as $key => $value) { + if (DB::table('core_config')->where('code', '=', $key)->exists()) { + DB::table('core_config')->where('code', '=', $key)->update(['value' => $value]); + } else { + DB::table('core_config')->insert([ + 'code' => $key, + 'value' => $value, + 'created_at' => date('Y-m-d H:i:s'), + 'updated_at' => date('Y-m-d H:i:s') + ]); + } + } + } } diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index 267af5b80..ba234fcea 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -7,7 +7,23 @@ actor: AcceptanceTester modules: enabled: - - PhpBrowser: - url: http://localhost - - \Helper\Acceptance - step_decorators: ~ \ No newline at end of file + - \Helper\Acceptance + - Asserts + - WebDriver: + url: http://nginx/ + host: selenium-chrome + browser: chrome + window_size: 1920x1080 + restart: true + wait: 20 + pageload_timeout: 10 + connection_timeout: 60 + request_timeout: 60 + log_js_errors: true + - Laravel5: + part: ORM + cleanup: false + environment_file: .env + database_seeder_class: DatabaseSeeder + url: http://nginx +step_decorators: ~ \ No newline at end of file diff --git a/tests/acceptance/GuestCheckoutCest.php b/tests/acceptance/GuestCheckoutCest.php new file mode 100644 index 000000000..f862a34bf --- /dev/null +++ b/tests/acceptance/GuestCheckoutCest.php @@ -0,0 +1,59 @@ +faker = Factory::create(); + } + + function testToConfigureGlobalGuestCheckout(AcceptanceTester $I) + { + $I->loginAsAdmin(); + + $I->amGoingTo('turn ON the global guest checkout configuration'); + $I->amOnPage('/admin/configuration/catalog/products'); + $I->see(__('admin::app.admin.system.allow-guest-checkout')); + $I->selectOption('catalog[products][guest-checkout][allow-guest-checkout]', 1); + $I->click(__('admin::app.configuration.save-btn-title')); + $I->seeRecord('core_config', ['code' => 'catalog.products.guest-checkout.allow-guest-checkout', 'value' => 1]); + + $I->amGoingTo('assert that the product guest checkout configuration is shown'); + $I->amOnPage('admin/catalog/products'); + $I->click(__('admin::app.catalog.products.add-product-btn-title')); + $I->selectOption('attribute_family_id', 1); + $I->fillField('sku', $this->faker->uuid); + $I->dontSeeInSource('The "SKU" field is required.'); + $I->click(__('admin::app.catalog.products.save-btn-title')); + $I->seeInCurrentUrl('admin/catalog/products/edit'); + $I->scrollTo('#new'); + $I->see('Guest Checkout'); + $I->seeInSource('amGoingTo('turn OFF the global guest checkout configuration'); + $I->amOnPage('/admin/configuration/catalog/products'); + $I->see(__('admin::app.admin.system.allow-guest-checkout')); + $I->selectOption('catalog[products][guest-checkout][allow-guest-checkout]', 0); + $I->click(__('admin::app.configuration.save-btn-title')); + $I->seeRecord('core_config', ['code' => 'catalog.products.guest-checkout.allow-guest-checkout', 'value' => 0]); + + $I->amGoingTo('assert that the product guest checkout configuration is not shown'); + $I->amOnPage('admin/catalog/products'); + $I->click(__('admin::app.catalog.products.add-product-btn-title')); + $I->selectOption('attribute_family_id', 1); + $I->fillField('sku', $this->faker->uuid); + $I->dontSeeInSource('The "SKU" field is required.'); + $I->click(__('admin::app.catalog.products.save-btn-title')); + $I->seeInCurrentUrl('admin/catalog/products/edit'); + $I->scrollTo('#new'); + $I->dontSee('Guest Checkout'); + $I->dontSeeInSource('selectOption('select#attribute_family_id', $attributeFamily->id); - $sku = $this->faker->randomNumber(3); + $sku = $this->faker->uuid; $I->fillField('sku', $sku); $I->click(__('admin::app.catalog.products.save-btn-title')); diff --git a/tests/functional/Shop/GuestCheckoutCest.php b/tests/functional/Shop/GuestCheckoutCest.php new file mode 100644 index 000000000..d6a66f732 --- /dev/null +++ b/tests/functional/Shop/GuestCheckoutCest.php @@ -0,0 +1,90 @@ +faker = Factory::create(); + + $pConfigDefault = [ + 'productInventory' => ['qty' => $this->faker->randomNumber(2)], + 'attributeValues' => [ + 'status' => true, + 'new' => 1, + 'guest_checkout' => 0 + ], + ]; + $pConfigGuestCheckout = [ + 'productInventory' => ['qty' => $this->faker->randomNumber(2)], + 'attributeValues' => [ + 'status' => true, + 'new' => 1, + 'guest_checkout' => 1 + ], + ]; + + $this->productNoGuestCheckout = $I->haveProduct($pConfigDefault, ['simple']); + $this->productNoGuestCheckout->refresh(); + + $this->productGuestCheckout = $I->haveProduct($pConfigGuestCheckout, ['simple']); + $this->productGuestCheckout->refresh(); + } + + public function testGuestCheckout(FunctionalTester $I) { + $I->amGoingTo('try to add products to cart with guest checkout turned on or off'); + + $scenarios = [ + [ + 'name' => 'false / false', + 'globalConfig' => 0, + 'product' => $this->productNoGuestCheckout, + 'expectedRoute' => 'customer.session.index' + ], + [ + 'name' => 'false / true', + 'globalConfig' => 0, + 'product' => $this->productGuestCheckout, + 'expectedRoute' => 'customer.session.index' + ], + [ + 'name' => 'true / false', + 'globalConfig' => 1, + 'product' => $this->productNoGuestCheckout, + 'expectedRoute' => 'customer.session.index' + ], + [ + 'name' => 'true / true', + 'globalConfig' => 1, + 'product' => $this->productGuestCheckout, + 'expectedRoute' => 'shop.checkout.onepage.index' + ], + ]; + + foreach ($scenarios as $scenario) { + $I->wantTo('test conjunction "' . $scenario['name'] . '" with globalConfig = ' . $scenario['globalConfig'] . ' && product config = ' . $scenario['product']->getAttribute('guest_checkout')); + $I->setConfigData(['catalog.products.guest-checkout.allow-guest-checkout' => $scenario['globalConfig']]); + $I->assertEquals($scenario['globalConfig'], core()->getConfigData('catalog.products.guest-checkout.allow-guest-checkout')); + $I->amOnRoute('shop.home.index'); + $I->see($scenario['product']->name, '//div[@class="product-information"]/div[@class="product-name"]'); + $I->click(__('shop::app.products.add-to-cart'), + '//form[input[@name="product_id"][@value="' . $scenario['product']->id . '"]]/button'); + $I->seeInSource(__('shop::app.checkout.cart.item.success')); + $I->amOnRoute('shop.checkout.cart.index'); + $I->see('Shopping Cart', '//div[@class="title"]'); + $I->makeHtmlSnapshot('guestCheckout_'.$scenario['globalConfig'].'_'.$scenario['product']->getAttribute('guest_checkout')); + $I->see($scenario['product']->name, '//div[@class="item-title"]'); + $I->click( __('shop::app.checkout.cart.proceed-to-checkout'), '//a[@href="' . route('shop.checkout.onepage.index') . '"]'); + $I->seeCurrentRouteIs($scenario['expectedRoute']); + $cart = Cart::getCart(); + $I->assertTrue(Cart::removeItem($cart->items[0]->id)); + } + } +} \ No newline at end of file From cddba75d9e8cad1b30dfd2ea0dd81d6239d6e3aa Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 19:05:56 +0530 Subject: [PATCH 03/34] Added .env.ci file --- .env.ci | 39 +++++++++++++++++++++++++++++++++++++++ .env.testing | 32 +++++++++++++++----------------- 2 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 .env.ci diff --git a/.env.ci b/.env.ci new file mode 100644 index 000000000..5893cf60c --- /dev/null +++ b/.env.ci @@ -0,0 +1,39 @@ +APP_NAME=Laravel +APP_ENV=local +APP_VERSION=0.1.5 +APP_KEY=base64:G4KY3tUsTaY9ONo1n/QyJvVLQZdJDgbIkSJswFK01HE= +APP_DEBUG=true +APP_URL=http://192.168.15.195/laravel/bagisto/public + +LOG_CHANNEL=stack + +DB_CONNECTION=sqlite +DB_DATABASE=:memory: + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +SESSION_DRIVER=file +SESSION_LIFETIME=120 +QUEUE_DRIVER=sync + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_DRIVER=smtp +MAIL_HOST=smtp.sendgrid.net +MAIL_PORT=587 +MAIL_USERNAME=helpdeskWebkul +MAIL_PASSWORD=SiM8$GjQCaI)!pTSF^ +MAIL_ENCRYPTION=tls + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +SHOP_MAIL_FROM=jitendra@webkul.com +ADMIN_MAIL_TO=jitendra@webkul.com \ No newline at end of file diff --git a/.env.testing b/.env.testing index 6b1104008..38b5b4884 100644 --- a/.env.testing +++ b/.env.testing @@ -1,23 +1,23 @@ -APP_NAME=Bagisto +APP_NAME=Laravel APP_ENV=local -APP_VERSION=0.1.8 -APP_KEY=base64:NFtGjjFAqET6RlX3PVC/gFpzHb4jK1OxDc3cuU5Asz4= +APP_VERSION=0.1.5 +APP_KEY=base64:G4KY3tUsTaY9ONo1n/QyJvVLQZdJDgbIkSJswFK01HE= APP_DEBUG=true -APP_URL=http://localhost +APP_URL=http://192.168.15.195/laravel/bagisto/public LOG_CHANNEL=stack DB_CONNECTION=mysql -DB_HOST=mysql +DB_HOST=localhost DB_PORT=3306 -DB_DATABASE=bagisto_test +DB_DATABASE=bagisto_testing DB_USERNAME=root -DB_PASSWORD=root +DB_PASSWORD=webkul BROADCAST_DRIVER=log CACHE_DRIVER=file SESSION_DRIVER=file -SESSION_LIFETIME=20 +SESSION_LIFETIME=120 QUEUE_DRIVER=sync REDIS_HOST=127.0.0.1 @@ -25,17 +25,12 @@ REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_DRIVER=smtp -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_USERNAME= -MAIL_PASSWORD= +MAIL_HOST=smtp.sendgrid.net +MAIL_PORT=587 +MAIL_USERNAME=helpdeskWebkul +MAIL_PASSWORD=SiM8$GjQCaI)!pTSF^ MAIL_ENCRYPTION=tls -SHOP_MAIL_FROM= -ADMIN_MAIL_TO= - -fixer_api_key= - PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= @@ -43,3 +38,6 @@ PUSHER_APP_CLUSTER=mt1 MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +SHOP_MAIL_FROM=jitendra@webkul.com +ADMIN_MAIL_TO=jitendra@webkul.com \ No newline at end of file From 48ddb65b15b2d9732ddaa120a82fbd388c7adee4 Mon Sep 17 00:00:00 2001 From: Jitendra Singh <39991107+jitendra-webkul@users.noreply.github.com> Date: Tue, 21 Jan 2020 19:07:17 +0530 Subject: [PATCH 04/34] Create ci.yml --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..b16aebf16 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: Bagisto + +on: [push] + +jobs: + laravel-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Copy .env + run: php -r "file_exists('.env') || copy('.env.ci', '.env');" + - name: Install Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist + - name: Generate key + run: php artisan key:generate + - name: Create Database + run: | + mkdir -p database + touch database/database.sqlite + - name: Execute tests (Unit, Feature and Trigger tests) via Codeception + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite + run: | + set -e + @php artisan migrate:fresh --env=testing + vendor/bin/codecept run unit + vendor/bin/codecept run functional + vendor/bin/codecept run trigger From 6ce0ff0f412964b4629f210679d0c4b72d34f9c2 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 19:18:16 +0530 Subject: [PATCH 05/34] composer.lock file updated --- composer.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index b047e7387..7b04d5410 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "06686b2b0cd023b308427381d8ee9184", + "content-hash": "cc056714a51a7ae1a027577b93e07ef1", "packages": [ { "name": "astrotomic/laravel-translatable", @@ -8134,7 +8134,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.1.3", + "php": "^7.2.0", "ext-curl": "*", "ext-intl": "*", "ext-mbstring": "*", From a04ec5a12bd5d48e5cf0ea50455a79dc510647e7 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 19:22:29 +0530 Subject: [PATCH 06/34] Updated ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b16aebf16..633aa90b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist + run: composer install - name: Generate key run: php artisan key:generate - name: Create Database From bc70656ec8c06bad1adcc5b49701903e3fef67d1 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 19:58:11 +0530 Subject: [PATCH 07/34] Added php extensions --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 633aa90b0..9c2da1795 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Setup PHP + uses: shivammathur/setup-php@master + with: + php-version: 7.2.0 + extension-csv: curl, intl, mbstring, openssl, pdo, pdo_mysql, tokenizer - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies @@ -23,7 +28,7 @@ jobs: DB_DATABASE: database/database.sqlite run: | set -e - @php artisan migrate:fresh --env=testing + @php artisan migrate:fresh --env=ci vendor/bin/codecept run unit vendor/bin/codecept run functional - vendor/bin/codecept run trigger + vendor/bin/codecept run trigger \ No newline at end of file From ff41e0e417582f732798f5890aa56be2e18c1d97 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:01:45 +0530 Subject: [PATCH 08/34] Updated ci.yml --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c2da1795..c6d7eb71c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,10 @@ jobs: steps: - uses: actions/checkout@v1 - name: Setup PHP - uses: shivammathur/setup-php@master - with: - php-version: 7.2.0 - extension-csv: curl, intl, mbstring, openssl, pdo, pdo_mysql, tokenizer + uses: shivammathur/setup-php@v1 + with: + php-version: '7.4' + extensions: curl, intl, mbstring, openssl, pdo, pdo_mysql, tokenizer - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies From a5878915322ba241e9737b4200e9accd4d43b2b7 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:03:36 +0530 Subject: [PATCH 09/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6d7eb71c..47a486fac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,9 @@ jobs: steps: - uses: actions/checkout@v1 - name: Setup PHP - uses: shivammathur/setup-php@v1 - with: - php-version: '7.4' + uses: shivammathur/setup-php@v1 + with: + php-version: 7.4 extensions: curl, intl, mbstring, openssl, pdo, pdo_mysql, tokenizer - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" From 7258b8dc88befa4d3d934bfadc2c30a1071359c8 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:05:51 +0530 Subject: [PATCH 10/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47a486fac..28fb3d90e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: uses: shivammathur/setup-php@v1 with: php-version: 7.4 - extensions: curl, intl, mbstring, openssl, pdo, pdo_mysql, tokenizer + extensions: intl, mbstring - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies From b2e6e8204e6070cad03b2606203ebae673d5dc9d Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:16:59 +0530 Subject: [PATCH 11/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28fb3d90e..3d08190d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,8 +10,8 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v1 with: - php-version: 7.4 - extensions: intl, mbstring + php-version: '7.4' + extensions: intl - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies From 0801ab86ea37a6e58664ddfe5709446aa74261cd Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:18:22 +0530 Subject: [PATCH 12/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d08190d4..6aa044f3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: uses: shivammathur/setup-php@v1 with: php-version: '7.4' - extensions: intl + extensions: 'intl' - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies From 8a63aa25524adcaf4a85a0c1700f8dfd5888e6a0 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:20:27 +0530 Subject: [PATCH 13/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6aa044f3d..b6ae89915 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,6 @@ jobs: uses: shivammathur/setup-php@v1 with: php-version: '7.4' - extensions: 'intl' - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies From c494a3946bd87ae7ac463d8fd9d0d8a48f347cdc Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:22:16 +0530 Subject: [PATCH 14/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6ae89915..422d3eeff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,10 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - name: Setup PHP - uses: shivammathur/setup-php@v1 - with: - php-version: '7.4' - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies From 8ed91faa7a1ceed6bd020afc9bbd9441ad208547 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:25:16 +0530 Subject: [PATCH 15/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 422d3eeff..80809325f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Setup PHP + - uses: shivammathur/setup-php@v1 + with: + extensions: intl + - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies From 9d7acc0f11bb4ce1dce24660aab5a0b3919a722c Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:26:57 +0530 Subject: [PATCH 16/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80809325f..788775651 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,11 +7,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Setup PHP - uses: shivammathur/setup-php@v1 with: extensions: intl - + - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies From d12ecf74e5bde6b1a1c7a09726aea79e11796251 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:28:47 +0530 Subject: [PATCH 17/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 788775651..896ef9262 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - + - name: Setup PHP - uses: shivammathur/setup-php@v1 with: From da56b54cc7ab42f2bddbd0486f91a51ad66282ee Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:31:22 +0530 Subject: [PATCH 18/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 896ef9262..26a027f3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Setup PHP - - uses: shivammathur/setup-php@v1 - with: - extensions: intl + - name: Setup PHP + - uses: shivammathur/setup-php@v1 + with: + extensions: intl - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" From b05e27a8bac284ffda642f4945f2b02fc2482e30 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:32:51 +0530 Subject: [PATCH 19/34] Fixed syntax in ci.yml --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26a027f3e..043d7f95b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,6 @@ jobs: - uses: shivammathur/setup-php@v1 with: extensions: intl - - name: Copy .env run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - name: Install Dependencies From 4b3ec1c9eca7323a0c1b3d13a8937ffa7287292f Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Tue, 21 Jan 2020 20:35:45 +0530 Subject: [PATCH 20/34] Removed ci.yml --- .github/workflows/ci.yml | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 043d7f95b..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Bagisto - -on: [push] - -jobs: - laravel-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - - name: Setup PHP - - uses: shivammathur/setup-php@v1 - with: - extensions: intl - - name: Copy .env - run: php -r "file_exists('.env') || copy('.env.ci', '.env');" - - name: Install Dependencies - run: composer install - - name: Generate key - run: php artisan key:generate - - name: Create Database - run: | - mkdir -p database - touch database/database.sqlite - - name: Execute tests (Unit, Feature and Trigger tests) via Codeception - env: - DB_CONNECTION: sqlite - DB_DATABASE: database/database.sqlite - run: | - set -e - @php artisan migrate:fresh --env=ci - vendor/bin/codecept run unit - vendor/bin/codecept run functional - vendor/bin/codecept run trigger \ No newline at end of file From a71ccb522b4b712413774b60b6652010142c2933 Mon Sep 17 00:00:00 2001 From: Florian Bosdorff Date: Tue, 21 Jan 2020 20:01:07 +0100 Subject: [PATCH 21/34] add automated test pipeline --- .env.testing | 6 ++-- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.env.testing b/.env.testing index 38b5b4884..e88f73461 100644 --- a/.env.testing +++ b/.env.testing @@ -8,11 +8,11 @@ APP_URL=http://192.168.15.195/laravel/bagisto/public LOG_CHANNEL=stack DB_CONNECTION=mysql -DB_HOST=localhost +DB_HOST=mysql DB_PORT=3306 DB_DATABASE=bagisto_testing -DB_USERNAME=root -DB_PASSWORD=webkul +DB_USERNAME=bagisto +DB_PASSWORD=secret BROADCAST_DRIVER=log CACHE_DRIVER=file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..1a0a1b5dd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + +jobs: + tests: + name: Run tests + runs-on: ubuntu-latest + + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: bagisto_testing + MYSQL_USER: bagisto + MYSQL_PASSWORD: secret + ports: + - 3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup php + uses: shivammathur/setup-php@v1 + with: + php-version: '7.3' + extensions: intl, curl, mbstring, openssl, pdo, pdo_mysql, tokenizer + + - name: Set environment + run: | + set -e + sed -i "s|^\(DB_HOST=\s*\).*$|\1127.0.0.1|" .env.testing + sed -i "s|^\(DB_PORT=\s*\).*$|\1${{ job.services.mysql.ports['3306'] }}|" .env.testing + printf "the complete .env.testing ...\n\n" + cat .env.testing + + - name: Composer install + run: | + set -e + composer global require hirak/prestissimo + composer install --no-interaction --ansi --no-progress --no-suggest --optimize-autoloader + + - name: Migrate database + run: set -e && php artisan migrate --env=testing + + - name: Execute unit tests + run: set -e && vendor/bin/codecept run unit + + - name: Execute functional tests + run: set -e && vendor/bin/codecept run functional + + - name: Execute trigger tests + run: set -e && vendor/bin/codecept run trigger From 9cb3600d7f6d3be6e5286ec15cf4ec4ac441876e Mon Sep 17 00:00:00 2001 From: Florian Bosdorff Date: Tue, 21 Jan 2020 20:13:22 +0100 Subject: [PATCH 22/34] change pipeline-trigger to on: push --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a0a1b5dd..46fc3a4aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,6 @@ name: CI -on: - pull_request: - push: - branches: - - master +on: push jobs: tests: From ec51fa9108c2839d2222cebb35b143f192f6ae98 Mon Sep 17 00:00:00 2001 From: Florian Bosdorff Date: Tue, 21 Jan 2020 20:16:30 +0100 Subject: [PATCH 23/34] change pipeline-trigger to on: push and pull_request --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46fc3a4aa..4f74da491 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: push +on: [push, pull_request] jobs: tests: From 4de857db5a48d4192124d9d3ea5ef070e2f6519f Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Wed, 22 Jan 2020 11:46:48 +0530 Subject: [PATCH 24/34] Convert fire to dispatch --- .env.ci | 39 ------------------- ...{Laravel5Helper.php => Laravel6Helper.php} | 4 +- tests/functional.suite.yml | 2 +- 3 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 .env.ci rename packages/Webkul/Core/src/Helpers/{Laravel5Helper.php => Laravel6Helper.php} (97%) diff --git a/.env.ci b/.env.ci deleted file mode 100644 index 5893cf60c..000000000 --- a/.env.ci +++ /dev/null @@ -1,39 +0,0 @@ -APP_NAME=Laravel -APP_ENV=local -APP_VERSION=0.1.5 -APP_KEY=base64:G4KY3tUsTaY9ONo1n/QyJvVLQZdJDgbIkSJswFK01HE= -APP_DEBUG=true -APP_URL=http://192.168.15.195/laravel/bagisto/public - -LOG_CHANNEL=stack - -DB_CONNECTION=sqlite -DB_DATABASE=:memory: - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -SESSION_DRIVER=file -SESSION_LIFETIME=120 -QUEUE_DRIVER=sync - -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_DRIVER=smtp -MAIL_HOST=smtp.sendgrid.net -MAIL_PORT=587 -MAIL_USERNAME=helpdeskWebkul -MAIL_PASSWORD=SiM8$GjQCaI)!pTSF^ -MAIL_ENCRYPTION=tls - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= -PUSHER_APP_CLUSTER=mt1 - -MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" - -SHOP_MAIL_FROM=jitendra@webkul.com -ADMIN_MAIL_TO=jitendra@webkul.com \ No newline at end of file diff --git a/packages/Webkul/Core/src/Helpers/Laravel5Helper.php b/packages/Webkul/Core/src/Helpers/Laravel6Helper.php similarity index 97% rename from packages/Webkul/Core/src/Helpers/Laravel5Helper.php rename to packages/Webkul/Core/src/Helpers/Laravel6Helper.php index 99a4f1a1e..4b6cefc8c 100644 --- a/packages/Webkul/Core/src/Helpers/Laravel5Helper.php +++ b/packages/Webkul/Core/src/Helpers/Laravel6Helper.php @@ -10,7 +10,7 @@ use Webkul\Product\Models\Product; use Webkul\Product\Models\ProductAttributeValue; use Webkul\Product\Models\ProductInventory; -class Laravel5Helper extends Laravel5 +class Laravel6Helper extends Laravel5 { /** * Returns field name of given attribute. @@ -74,7 +74,7 @@ class Laravel5Helper extends Laravel5 'product_id' => $product->id, 'inventory_source_id' => 1, ])); - Event::fire('catalog.product.create.after', $product); + Event::dispatch('catalog.product.create.after', $product); return $product; } private function createAttributeValues($id, array $attributeValues = []) diff --git a/tests/functional.suite.yml b/tests/functional.suite.yml index eb0a8c008..70da1a9fd 100644 --- a/tests/functional.suite.yml +++ b/tests/functional.suite.yml @@ -11,7 +11,7 @@ modules: # add a framework module here - \Helper\Functional - Asserts - - Webkul\Core\Helpers\Laravel5Helper: + - Webkul\Core\Helpers\Laravel6Helper: environment_file: .env.testing packages: packages cleanup: false From e4cfaff2f6e40f9ad04d03effa6e8ce3ec41b96c Mon Sep 17 00:00:00 2001 From: rahulshukla-webkul <42834394+rahulshukla-webkul@users.noreply.github.com> Date: Wed, 22 Jan 2020 11:53:44 +0530 Subject: [PATCH 25/34] Revert "#2107 add automated test pipeline" --- .env.testing | 6 ++--- .github/workflows/ci.yml | 56 ---------------------------------------- 2 files changed, 3 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.env.testing b/.env.testing index e88f73461..38b5b4884 100644 --- a/.env.testing +++ b/.env.testing @@ -8,11 +8,11 @@ APP_URL=http://192.168.15.195/laravel/bagisto/public LOG_CHANNEL=stack DB_CONNECTION=mysql -DB_HOST=mysql +DB_HOST=localhost DB_PORT=3306 DB_DATABASE=bagisto_testing -DB_USERNAME=bagisto -DB_PASSWORD=secret +DB_USERNAME=root +DB_PASSWORD=webkul BROADCAST_DRIVER=log CACHE_DRIVER=file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 4f74da491..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - tests: - name: Run tests - runs-on: ubuntu-latest - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: bagisto_testing - MYSQL_USER: bagisto - MYSQL_PASSWORD: secret - ports: - - 3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup php - uses: shivammathur/setup-php@v1 - with: - php-version: '7.3' - extensions: intl, curl, mbstring, openssl, pdo, pdo_mysql, tokenizer - - - name: Set environment - run: | - set -e - sed -i "s|^\(DB_HOST=\s*\).*$|\1127.0.0.1|" .env.testing - sed -i "s|^\(DB_PORT=\s*\).*$|\1${{ job.services.mysql.ports['3306'] }}|" .env.testing - printf "the complete .env.testing ...\n\n" - cat .env.testing - - - name: Composer install - run: | - set -e - composer global require hirak/prestissimo - composer install --no-interaction --ansi --no-progress --no-suggest --optimize-autoloader - - - name: Migrate database - run: set -e && php artisan migrate --env=testing - - - name: Execute unit tests - run: set -e && vendor/bin/codecept run unit - - - name: Execute functional tests - run: set -e && vendor/bin/codecept run functional - - - name: Execute trigger tests - run: set -e && vendor/bin/codecept run trigger From 8bd9f0bc9d9ecd4f3dbf4d44847104262b626a6e Mon Sep 17 00:00:00 2001 From: rahulshukla-webkul <42834394+rahulshukla-webkul@users.noreply.github.com> Date: Wed, 22 Jan 2020 11:58:56 +0530 Subject: [PATCH 26/34] Revert "Resolve #1183 guest checkout configuration" --- .gitignore | 2 - package.json | 10 +- packages/Webkul/Admin/src/Config/system.php | 13 +- .../Admin/src/Resources/lang/en/app.php | 3 - .../views/catalog/products/edit.blade.php | 4 - .../views/configuration/index.blade.php | 5 - .../Seeders/AttributeFamilyTableSeeder.php | 6 +- .../Seeders/AttributeGroupTableSeeder.php | 16 +- .../Seeders/AttributeOptionTableSeeder.php | 3 +- .../Database/Seeders/AttributeTableSeeder.php | 14 +- .../src/Database/Seeders/DatabaseSeeder.php | 4 +- .../Database/Seeders/CMSPagesTableSeeder.php | 5 +- packages/Webkul/Checkout/src/Models/Cart.php | 20 +- .../Database/Seeders/ConfigTableSeeder.php | 27 -- .../src/Database/Seeders/DatabaseSeeder.php | 1 - .../Core/src/Helpers/Laravel5Helper.php | 115 -------- .../Factories/InventorySourceFactory.php | 27 -- .../ProductAttributeValueFactory.php | 261 ------------------ .../src/Database/Factories/ProductFactory.php | 23 -- .../Factories/ProductInventoryFactory.php | 20 -- .../src/Providers/ProductServiceProvider.php | 30 +- .../Webkul/Product/src/Type/Downloadable.php | 16 +- .../Http/Controllers/OnepageController.php | 11 +- tests/_support/AcceptanceTester.php | 16 -- tests/_support/FunctionalTester.php | 23 -- tests/acceptance.suite.yml | 24 +- tests/acceptance/GuestCheckoutCest.php | 59 ---- tests/functional.suite.yml | 4 +- tests/functional/Product/ProductCest.php | 2 +- tests/functional/Shop/GuestCheckoutCest.php | 90 ------ 30 files changed, 40 insertions(+), 814 deletions(-) delete mode 100644 packages/Webkul/Core/src/Database/Seeders/ConfigTableSeeder.php delete mode 100644 packages/Webkul/Core/src/Helpers/Laravel5Helper.php delete mode 100644 packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php delete mode 100644 packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php delete mode 100644 packages/Webkul/Product/src/Database/Factories/ProductFactory.php delete mode 100644 packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php delete mode 100644 tests/acceptance/GuestCheckoutCest.php delete mode 100644 tests/functional/Shop/GuestCheckoutCest.php diff --git a/.gitignore b/.gitignore index dcc2b12e3..fd6d5bc53 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -/docker-compose-collection -/bin /node_modules /public/hot /public/storage diff --git a/package.json b/package.json index 103d618f3..88cbe757f 100755 --- a/package.json +++ b/package.json @@ -13,16 +13,12 @@ "devDependencies": { "axios": "^0.18", "bootstrap": "^4.0.0", + "popper.js": "^1.12", "cross-env": "^5.1", "jquery": "^3.2", - "laravel-mix": "^5.0.1", + "laravel-mix": "^2.0", "lodash": "^4.17.4", - "popper.js": "^1.12", - "resolve-url-loader": "^3.1.0", - "sass": "^1.24.5", - "sass-loader": "^8.0.2", - "vue": "^2.5.7", - "vue-template-compiler": "^2.6.11" + "vue": "^2.5.7" }, "dependencies": { "opencollective-postinstall": "^2.0.1", diff --git a/packages/Webkul/Admin/src/Config/system.php b/packages/Webkul/Admin/src/Config/system.php index 39148ce20..d9a39ee19 100644 --- a/packages/Webkul/Admin/src/Config/system.php +++ b/packages/Webkul/Admin/src/Config/system.php @@ -87,21 +87,10 @@ return [ 'key' => 'catalog.products', 'name' => 'admin::app.admin.system.products', 'sort' => 2 - ], [ - 'key' => 'catalog.products.guest-checkout', - 'name' => 'admin::app.admin.system.guest-checkout', - 'sort' => 1, - 'fields' => [ - [ - 'name' => 'allow-guest-checkout', - 'title' => 'admin::app.admin.system.allow-guest-checkout', - 'type' => 'boolean' - ] - ] ], [ 'key' => 'catalog.products.review', 'name' => 'admin::app.admin.system.review', - 'sort' => 2, + 'sort' => 1, 'fields' => [ [ 'name' => 'guest_review', diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index adae4ecc7..71aa08dac 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -1202,9 +1202,6 @@ return [ 'system' => [ 'catalog' => 'Catalog', 'products' => 'Products', - 'guest-checkout' => 'Guest Checkout', - 'allow-guest-checkout' => 'Allow Guest Checkout', - 'allow-guest-checkout-hint' => 'Hint: If turned on, this option can be configured for each product specifically.', 'review' => 'Review', 'allow-guest-review' => 'Allow Guest Review', 'inventory' => 'Inventory', diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php index 6adba4afc..e76ff2035 100755 --- a/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/products/edit.blade.php @@ -77,10 +77,6 @@ @foreach ($customAttributes as $attribute) code == 'guest_checkout' && ! core()->getConfigData('catalog.products.guest-checkout.allow-guest-checkout')) { - continue; - } - $validations = []; if ($attribute->is_required) { diff --git a/packages/Webkul/Admin/src/Resources/views/configuration/index.blade.php b/packages/Webkul/Admin/src/Resources/views/configuration/index.blade.php index 0e7068d94..d31e62144 100755 --- a/packages/Webkul/Admin/src/Resources/views/configuration/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/configuration/index.blade.php @@ -65,11 +65,6 @@ @include ('admin::configuration.field-type', ['field' => $field]) - @php ($hint = $field['title'] . '-hint') - @if ($hint !== __($hint)) - {{ __($hint) }} - @endif - @endforeach diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php index 9926ecd3d..c93bec117 100755 --- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php +++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php @@ -3,20 +3,16 @@ namespace Webkul\Attribute\Database\Seeders; use Illuminate\Database\Seeder; -use Illuminate\Support\Facades\DB; +use DB; class AttributeFamilyTableSeeder extends Seeder { public function run() { - DB::statement('SET FOREIGN_KEY_CHECKS=0;'); - DB::table('attribute_families')->delete(); DB::table('attribute_families')->insert([ ['id' => '1','code' => 'default','name' => 'Default','status' => '0','is_user_defined' => '1'] ]); - - DB::statement('SET FOREIGN_KEY_CHECKS=1;'); } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php index 394c5ac48..92fa5db6c 100755 --- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php +++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeGroupTableSeeder.php @@ -3,17 +3,12 @@ namespace Webkul\Attribute\Database\Seeders; use Illuminate\Database\Seeder; -use Illuminate\Support\Facades\DB; +use DB; class AttributeGroupTableSeeder extends Seeder { public function run() { - DB::statement('SET FOREIGN_KEY_CHECKS=0;'); - - DB::table('attribute_groups')->delete(); - DB::table('attribute_group_mappings')->delete(); - DB::table('attribute_groups')->delete(); DB::table('attribute_groups')->insert([ @@ -47,12 +42,9 @@ class AttributeGroupTableSeeder extends Seeder ['attribute_id' => '20','attribute_group_id' => '5','position' => '2'], ['attribute_id' => '21','attribute_group_id' => '5','position' => '3'], ['attribute_id' => '22','attribute_group_id' => '5','position' => '4'], - ['attribute_id' => '23','attribute_group_id' => '1','position' => '10'], - ['attribute_id' => '24','attribute_group_id' => '1','position' => '11'], - ['attribute_id' => '25','attribute_group_id' => '1','position' => '12'], - ['attribute_id' => '26','attribute_group_id' => '1','position' => '9'] + ['attribute_id' => '23','attribute_group_id' => '1','position' => '9'], + ['attribute_id' => '24','attribute_group_id' => '1','position' => '10'], + ['attribute_id' => '25','attribute_group_id' => '1','position' => '11'] ]); - - DB::statement('SET FOREIGN_KEY_CHECKS=0;'); } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php index 5bdc0ba9e..992c625c0 100755 --- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php +++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeOptionTableSeeder.php @@ -3,7 +3,7 @@ namespace Webkul\Attribute\Database\Seeders; use Illuminate\Database\Seeder; -use Illuminate\Support\Facades\DB; +use DB; class AttributeOptionTableSeeder extends Seeder { @@ -11,7 +11,6 @@ class AttributeOptionTableSeeder extends Seeder public function run() { DB::table('attribute_options')->delete(); - DB::table('attribute_option_translations')->delete(); DB::table('attribute_options')->insert([ ['id' => '1', 'admin_name' => 'Red', 'sort_order' => '1', 'attribute_id' => '23'], diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php index 829ce982f..595b37411 100755 --- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php +++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php @@ -2,9 +2,9 @@ namespace Webkul\Attribute\Database\Seeders; -use Carbon\Carbon; use Illuminate\Database\Seeder; -use Illuminate\Support\Facades\DB; +use DB; +use Carbon\Carbon; class AttributeTableSeeder extends Seeder { @@ -12,7 +12,6 @@ class AttributeTableSeeder extends Seeder public function run() { DB::table('attributes')->delete(); - DB::table('attribute_translations')->delete(); $now = Carbon::now(); @@ -60,11 +59,9 @@ class AttributeTableSeeder extends Seeder ['id' => '23','code' => 'color','admin_name' => 'Color','type' => 'select','validation' => NULL,'position' => '23','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0', 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now], ['id' => '24','code' => 'size','admin_name' => 'Size','type' => 'select','validation' => NULL,'position' => '24','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0', - 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now], + 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now], ['id' => '25','code' => 'brand','admin_name' => 'Brand','type' => 'select','validation' => NULL,'position' => '25','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '1', - 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now], - ['id' => '26','code' => 'guest_checkout','admin_name' => 'Guest Checkout','type' => 'boolean','validation' => NULL,'position' => '8','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0', - 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now], + 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now] ]); @@ -93,8 +90,7 @@ class AttributeTableSeeder extends Seeder ['id' => '22','locale' => 'en','name' => 'Weight','attribute_id' => '22'], ['id' => '23','locale' => 'en','name' => 'Color','attribute_id' => '23'], ['id' => '24','locale' => 'en','name' => 'Size','attribute_id' => '24'], - ['id' => '25','locale' => 'en','name' => 'Brand','attribute_id' => '25'], - ['id' => '26','locale' => 'en','name' => 'Allow Guest Checkout','attribute_id' => '26'] + ['id' => '25','locale' => 'en','name' => 'Brand','attribute_id' => '25'] ]); } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php index 148b85486..b1f9df4a8 100755 --- a/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php +++ b/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php @@ -13,9 +13,9 @@ class DatabaseSeeder extends Seeder */ public function run() { - $this->call(AttributeFamilyTableSeeder::class); - $this->call(AttributeGroupTableSeeder::class); $this->call(AttributeTableSeeder::class); $this->call(AttributeOptionTableSeeder::class); + $this->call(AttributeFamilyTableSeeder::class); + $this->call(AttributeGroupTableSeeder::class); } } diff --git a/packages/Webkul/CMS/src/Database/Seeders/CMSPagesTableSeeder.php b/packages/Webkul/CMS/src/Database/Seeders/CMSPagesTableSeeder.php index 92430ab43..c8ab922f7 100644 --- a/packages/Webkul/CMS/src/Database/Seeders/CMSPagesTableSeeder.php +++ b/packages/Webkul/CMS/src/Database/Seeders/CMSPagesTableSeeder.php @@ -2,16 +2,15 @@ namespace Webkul\CMS\Database\Seeders; -use Carbon\Carbon; use Illuminate\Database\Seeder; -use Illuminate\Support\Facades\DB; +use DB; +use Carbon\Carbon; class CMSPagesTableSeeder extends Seeder { public function run() { DB::table('cms_pages')->delete(); - DB::table('cms_page_translations')->delete(); DB::table('cms_pages')->insert([ [ diff --git a/packages/Webkul/Checkout/src/Models/Cart.php b/packages/Webkul/Checkout/src/Models/Cart.php index 936215c1c..9088531fa 100755 --- a/packages/Webkul/Checkout/src/Models/Cart.php +++ b/packages/Webkul/Checkout/src/Models/Cart.php @@ -116,11 +116,11 @@ class Cart extends Model implements CartContract } /** - * Checks if cart has downloadable items + * Checks if cart have downloadable items * * @return boolean */ - public function hasDownloadableItems() + public function haveDownloadableItems() { foreach ($this->items as $item) { if ($item->type == 'downloadable') @@ -129,20 +129,4 @@ class Cart extends Model implements CartContract return false; } - - /** - * Checks if cart has items that allow guest checkout - * - * @return boolean - */ - public function hasGuestCheckoutItems() - { - foreach ($this->items as $item) { - if ($item->product->getAttribute('guest_checkout') === 0) { - return false; - } - } - - return true; - } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Database/Seeders/ConfigTableSeeder.php b/packages/Webkul/Core/src/Database/Seeders/ConfigTableSeeder.php deleted file mode 100644 index fc8e7ec13..000000000 --- a/packages/Webkul/Core/src/Database/Seeders/ConfigTableSeeder.php +++ /dev/null @@ -1,27 +0,0 @@ -delete(); - - $now = Carbon::now(); - - DB::table('core_config')->insert([ - 'id' => 1, - 'code' => 'catalog.products.guest-checkout.allow-guest-checkout', - 'value' => '1', - 'channel_code' => null, - 'locale_code' => null, - 'created_at' => $now, - 'updated_at' => $now - ]); - } -} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php b/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php index 6d5013d4f..919a033ef 100755 --- a/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php +++ b/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php @@ -18,6 +18,5 @@ class DatabaseSeeder extends Seeder $this->call(CountriesTableSeeder::class); $this->call(StatesTableSeeder::class); $this->call(ChannelTableSeeder::class); - $this->call(ConfigTableSeeder::class); } } diff --git a/packages/Webkul/Core/src/Helpers/Laravel5Helper.php b/packages/Webkul/Core/src/Helpers/Laravel5Helper.php deleted file mode 100644 index 99a4f1a1e..000000000 --- a/packages/Webkul/Core/src/Helpers/Laravel5Helper.php +++ /dev/null @@ -1,115 +0,0 @@ - 'integer_value', - 'sku' => 'text_value', - 'name' => 'text_value', - 'url_key' => 'text_value', - 'tax_category_id' => 'integer_value', - 'new' => 'boolean_value', - 'featured' => 'boolean_value', - 'visible_individually' => 'boolean_value', - 'status' => 'boolean_value', - 'short_description' => 'text_value', - 'description' => 'text_value', - 'price' => 'float_value', - 'cost' => 'float_value', - 'special_price' => 'float_value', - 'special_price_from' => 'date_value', - 'special_price_to' => 'date_value', - 'meta_title' => 'text_value', - 'meta_keywords' => 'text_value', - 'meta_description' => 'text_value', - 'width' => 'integer_value', - 'height' => 'integer_value', - 'depth' => 'integer_value', - 'weight' => 'integer_value', - 'color' => 'integer_value', - 'size' => 'integer_value', - 'brand' => 'text_value', - 'guest_checkout' => 'boolean_value', - ]; - if (!array_key_exists($attribute, $attributes)) { - return null; - } - return $attributes[$attribute]; - } - /** - * @param array $attributeValueStates - * - * @return \Webkul\Product\Models\Product - * @part ORM - */ - public function haveProduct( - array $configs = [], - array $productStates = [] - ): Product { - $I = $this; - /** @var Product $product */ - $product = factory(Product::class)->states($productStates)->create($configs['productAttributes'] ?? []);; - $I->createAttributeValues($product->id,$configs['attributeValues'] ?? []); - $I->have(ProductInventory::class, array_merge($configs['productInventory'] ?? [], [ - 'product_id' => $product->id, - 'inventory_source_id' => 1, - ])); - Event::fire('catalog.product.create.after', $product); - return $product; - } - private function createAttributeValues($id, array $attributeValues = []) - { - $I = $this; - $productAttributeValues = [ - 'sku', - 'url_key', - 'tax_category_id', - 'price', - 'cost', - 'name', - 'new', - 'visible_individually', - 'featured', - 'status', - 'guest_checkout', - 'short_description', - 'description', - 'meta_title', - 'meta_keywords', - 'meta_description', - 'weight', - ]; - foreach ($productAttributeValues as $attribute) { - $data = ['product_id' => $id]; - if (array_key_exists($attribute, $attributeValues)) { - $fieldName = self::getAttributeFieldName($attribute); - if (! array_key_exists($fieldName, $data)) { - $data[$fieldName] = $attributeValues[$attribute]; - } else { - $data = [$fieldName => $attributeValues[$attribute]]; - } - } - $I->have(ProductAttributeValue::class, $data, $attribute); - } - } -} \ No newline at end of file diff --git a/packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php b/packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php deleted file mode 100644 index 53234a1a5..000000000 --- a/packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php +++ /dev/null @@ -1,27 +0,0 @@ -define(InventorySource::class, function (Faker $faker) { - $now = date("Y-m-d H:i:s"); - $code = $faker->unique()->word; - return [ - 'code' => $faker->unique()->word, - 'name' => $code, - 'description' => $faker->sentence, - 'contact_name' => $faker->name, - 'contact_email' => $faker->safeEmail, - 'contact_number' => $faker->phoneNumber, - 'country' => $faker->countryCode, - 'state' => $faker->state, - 'city' => $faker->city, - 'street' => $faker->streetAddress, - 'postcode' => $faker->postcode, - 'priority' => 0, - 'status' => 1, - 'created_at' => $now, - 'updated_at' => $now, - ]; -}); \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php deleted file mode 100644 index 4da6ddaf0..000000000 --- a/packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php +++ /dev/null @@ -1,261 +0,0 @@ -defineAs(ProductAttributeValue::class, 'sku', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'text_value' => $faker->uuid, - 'attribute_id' => 1, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'name', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'locale' => 'en', //$faker->languageCode, - 'channel' => 'default', - 'text_value' => $faker->words(2, true), - 'attribute_id' => 2, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'url_key', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'text_value' => $faker->unique()->slug, - 'attribute_id' => 3, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'tax_category_id', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'channel' => 'default', - 'integer_value' => null, // ToDo - 'attribute_id' => 4, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'new', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'boolean_value' => 1, - 'attribute_id' => 5, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'featured', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'boolean_value' => 1, - 'attribute_id' => 6, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'visible_individually', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'boolean_value' => 1, - 'attribute_id' => 7, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'status', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'boolean_value' => 1, - 'attribute_id' => 8, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'short_description', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'locale' => 'en', //$faker->languageCode, - 'channel' => 'default', - 'text_value' => $faker->sentence, - 'attribute_id' => 9, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'description', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'locale' => 'en', //$faker->languageCode, - 'channel' => 'default', - 'text_value' => $faker->sentences(3, true), - 'attribute_id' => 10, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'price', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'float_value' => $faker->randomFloat(4, 0, 1000), - 'attribute_id' => 11, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'cost', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'channel' => 'default', - 'float_value' => $faker->randomFloat(4, 0, 10), - 'attribute_id' => 12, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'special_price', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'float_value' => $faker->randomFloat(4, 0, 100), - 'attribute_id' => 13, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'special_price_from', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'channel' => 'default', - 'date_value' => $faker->dateTimeBetween('-5 days', 'now', 'Europe/Berlin'), - 'attribute_id' => 14, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'special_price_to', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'channel' => 'default', - 'date_value' => $faker->dateTimeBetween('now', '+ 5 days', 'Europe/Berlin'), - 'attribute_id' => 15, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'meta_title', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'locale' => 'en', //$faker->languageCode, - 'channel' => 'default', - 'text_value' => $faker->words(2, true), - 'attribute_id' => 16, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'meta_keywords', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'locale' => 'en', //$faker->languageCode, - 'channel' => 'default', - 'text_value' => $faker->words(5, true), - 'attribute_id' => 17, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'meta_description', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'locale' => 'en', //$faker->languageCode, - 'channel' => 'default', - 'text_value' => $faker->sentence, - 'attribute_id' => 18, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'width', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'integer_value' => $faker->numberBetween(1, 50), - 'attribute_id' => 19, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'height', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'integer_value' => $faker->numberBetween(1, 50), - 'attribute_id' => 20, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'depth', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'integer_value' => $faker->numberBetween(1, 50), - 'attribute_id' => 21, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'weight', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'integer_value' => $faker->numberBetween(1, 50), - 'attribute_id' => 22, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'color', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'integer_value' => $faker->numberBetween(1, 5), - 'attribute_id' => 23, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'size', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'integer_value' => $faker->numberBetween(1, 5), - 'attribute_id' => 24, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'brand', function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'attribute_id' => 25, - 'integer_value' => function () { - return factory(AttributeOption::class)->create()->id; - }, - ]; -}); -$factory->defineAs(ProductAttributeValue::class, 'guest_checkout', function ( Faker $faker) { - return [ - 'product_id' => function() { - return factory(Product::class)->create()->id; - }, - 'boolean_value' => 1, - 'attribute_id' => 26, - ]; -}); \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductFactory.php deleted file mode 100644 index 0caf3ded5..000000000 --- a/packages/Webkul/Product/src/Database/Factories/ProductFactory.php +++ /dev/null @@ -1,23 +0,0 @@ -define(Product::class, function (Faker $faker) { - $now = date("Y-m-d H:i:s"); - return [ - 'sku' => $faker->uuid, - 'created_at' => $now, - 'updated_at' => $now, - 'attribute_family_id' => 1, - ]; -}); - -$factory->state(Product::class, 'simple', [ - 'type' => 'simple', -]); -$factory->state(Product::class, 'downloadable_with_stock', [ - 'type' => 'downloadable', -]); \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php deleted file mode 100644 index fc3b9d122..000000000 --- a/packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php +++ /dev/null @@ -1,20 +0,0 @@ -define(ProductInventory::class, function (Faker $faker) { - return [ - 'qty' => $faker->numberBetween(1, 20), - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'inventory_source_id' => function () { - return factory(InventorySource::class)->create()->id; - }, - ]; -}); \ No newline at end of file diff --git a/packages/Webkul/Product/src/Providers/ProductServiceProvider.php b/packages/Webkul/Product/src/Providers/ProductServiceProvider.php index e95c7563f..902f5261b 100755 --- a/packages/Webkul/Product/src/Providers/ProductServiceProvider.php +++ b/packages/Webkul/Product/src/Providers/ProductServiceProvider.php @@ -2,7 +2,6 @@ namespace Webkul\Product\Providers; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; use Illuminate\Support\ServiceProvider; use Webkul\Product\Models\ProductProxy; use Webkul\Product\Observers\ProductObserver; @@ -33,21 +32,14 @@ class ProductServiceProvider extends ServiceProvider * * @return void */ - public function register(): void + public function register() { $this->registerConfig(); $this->registerCommands(); - - $this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/Factories'); } - /** - * Register Configuration - * - * @return void - */ - public function registerConfig(): void { + public function registerConfig() { $this->mergeConfigFrom( dirname(__DIR__) . '/Config/product_types.php', 'product_types' ); @@ -55,24 +47,10 @@ class ProductServiceProvider extends ServiceProvider /** * Register the console commands of this package - * - * @return void */ - protected function registerCommands(): void + protected function registerCommands() { - if ($this->app->runningInConsole()) { + if ($this->app->runningInConsole()) $this->commands([PriceUpdate::class,]); - } - } - - /** - * Register factories. - * - * @param string $path - * @return void - */ - protected function registerEloquentFactoriesFrom($path): void - { - $this->app->make(EloquentFactory::class)->load($path); } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Type/Downloadable.php b/packages/Webkul/Product/src/Type/Downloadable.php index fa7cd8c9b..aaf97acdf 100644 --- a/packages/Webkul/Product/src/Type/Downloadable.php +++ b/packages/Webkul/Product/src/Type/Downloadable.php @@ -22,14 +22,14 @@ class Downloadable extends AbstractType { /** * ProductDownloadableLinkRepository instance - * + * * @var ProductDownloadableLinkRepository */ protected $productDownloadableLinkRepository; /** * ProductDownloadableSampleRepository instance - * + * * @var ProductDownloadableSampleRepository */ protected $productDownloadableSampleRepository; @@ -39,11 +39,11 @@ class Downloadable extends AbstractType * * @var array */ - protected $skipAttributes = ['width', 'height', 'depth', 'weight', 'guest_checkout']; + protected $skipAttributes = ['width', 'height', 'depth', 'weight']; /** * These blade files will be included in product edit page - * + * * @var array */ protected $additionalViews = [ @@ -111,7 +111,7 @@ class Downloadable extends AbstractType if (request()->route()->getName() != 'admin.catalog.products.massupdate') { $this->productDownloadableLinkRepository->saveLinks($data, $product); - + $this->productDownloadableSampleRepository->saveSamples($data, $product); } @@ -127,11 +127,11 @@ class Downloadable extends AbstractType { if (! $this->product->status) return false; - + if ($this->product->downloadable_links()->count()) return true; - return false; + return false; } /** @@ -177,7 +177,7 @@ class Downloadable extends AbstractType return $products; } - + /** * * @param array $options1 diff --git a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php index 06fa3dacc..12dad01aa 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php @@ -64,22 +64,13 @@ class OnepageController extends Controller */ public function index() { - if (! auth()->guard('customer')->check() && ! core()->getConfigData('catalog.products.guest-checkout.allow-guest-checkout')) { - return redirect()->route('customer.session.index'); - } - if (Cart::hasError()) return redirect()->route('shop.checkout.cart.index'); $cart = Cart::getCart(); - if (! auth()->guard('customer')->check() && $cart->hasDownloadableItems()) { + if (! auth()->guard('customer')->check() && $cart->haveDownloadableItems()) return redirect()->route('customer.session.index'); - } - - if (! auth()->guard('customer')->check() && ! $cart->hasGuestCheckoutItems()) { - return redirect()->route('customer.session.index'); - } Cart::collectTotals(); diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index 9adb03862..95c00ec21 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -23,20 +23,4 @@ class AcceptanceTester extends \Codeception\Actor /** * Define custom actions here */ - - /** - * Logging in as an Admin - */ - public function loginAsAdmin() - { - $I = $this; - $I->amOnPage('/admin'); - $I->see('Sign In'); - $I->fillField('email', 'admin@example.com'); - $I->fillField('password', 'admin123'); - $I->dontSee('The "Email" field is required.'); - $I->dontSee('The "Password" field is required.'); - $I->click('Sign In'); - $I->see('Dashboard', '//h1'); - } } diff --git a/tests/_support/FunctionalTester.php b/tests/_support/FunctionalTester.php index 38b53fd7d..ea07902b1 100644 --- a/tests/_support/FunctionalTester.php +++ b/tests/_support/FunctionalTester.php @@ -2,7 +2,6 @@ use Illuminate\Routing\RouteCollection; use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Route; use Webkul\User\Models\Admin; @@ -59,26 +58,4 @@ class FunctionalTester extends \Codeception\Actor $I->assertContains('admin', $middlewares, 'check that admin middleware is applied'); } - /** - * Set specific Webkul/Core configuration keys to a given value - * - * // TODO: change method as soon as there is a method to set core config data - * - * @param $data array containing 'code => value' pairs - * @return void - */ - public function setConfigData($data): void { - foreach ($data as $key => $value) { - if (DB::table('core_config')->where('code', '=', $key)->exists()) { - DB::table('core_config')->where('code', '=', $key)->update(['value' => $value]); - } else { - DB::table('core_config')->insert([ - 'code' => $key, - 'value' => $value, - 'created_at' => date('Y-m-d H:i:s'), - 'updated_at' => date('Y-m-d H:i:s') - ]); - } - } - } } diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index ba234fcea..267af5b80 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -7,23 +7,7 @@ actor: AcceptanceTester modules: enabled: - - \Helper\Acceptance - - Asserts - - WebDriver: - url: http://nginx/ - host: selenium-chrome - browser: chrome - window_size: 1920x1080 - restart: true - wait: 20 - pageload_timeout: 10 - connection_timeout: 60 - request_timeout: 60 - log_js_errors: true - - Laravel5: - part: ORM - cleanup: false - environment_file: .env - database_seeder_class: DatabaseSeeder - url: http://nginx -step_decorators: ~ \ No newline at end of file + - PhpBrowser: + url: http://localhost + - \Helper\Acceptance + step_decorators: ~ \ No newline at end of file diff --git a/tests/acceptance/GuestCheckoutCest.php b/tests/acceptance/GuestCheckoutCest.php deleted file mode 100644 index f862a34bf..000000000 --- a/tests/acceptance/GuestCheckoutCest.php +++ /dev/null @@ -1,59 +0,0 @@ -faker = Factory::create(); - } - - function testToConfigureGlobalGuestCheckout(AcceptanceTester $I) - { - $I->loginAsAdmin(); - - $I->amGoingTo('turn ON the global guest checkout configuration'); - $I->amOnPage('/admin/configuration/catalog/products'); - $I->see(__('admin::app.admin.system.allow-guest-checkout')); - $I->selectOption('catalog[products][guest-checkout][allow-guest-checkout]', 1); - $I->click(__('admin::app.configuration.save-btn-title')); - $I->seeRecord('core_config', ['code' => 'catalog.products.guest-checkout.allow-guest-checkout', 'value' => 1]); - - $I->amGoingTo('assert that the product guest checkout configuration is shown'); - $I->amOnPage('admin/catalog/products'); - $I->click(__('admin::app.catalog.products.add-product-btn-title')); - $I->selectOption('attribute_family_id', 1); - $I->fillField('sku', $this->faker->uuid); - $I->dontSeeInSource('The "SKU" field is required.'); - $I->click(__('admin::app.catalog.products.save-btn-title')); - $I->seeInCurrentUrl('admin/catalog/products/edit'); - $I->scrollTo('#new'); - $I->see('Guest Checkout'); - $I->seeInSource('amGoingTo('turn OFF the global guest checkout configuration'); - $I->amOnPage('/admin/configuration/catalog/products'); - $I->see(__('admin::app.admin.system.allow-guest-checkout')); - $I->selectOption('catalog[products][guest-checkout][allow-guest-checkout]', 0); - $I->click(__('admin::app.configuration.save-btn-title')); - $I->seeRecord('core_config', ['code' => 'catalog.products.guest-checkout.allow-guest-checkout', 'value' => 0]); - - $I->amGoingTo('assert that the product guest checkout configuration is not shown'); - $I->amOnPage('admin/catalog/products'); - $I->click(__('admin::app.catalog.products.add-product-btn-title')); - $I->selectOption('attribute_family_id', 1); - $I->fillField('sku', $this->faker->uuid); - $I->dontSeeInSource('The "SKU" field is required.'); - $I->click(__('admin::app.catalog.products.save-btn-title')); - $I->seeInCurrentUrl('admin/catalog/products/edit'); - $I->scrollTo('#new'); - $I->dontSee('Guest Checkout'); - $I->dontSeeInSource('selectOption('select#attribute_family_id', $attributeFamily->id); - $sku = $this->faker->uuid; + $sku = $this->faker->randomNumber(3); $I->fillField('sku', $sku); $I->click(__('admin::app.catalog.products.save-btn-title')); diff --git a/tests/functional/Shop/GuestCheckoutCest.php b/tests/functional/Shop/GuestCheckoutCest.php deleted file mode 100644 index d6a66f732..000000000 --- a/tests/functional/Shop/GuestCheckoutCest.php +++ /dev/null @@ -1,90 +0,0 @@ -faker = Factory::create(); - - $pConfigDefault = [ - 'productInventory' => ['qty' => $this->faker->randomNumber(2)], - 'attributeValues' => [ - 'status' => true, - 'new' => 1, - 'guest_checkout' => 0 - ], - ]; - $pConfigGuestCheckout = [ - 'productInventory' => ['qty' => $this->faker->randomNumber(2)], - 'attributeValues' => [ - 'status' => true, - 'new' => 1, - 'guest_checkout' => 1 - ], - ]; - - $this->productNoGuestCheckout = $I->haveProduct($pConfigDefault, ['simple']); - $this->productNoGuestCheckout->refresh(); - - $this->productGuestCheckout = $I->haveProduct($pConfigGuestCheckout, ['simple']); - $this->productGuestCheckout->refresh(); - } - - public function testGuestCheckout(FunctionalTester $I) { - $I->amGoingTo('try to add products to cart with guest checkout turned on or off'); - - $scenarios = [ - [ - 'name' => 'false / false', - 'globalConfig' => 0, - 'product' => $this->productNoGuestCheckout, - 'expectedRoute' => 'customer.session.index' - ], - [ - 'name' => 'false / true', - 'globalConfig' => 0, - 'product' => $this->productGuestCheckout, - 'expectedRoute' => 'customer.session.index' - ], - [ - 'name' => 'true / false', - 'globalConfig' => 1, - 'product' => $this->productNoGuestCheckout, - 'expectedRoute' => 'customer.session.index' - ], - [ - 'name' => 'true / true', - 'globalConfig' => 1, - 'product' => $this->productGuestCheckout, - 'expectedRoute' => 'shop.checkout.onepage.index' - ], - ]; - - foreach ($scenarios as $scenario) { - $I->wantTo('test conjunction "' . $scenario['name'] . '" with globalConfig = ' . $scenario['globalConfig'] . ' && product config = ' . $scenario['product']->getAttribute('guest_checkout')); - $I->setConfigData(['catalog.products.guest-checkout.allow-guest-checkout' => $scenario['globalConfig']]); - $I->assertEquals($scenario['globalConfig'], core()->getConfigData('catalog.products.guest-checkout.allow-guest-checkout')); - $I->amOnRoute('shop.home.index'); - $I->see($scenario['product']->name, '//div[@class="product-information"]/div[@class="product-name"]'); - $I->click(__('shop::app.products.add-to-cart'), - '//form[input[@name="product_id"][@value="' . $scenario['product']->id . '"]]/button'); - $I->seeInSource(__('shop::app.checkout.cart.item.success')); - $I->amOnRoute('shop.checkout.cart.index'); - $I->see('Shopping Cart', '//div[@class="title"]'); - $I->makeHtmlSnapshot('guestCheckout_'.$scenario['globalConfig'].'_'.$scenario['product']->getAttribute('guest_checkout')); - $I->see($scenario['product']->name, '//div[@class="item-title"]'); - $I->click( __('shop::app.checkout.cart.proceed-to-checkout'), '//a[@href="' . route('shop.checkout.onepage.index') . '"]'); - $I->seeCurrentRouteIs($scenario['expectedRoute']); - $cart = Cart::getCart(); - $I->assertTrue(Cart::removeItem($cart->items[0]->id)); - } - } -} \ No newline at end of file From a2dda0eea0f907845eb27c2c09a8a630ac4f0468 Mon Sep 17 00:00:00 2001 From: Jitendra Singh <39991107+jitendra-webkul@users.noreply.github.com> Date: Wed, 22 Jan 2020 12:10:12 +0530 Subject: [PATCH 27/34] Revert "Revert "#2107 add automated test pipeline"" --- .env.testing | 6 ++--- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.env.testing b/.env.testing index 38b5b4884..e88f73461 100644 --- a/.env.testing +++ b/.env.testing @@ -8,11 +8,11 @@ APP_URL=http://192.168.15.195/laravel/bagisto/public LOG_CHANNEL=stack DB_CONNECTION=mysql -DB_HOST=localhost +DB_HOST=mysql DB_PORT=3306 DB_DATABASE=bagisto_testing -DB_USERNAME=root -DB_PASSWORD=webkul +DB_USERNAME=bagisto +DB_PASSWORD=secret BROADCAST_DRIVER=log CACHE_DRIVER=file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..4f74da491 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +name: CI + +on: [push, pull_request] + +jobs: + tests: + name: Run tests + runs-on: ubuntu-latest + + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: bagisto_testing + MYSQL_USER: bagisto + MYSQL_PASSWORD: secret + ports: + - 3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup php + uses: shivammathur/setup-php@v1 + with: + php-version: '7.3' + extensions: intl, curl, mbstring, openssl, pdo, pdo_mysql, tokenizer + + - name: Set environment + run: | + set -e + sed -i "s|^\(DB_HOST=\s*\).*$|\1127.0.0.1|" .env.testing + sed -i "s|^\(DB_PORT=\s*\).*$|\1${{ job.services.mysql.ports['3306'] }}|" .env.testing + printf "the complete .env.testing ...\n\n" + cat .env.testing + + - name: Composer install + run: | + set -e + composer global require hirak/prestissimo + composer install --no-interaction --ansi --no-progress --no-suggest --optimize-autoloader + + - name: Migrate database + run: set -e && php artisan migrate --env=testing + + - name: Execute unit tests + run: set -e && vendor/bin/codecept run unit + + - name: Execute functional tests + run: set -e && vendor/bin/codecept run functional + + - name: Execute trigger tests + run: set -e && vendor/bin/codecept run trigger From aa932c7ed2672e436aecd44256da812974b775f4 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Wed, 22 Jan 2020 13:28:34 +0530 Subject: [PATCH 28/34] Fixed issue --- .env.testing | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.env.testing b/.env.testing index e88f73461..0d7ae04d9 100644 --- a/.env.testing +++ b/.env.testing @@ -25,12 +25,13 @@ REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_DRIVER=smtp -MAIL_HOST=smtp.sendgrid.net -MAIL_PORT=587 -MAIL_USERNAME=helpdeskWebkul -MAIL_PASSWORD=SiM8$GjQCaI)!pTSF^ +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME= +MAIL_PASSWORD= MAIL_ENCRYPTION=tls + PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= From c51c270e5ee7112f4e3d10eea1d5e77864e7d00e Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Wed, 22 Jan 2020 13:37:08 +0530 Subject: [PATCH 29/34] Fixed App URL in --- .env.testing | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.testing b/.env.testing index 0d7ae04d9..b5b8726aa 100644 --- a/.env.testing +++ b/.env.testing @@ -3,7 +3,7 @@ APP_ENV=local APP_VERSION=0.1.5 APP_KEY=base64:G4KY3tUsTaY9ONo1n/QyJvVLQZdJDgbIkSJswFK01HE= APP_DEBUG=true -APP_URL=http://192.168.15.195/laravel/bagisto/public +APP_URL=http://localhost LOG_CHANNEL=stack @@ -40,5 +40,5 @@ PUSHER_APP_CLUSTER=mt1 MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" -SHOP_MAIL_FROM=jitendra@webkul.com -ADMIN_MAIL_TO=jitendra@webkul.com \ No newline at end of file +SHOP_MAIL_FROM=test@example.com +ADMIN_MAIL_TO=test@example.com \ No newline at end of file From 80a2ddb88d9de0b981d824970e3c69355c6ecc31 Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Wed, 22 Jan 2020 14:58:39 +0530 Subject: [PATCH 30/34] Issue #1397 fixed --- .../Webkul/Admin/src/Resources/views/account/edit.blade.php | 2 +- .../src/Resources/views/users/reset-password/create.blade.php | 2 +- .../Admin/src/Resources/views/users/users/create.blade.php | 2 +- .../Webkul/Admin/src/Resources/views/users/users/edit.blade.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php index 517c6a005..e6f40f89e 100755 --- a/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php @@ -48,7 +48,7 @@
- + @{{ errors.first('password') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/users/reset-password/create.blade.php b/packages/Webkul/Admin/src/Resources/views/users/reset-password/create.blade.php index bcd1caeac..5cb7b85ce 100755 --- a/packages/Webkul/Admin/src/Resources/views/users/reset-password/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/reset-password/create.blade.php @@ -38,7 +38,7 @@
- + @{{ errors.first('password') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/users/users/create.blade.php b/packages/Webkul/Admin/src/Resources/views/users/users/create.blade.php index 793c2c0e5..a7bf810c3 100755 --- a/packages/Webkul/Admin/src/Resources/views/users/users/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/users/create.blade.php @@ -47,7 +47,7 @@
- + @{{ errors.first('password') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/users/users/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/users/users/edit.blade.php index 72f3b3b29..61d6c7716 100755 --- a/packages/Webkul/Admin/src/Resources/views/users/users/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/users/edit.blade.php @@ -48,7 +48,7 @@
- + @{{ errors.first('password') }}
From 01f0fc9a572180d10c0ed186090cbdb6ffa14604 Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Wed, 22 Jan 2020 18:44:53 +0530 Subject: [PATCH 31/34] 2089 and updated codeception dependencies --- composer.json | 2 +- composer.lock | 1088 ++++------------- .../views/sales/invoices/pdf.blade.php | 6 +- .../customers/account/orders/pdf.blade.php | 10 +- 4 files changed, 235 insertions(+), 871 deletions(-) diff --git a/composer.json b/composer.json index 592c64358..3a95dbcdd 100755 --- a/composer.json +++ b/composer.json @@ -37,8 +37,8 @@ }, "require-dev": { - "codeception/codeception": "3.1.*", "barryvdh/laravel-debugbar": "^3.1", + "codeception/codeception": "^4.0", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "laravel/dusk": "^5.7.0", diff --git a/composer.lock b/composer.lock index b047e7387..09e536452 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "06686b2b0cd023b308427381d8ee9184", + "content-hash": "7462e554659628e02c0730d3dfb372a4", "packages": [ { "name": "astrotomic/laravel-translatable", @@ -1511,16 +1511,16 @@ }, { "name": "laravel/framework", - "version": "v6.11.0", + "version": "v6.12.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "17af23842c259edcfd8c5b9e6a7c86596e040034" + "reference": "8e189a8dee7ff76bf50acb7e80aa1a36afaf54d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/17af23842c259edcfd8c5b9e6a7c86596e040034", - "reference": "17af23842c259edcfd8c5b9e6a7c86596e040034", + "url": "https://api.github.com/repos/laravel/framework/zipball/8e189a8dee7ff76bf50acb7e80aa1a36afaf54d4", + "reference": "8e189a8dee7ff76bf50acb7e80aa1a36afaf54d4", "shasum": "" }, "require": { @@ -1595,7 +1595,7 @@ "moontoast/math": "^1.1", "orchestra/testbench-core": "^4.0", "pda/pheanstalk": "^4.0", - "phpunit/phpunit": "^8.4|^9.0", + "phpunit/phpunit": "^7.5.15|^8.4|^9.0", "predis/predis": "^1.1.1", "symfony/cache": "^4.3.4" }, @@ -1654,7 +1654,7 @@ "framework", "laravel" ], - "time": "2020-01-14T15:12:09+00:00" + "time": "2020-01-21T15:10:03+00:00" }, { "name": "laravel/helpers", @@ -2424,16 +2424,16 @@ }, { "name": "nesbot/carbon", - "version": "2.29.0", + "version": "2.29.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "faf862506030dc48c061c840c7f50933f1df4ed8" + "reference": "e509be5bf2d703390e69e14496d9a1168452b0a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/faf862506030dc48c061c840c7f50933f1df4ed8", - "reference": "faf862506030dc48c061c840c7f50933f1df4ed8", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e509be5bf2d703390e69e14496d9a1168452b0a2", + "reference": "e509be5bf2d703390e69e14496d9a1168452b0a2", "shasum": "" }, "require": { @@ -2490,7 +2490,7 @@ "datetime", "time" ], - "time": "2020-01-21T07:29:55+00:00" + "time": "2020-01-21T09:36:43+00:00" }, { "name": "nikic/php-parser", @@ -3557,16 +3557,16 @@ }, { "name": "symfony/console", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "82437719dab1e6bdd28726af14cb345c2ec816d0" + "reference": "e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/82437719dab1e6bdd28726af14cb345c2ec816d0", - "reference": "82437719dab1e6bdd28726af14cb345c2ec816d0", + "url": "https://api.github.com/repos/symfony/console/zipball/e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f", + "reference": "e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f", "shasum": "" }, "require": { @@ -3629,29 +3629,29 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-12-17T10:32:23+00:00" + "time": "2020-01-10T21:54:01+00:00" }, { "name": "symfony/css-selector", - "version": "v4.4.2", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "64acec7e0d67125e9f4656c68d4a38a42ab5a0b7" + "reference": "ff60c90cb7950b592ebc84ad1289d0345bf24f9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/64acec7e0d67125e9f4656c68d4a38a42ab5a0b7", - "reference": "64acec7e0d67125e9f4656c68d4a38a42ab5a0b7", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/ff60c90cb7950b592ebc84ad1289d0345bf24f9f", + "reference": "ff60c90cb7950b592ebc84ad1289d0345bf24f9f", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -3682,20 +3682,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-10-12T00:35:04+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "symfony/debug", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "5c4c1db977dc70bb3250e1308d3e8c6341aa38f5" + "reference": "89c3fd5c299b940333bc6fe9f1b8db1b0912c759" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/5c4c1db977dc70bb3250e1308d3e8c6341aa38f5", - "reference": "5c4c1db977dc70bb3250e1308d3e8c6341aa38f5", + "url": "https://api.github.com/repos/symfony/debug/zipball/89c3fd5c299b940333bc6fe9f1b8db1b0912c759", + "reference": "89c3fd5c299b940333bc6fe9f1b8db1b0912c759", "shasum": "" }, "require": { @@ -3738,20 +3738,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-12-16T14:46:54+00:00" + "time": "2020-01-08T17:29:02+00:00" }, { "name": "symfony/error-handler", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "6d7d7712a6ff5215ec26215672293b154f1db8c1" + "reference": "a59789092e40ad08465dc2cdc55651be503d0d5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/6d7d7712a6ff5215ec26215672293b154f1db8c1", - "reference": "6d7d7712a6ff5215ec26215672293b154f1db8c1", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/a59789092e40ad08465dc2cdc55651be503d0d5a", + "reference": "a59789092e40ad08465dc2cdc55651be503d0d5a", "shasum": "" }, "require": { @@ -3794,20 +3794,20 @@ ], "description": "Symfony ErrorHandler Component", "homepage": "https://symfony.com", - "time": "2019-12-16T14:46:54+00:00" + "time": "2020-01-08T17:29:02+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b3c3068a72623287550fe20b84a2b01dcba2686f" + "reference": "9e3de195e5bc301704dd6915df55892f6dfc208b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b3c3068a72623287550fe20b84a2b01dcba2686f", - "reference": "b3c3068a72623287550fe20b84a2b01dcba2686f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9e3de195e5bc301704dd6915df55892f6dfc208b", + "reference": "9e3de195e5bc301704dd6915df55892f6dfc208b", "shasum": "" }, "require": { @@ -3864,7 +3864,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-11-28T13:33:56+00:00" + "time": "2020-01-10T21:54:01+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3926,16 +3926,16 @@ }, { "name": "symfony/finder", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ce8743441da64c41e2a667b8eb66070444ed911e" + "reference": "3a50be43515590faf812fbd7708200aabc327ec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ce8743441da64c41e2a667b8eb66070444ed911e", - "reference": "ce8743441da64c41e2a667b8eb66070444ed911e", + "url": "https://api.github.com/repos/symfony/finder/zipball/3a50be43515590faf812fbd7708200aabc327ec3", + "reference": "3a50be43515590faf812fbd7708200aabc327ec3", "shasum": "" }, "require": { @@ -3971,20 +3971,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-11-17T21:56:56+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "fcae1cff5b57b2a9c3aabefeb1527678705ddb62" + "reference": "c33998709f3fe9b8e27e0277535b07fbf6fde37a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/fcae1cff5b57b2a9c3aabefeb1527678705ddb62", - "reference": "fcae1cff5b57b2a9c3aabefeb1527678705ddb62", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/c33998709f3fe9b8e27e0277535b07fbf6fde37a", + "reference": "c33998709f3fe9b8e27e0277535b07fbf6fde37a", "shasum": "" }, "require": { @@ -4026,20 +4026,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-12-19T15:57:49+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "fe310d2e95cd4c356836c8ecb0895a46d97fede2" + "reference": "16f2aa3c54b08483fba5375938f60b1ff83b6bd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/fe310d2e95cd4c356836c8ecb0895a46d97fede2", - "reference": "fe310d2e95cd4c356836c8ecb0895a46d97fede2", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/16f2aa3c54b08483fba5375938f60b1ff83b6bd2", + "reference": "16f2aa3c54b08483fba5375938f60b1ff83b6bd2", "shasum": "" }, "require": { @@ -4116,20 +4116,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2019-12-19T16:23:40+00:00" + "time": "2020-01-21T13:23:17+00:00" }, { "name": "symfony/mime", - "version": "v5.0.2", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "0e6a4ced216e49d457eddcefb61132173a876d79" + "reference": "2a3c7fee1f1a0961fa9cf360d5da553d05095e59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/0e6a4ced216e49d457eddcefb61132173a876d79", - "reference": "0e6a4ced216e49d457eddcefb61132173a876d79", + "url": "https://api.github.com/repos/symfony/mime/zipball/2a3c7fee1f1a0961fa9cf360d5da553d05095e59", + "reference": "2a3c7fee1f1a0961fa9cf360d5da553d05095e59", "shasum": "" }, "require": { @@ -4178,7 +4178,7 @@ "mime", "mime-type" ], - "time": "2019-11-30T14:12:50+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4641,16 +4641,16 @@ }, { "name": "symfony/process", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b" + "reference": "f5697ab4cb14a5deed7473819e63141bf5352c36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b84501ad50adb72a94fb460a5b5c91f693e99c9b", - "reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b", + "url": "https://api.github.com/repos/symfony/process/zipball/f5697ab4cb14a5deed7473819e63141bf5352c36", + "reference": "f5697ab4cb14a5deed7473819e63141bf5352c36", "shasum": "" }, "require": { @@ -4686,20 +4686,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-12-06T10:06:46+00:00" + "time": "2020-01-09T09:50:08+00:00" }, { "name": "symfony/routing", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "628bcafae1b2043969378dcfbf9c196539a38722" + "reference": "7bf4e38573728e317b926ca4482ad30470d0e86a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/628bcafae1b2043969378dcfbf9c196539a38722", - "reference": "628bcafae1b2043969378dcfbf9c196539a38722", + "url": "https://api.github.com/repos/symfony/routing/zipball/7bf4e38573728e317b926ca4482ad30470d0e86a", + "reference": "7bf4e38573728e317b926ca4482ad30470d0e86a", "shasum": "" }, "require": { @@ -4762,7 +4762,7 @@ "uri", "url" ], - "time": "2019-12-12T12:53:52+00:00" + "time": "2020-01-08T17:29:02+00:00" }, { "name": "symfony/service-contracts", @@ -4824,16 +4824,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f7669f48a9633bf8139bc026c755e894b7206677" + "reference": "f5d2ac46930238b30a9c2f1b17c905f3697d808c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f7669f48a9633bf8139bc026c755e894b7206677", - "reference": "f7669f48a9633bf8139bc026c755e894b7206677", + "url": "https://api.github.com/repos/symfony/translation/zipball/f5d2ac46930238b30a9c2f1b17c905f3697d808c", + "reference": "f5d2ac46930238b30a9c2f1b17c905f3697d808c", "shasum": "" }, "require": { @@ -4896,7 +4896,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2019-12-12T12:53:52+00:00" + "time": "2020-01-15T13:29:06+00:00" }, { "name": "symfony/translation-contracts", @@ -4957,16 +4957,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "be330f919bdb395d1e0c3f2bfb8948512d6bdd99" + "reference": "7cfa470bc3b1887a7b2a47c0a702a84ad614fa92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/be330f919bdb395d1e0c3f2bfb8948512d6bdd99", - "reference": "be330f919bdb395d1e0c3f2bfb8948512d6bdd99", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/7cfa470bc3b1887a7b2a47c0a702a84ad614fa92", + "reference": "7cfa470bc3b1887a7b2a47c0a702a84ad614fa92", "shasum": "" }, "require": { @@ -5029,7 +5029,7 @@ "debug", "dump" ], - "time": "2019-12-18T13:41:29+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -5082,16 +5082,16 @@ }, { "name": "tymon/jwt-auth", - "version": "1.0.0-rc.5", + "version": "1.0.0-rc.5.1", "source": { "type": "git", "url": "https://github.com/tymondesigns/jwt-auth.git", - "reference": "103739700dc0358039a33b5bc91247570bb83529" + "reference": "f57a0ff33f20d2a0c3ebc9e13ce8382a83f921a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tymondesigns/jwt-auth/zipball/103739700dc0358039a33b5bc91247570bb83529", - "reference": "103739700dc0358039a33b5bc91247570bb83529", + "url": "https://api.github.com/repos/tymondesigns/jwt-auth/zipball/f57a0ff33f20d2a0c3ebc9e13ce8382a83f921a8", + "reference": "f57a0ff33f20d2a0c3ebc9e13ce8382a83f921a8", "shasum": "" }, "require": { @@ -5153,7 +5153,7 @@ "jwt", "laravel" ], - "time": "2019-09-09T03:33:47+00:00" + "time": "2020-01-21T13:04:35+00:00" }, { "name": "vlucas/phpdotenv", @@ -5343,62 +5343,51 @@ }, { "name": "codeception/codeception", - "version": "3.1.2", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "5ea172de7b1b2e61dcdd50d73f8368886c549fb4" + "reference": "e610c15ebb73b56722c67e1c799bf0565f062899" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/5ea172de7b1b2e61dcdd50d73f8368886c549fb4", - "reference": "5ea172de7b1b2e61dcdd50d73f8368886c549fb4", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/e610c15ebb73b56722c67e1c799bf0565f062899", + "reference": "e610c15ebb73b56722c67e1c799bf0565f062899", "shasum": "" }, "require": { "behat/gherkin": "^4.4.0", - "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.0.3", + "codeception/lib-asserts": "^1.0", + "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.1.1", "codeception/stub": "^2.0 | ^3.0", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "facebook/webdriver": "^1.6.0", - "guzzlehttp/guzzle": "^6.3.0", "guzzlehttp/psr7": "~1.4", - "hoa/console": "~3.0", "php": ">=5.6.0 <8.0", - "symfony/browser-kit": ">=2.7 <5.0", - "symfony/console": ">=2.7 <5.0", - "symfony/css-selector": ">=2.7 <5.0", - "symfony/dom-crawler": ">=2.7 <5.0", - "symfony/event-dispatcher": ">=2.7 <5.0", - "symfony/finder": ">=2.7 <5.0", - "symfony/yaml": ">=2.7 <5.0" + "symfony/console": ">=2.7 <6.0", + "symfony/css-selector": ">=2.7 <6.0", + "symfony/event-dispatcher": ">=2.7 <6.0", + "symfony/finder": ">=2.7 <6.0", + "symfony/yaml": ">=2.7 <6.0" }, "require-dev": { + "codeception/module-asserts": "*@dev", + "codeception/module-cli": "*@dev", + "codeception/module-db": "*@dev", + "codeception/module-filesystem": "*@dev", + "codeception/module-phpbrowser": "*@dev", "codeception/specify": "~0.3", - "doctrine/annotations": "^1", - "doctrine/data-fixtures": "^1", - "doctrine/orm": "^2", - "flow/jsonpath": "~0.2", + "codeception/util-universalframework": "*@dev", "monolog/monolog": "~1.8", - "pda/pheanstalk": "~3.0", - "php-amqplib/php-amqplib": "~2.4", - "predis/predis": "^1.0", - "ramsey/uuid-doctrine": "^1.5", "squizlabs/php_codesniffer": "~2.0", - "symfony/process": ">=2.7 <5.0", - "vlucas/phpdotenv": "^3.0" + "symfony/process": ">=2.7 <6.0", + "vlucas/phpdotenv": "^2.0 | ^3.0 | ^4.0" }, "suggest": { - "aws/aws-sdk-php": "For using AWS Auth in REST module and Queue module", - "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests", "codeception/specify": "BDD-style code blocks", "codeception/verify": "BDD-style assertions", - "flow/jsonpath": "For using JSONPath in REST module", - "league/factory-muffin": "For DataFactory module", - "league/factory-muffin-faker": "For Faker support in DataFactory module", - "phpseclib/phpseclib": "for SFTP option in FTP Module", + "hoa/console": "For interactive console functionality", "stecman/symfony-console-completion": "For BASH autocompletion", "symfony/phpunit-bridge": "For phpunit-bridge support" }, @@ -5435,7 +5424,52 @@ "functional testing", "unit testing" ], - "time": "2019-10-19T13:15:55+00:00" + "time": "2020-01-14T14:44:10+00:00" + }, + { + "name": "codeception/lib-asserts", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/Codeception/lib-asserts.git", + "reference": "e7decb48defc5dd89e26ae05019e63260a9c4c0f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/lib-asserts/zipball/e7decb48defc5dd89e26ae05019e63260a9c4c0f", + "reference": "e7decb48defc5dd89e26ae05019e63260a9c4c0f", + "shasum": "" + }, + "require": { + "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.0.3", + "php": ">=5.6.0 <8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert@mail.ua", + "homepage": "http://codegyre.com" + }, + { + "name": "Gintautas Miselis" + } + ], + "description": "Assertion methods used by Codeception core and Asserts module", + "homepage": "http://codeception.com/", + "keywords": [ + "codeception" + ], + "time": "2019-11-13T17:28:28+00:00" }, { "name": "codeception/phpunit-wrapper", @@ -5567,67 +5601,6 @@ ], "time": "2019-10-21T16:45:58+00:00" }, - { - "name": "facebook/webdriver", - "version": "1.7.1", - "source": { - "type": "git", - "url": "https://github.com/facebook/php-webdriver.git", - "reference": "e43de70f3c7166169d0f14a374505392734160e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/e43de70f3c7166169d0f14a374505392734160e5", - "reference": "e43de70f3c7166169d0f14a374505392734160e5", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "ext-zip": "*", - "php": "^5.6 || ~7.0", - "symfony/process": "^2.8 || ^3.1 || ^4.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "php-coveralls/php-coveralls": "^2.0", - "php-mock/php-mock-phpunit": "^1.1", - "phpunit/phpunit": "^5.7", - "sebastian/environment": "^1.3.4 || ^2.0 || ^3.0", - "squizlabs/php_codesniffer": "^2.6", - "symfony/var-dumper": "^3.3 || ^4.0" - }, - "suggest": { - "ext-SimpleXML": "For Firefox profile creation" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-community": "1.5-dev" - } - }, - "autoload": { - "psr-4": { - "Facebook\\WebDriver\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "A PHP client for Selenium WebDriver", - "homepage": "https://github.com/facebook/php-webdriver", - "keywords": [ - "facebook", - "php", - "selenium", - "webdriver" - ], - "abandoned": "php-webdriver/webdriver", - "time": "2019-06-13T08:02:18+00:00" - }, { "name": "filp/whoops", "version": "2.7.1", @@ -5787,577 +5760,28 @@ ], "time": "2016-01-20T08:20:44+00:00" }, - { - "name": "hoa/consistency", - "version": "1.17.05.02", - "source": { - "type": "git", - "url": "https://github.com/hoaproject/Consistency.git", - "reference": "fd7d0adc82410507f332516faf655b6ed22e4c2f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hoaproject/Consistency/zipball/fd7d0adc82410507f332516faf655b6ed22e4c2f", - "reference": "fd7d0adc82410507f332516faf655b6ed22e4c2f", - "shasum": "" - }, - "require": { - "hoa/exception": "~1.0", - "php": ">=5.5.0" - }, - "require-dev": { - "hoa/stream": "~1.0", - "hoa/test": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Hoa\\Consistency\\": "." - }, - "files": [ - "Prelude.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ivan Enderlin", - "email": "ivan.enderlin@hoa-project.net" - }, - { - "name": "Hoa community", - "homepage": "https://hoa-project.net/" - } - ], - "description": "The Hoa\\Consistency library.", - "homepage": "https://hoa-project.net/", - "keywords": [ - "autoloader", - "callable", - "consistency", - "entity", - "flex", - "keyword", - "library" - ], - "time": "2017-05-02T12:18:12+00:00" - }, - { - "name": "hoa/console", - "version": "3.17.05.02", - "source": { - "type": "git", - "url": "https://github.com/hoaproject/Console.git", - "reference": "e231fd3ea70e6d773576ae78de0bdc1daf331a66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hoaproject/Console/zipball/e231fd3ea70e6d773576ae78de0bdc1daf331a66", - "reference": "e231fd3ea70e6d773576ae78de0bdc1daf331a66", - "shasum": "" - }, - "require": { - "hoa/consistency": "~1.0", - "hoa/event": "~1.0", - "hoa/exception": "~1.0", - "hoa/file": "~1.0", - "hoa/protocol": "~1.0", - "hoa/stream": "~1.0", - "hoa/ustring": "~4.0" - }, - "require-dev": { - "hoa/test": "~2.0" - }, - "suggest": { - "ext-pcntl": "To enable hoa://Event/Console/Window:resize.", - "hoa/dispatcher": "To use the console kit.", - "hoa/router": "To use the console kit." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Hoa\\Console\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ivan Enderlin", - "email": "ivan.enderlin@hoa-project.net" - }, - { - "name": "Hoa community", - "homepage": "https://hoa-project.net/" - } - ], - "description": "The Hoa\\Console library.", - "homepage": "https://hoa-project.net/", - "keywords": [ - "autocompletion", - "chrome", - "cli", - "console", - "cursor", - "getoption", - "library", - "option", - "parser", - "processus", - "readline", - "terminfo", - "tput", - "window" - ], - "time": "2017-05-02T12:26:19+00:00" - }, - { - "name": "hoa/event", - "version": "1.17.01.13", - "source": { - "type": "git", - "url": "https://github.com/hoaproject/Event.git", - "reference": "6c0060dced212ffa3af0e34bb46624f990b29c54" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hoaproject/Event/zipball/6c0060dced212ffa3af0e34bb46624f990b29c54", - "reference": "6c0060dced212ffa3af0e34bb46624f990b29c54", - "shasum": "" - }, - "require": { - "hoa/consistency": "~1.0", - "hoa/exception": "~1.0" - }, - "require-dev": { - "hoa/test": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Hoa\\Event\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ivan Enderlin", - "email": "ivan.enderlin@hoa-project.net" - }, - { - "name": "Hoa community", - "homepage": "https://hoa-project.net/" - } - ], - "description": "The Hoa\\Event library.", - "homepage": "https://hoa-project.net/", - "keywords": [ - "event", - "library", - "listener", - "observer" - ], - "time": "2017-01-13T15:30:50+00:00" - }, - { - "name": "hoa/exception", - "version": "1.17.01.16", - "source": { - "type": "git", - "url": "https://github.com/hoaproject/Exception.git", - "reference": "091727d46420a3d7468ef0595651488bfc3a458f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hoaproject/Exception/zipball/091727d46420a3d7468ef0595651488bfc3a458f", - "reference": "091727d46420a3d7468ef0595651488bfc3a458f", - "shasum": "" - }, - "require": { - "hoa/consistency": "~1.0", - "hoa/event": "~1.0" - }, - "require-dev": { - "hoa/test": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Hoa\\Exception\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ivan Enderlin", - "email": "ivan.enderlin@hoa-project.net" - }, - { - "name": "Hoa community", - "homepage": "https://hoa-project.net/" - } - ], - "description": "The Hoa\\Exception library.", - "homepage": "https://hoa-project.net/", - "keywords": [ - "exception", - "library" - ], - "time": "2017-01-16T07:53:27+00:00" - }, - { - "name": "hoa/file", - "version": "1.17.07.11", - "source": { - "type": "git", - "url": "https://github.com/hoaproject/File.git", - "reference": "35cb979b779bc54918d2f9a4e02ed6c7a1fa67ca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hoaproject/File/zipball/35cb979b779bc54918d2f9a4e02ed6c7a1fa67ca", - "reference": "35cb979b779bc54918d2f9a4e02ed6c7a1fa67ca", - "shasum": "" - }, - "require": { - "hoa/consistency": "~1.0", - "hoa/event": "~1.0", - "hoa/exception": "~1.0", - "hoa/iterator": "~2.0", - "hoa/stream": "~1.0" - }, - "require-dev": { - "hoa/test": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Hoa\\File\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ivan Enderlin", - "email": "ivan.enderlin@hoa-project.net" - }, - { - "name": "Hoa community", - "homepage": "https://hoa-project.net/" - } - ], - "description": "The Hoa\\File library.", - "homepage": "https://hoa-project.net/", - "keywords": [ - "Socket", - "directory", - "file", - "finder", - "library", - "link", - "temporary" - ], - "time": "2017-07-11T07:42:15+00:00" - }, - { - "name": "hoa/iterator", - "version": "2.17.01.10", - "source": { - "type": "git", - "url": "https://github.com/hoaproject/Iterator.git", - "reference": "d1120ba09cb4ccd049c86d10058ab94af245f0cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hoaproject/Iterator/zipball/d1120ba09cb4ccd049c86d10058ab94af245f0cc", - "reference": "d1120ba09cb4ccd049c86d10058ab94af245f0cc", - "shasum": "" - }, - "require": { - "hoa/consistency": "~1.0", - "hoa/exception": "~1.0" - }, - "require-dev": { - "hoa/test": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Hoa\\Iterator\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ivan Enderlin", - "email": "ivan.enderlin@hoa-project.net" - }, - { - "name": "Hoa community", - "homepage": "https://hoa-project.net/" - } - ], - "description": "The Hoa\\Iterator library.", - "homepage": "https://hoa-project.net/", - "keywords": [ - "iterator", - "library" - ], - "time": "2017-01-10T10:34:47+00:00" - }, - { - "name": "hoa/protocol", - "version": "1.17.01.14", - "source": { - "type": "git", - "url": "https://github.com/hoaproject/Protocol.git", - "reference": "5c2cf972151c45f373230da170ea015deecf19e2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hoaproject/Protocol/zipball/5c2cf972151c45f373230da170ea015deecf19e2", - "reference": "5c2cf972151c45f373230da170ea015deecf19e2", - "shasum": "" - }, - "require": { - "hoa/consistency": "~1.0", - "hoa/exception": "~1.0" - }, - "require-dev": { - "hoa/test": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Hoa\\Protocol\\": "." - }, - "files": [ - "Wrapper.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ivan Enderlin", - "email": "ivan.enderlin@hoa-project.net" - }, - { - "name": "Hoa community", - "homepage": "https://hoa-project.net/" - } - ], - "description": "The Hoa\\Protocol library.", - "homepage": "https://hoa-project.net/", - "keywords": [ - "library", - "protocol", - "resource", - "stream", - "wrapper" - ], - "time": "2017-01-14T12:26:10+00:00" - }, - { - "name": "hoa/stream", - "version": "1.17.02.21", - "source": { - "type": "git", - "url": "https://github.com/hoaproject/Stream.git", - "reference": "3293cfffca2de10525df51436adf88a559151d82" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hoaproject/Stream/zipball/3293cfffca2de10525df51436adf88a559151d82", - "reference": "3293cfffca2de10525df51436adf88a559151d82", - "shasum": "" - }, - "require": { - "hoa/consistency": "~1.0", - "hoa/event": "~1.0", - "hoa/exception": "~1.0", - "hoa/protocol": "~1.0" - }, - "require-dev": { - "hoa/test": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Hoa\\Stream\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ivan Enderlin", - "email": "ivan.enderlin@hoa-project.net" - }, - { - "name": "Hoa community", - "homepage": "https://hoa-project.net/" - } - ], - "description": "The Hoa\\Stream library.", - "homepage": "https://hoa-project.net/", - "keywords": [ - "Context", - "bucket", - "composite", - "filter", - "in", - "library", - "out", - "protocol", - "stream", - "wrapper" - ], - "time": "2017-02-21T16:01:06+00:00" - }, - { - "name": "hoa/ustring", - "version": "4.17.01.16", - "source": { - "type": "git", - "url": "https://github.com/hoaproject/Ustring.git", - "reference": "e6326e2739178799b1fe3fdd92029f9517fa17a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hoaproject/Ustring/zipball/e6326e2739178799b1fe3fdd92029f9517fa17a0", - "reference": "e6326e2739178799b1fe3fdd92029f9517fa17a0", - "shasum": "" - }, - "require": { - "hoa/consistency": "~1.0", - "hoa/exception": "~1.0" - }, - "require-dev": { - "hoa/test": "~2.0" - }, - "suggest": { - "ext-iconv": "ext/iconv must be present (or a third implementation) to use Hoa\\Ustring::transcode().", - "ext-intl": "To get a better Hoa\\Ustring::toAscii() and Hoa\\Ustring::compareTo()." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, - "autoload": { - "psr-4": { - "Hoa\\Ustring\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ivan Enderlin", - "email": "ivan.enderlin@hoa-project.net" - }, - { - "name": "Hoa community", - "homepage": "https://hoa-project.net/" - } - ], - "description": "The Hoa\\Ustring library.", - "homepage": "https://hoa-project.net/", - "keywords": [ - "library", - "search", - "string", - "unicode" - ], - "time": "2017-01-16T07:08:25+00:00" - }, { "name": "laravel/dusk", - "version": "v5.8.1", + "version": "v5.8.2", "source": { "type": "git", "url": "https://github.com/laravel/dusk.git", - "reference": "d67fe1d0797fc2886d9229f011be9af8ee069750" + "reference": "c95d70b5fff000c54a9186c2011b236592fcf948" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/dusk/zipball/d67fe1d0797fc2886d9229f011be9af8ee069750", - "reference": "d67fe1d0797fc2886d9229f011be9af8ee069750", + "url": "https://api.github.com/repos/laravel/dusk/zipball/c95d70b5fff000c54a9186c2011b236592fcf948", + "reference": "c95d70b5fff000c54a9186c2011b236592fcf948", "shasum": "" }, "require": { "ext-json": "*", "ext-zip": "*", - "facebook/webdriver": "^1.7", "illuminate/console": "~5.7.0|~5.8.0|^6.0|^7.0", "illuminate/support": "~5.7.0|~5.8.0|^6.0|^7.0", "nesbot/carbon": "^1.20|^2.0", "php": ">=7.1.0", + "php-webdriver/webdriver": "^1.7", "symfony/console": "^4.0|^5.0", "symfony/finder": "^4.0|^5.0", "symfony/process": "^4.0|^5.0", @@ -6402,7 +5826,7 @@ "testing", "webdriver" ], - "time": "2020-01-07T18:54:17+00:00" + "time": "2020-01-21T20:57:39+00:00" }, { "name": "maximebf/debugbar", @@ -6744,6 +6168,66 @@ "description": "Library for handling version information and constraints", "time": "2018-07-08T19:19:57+00:00" }, + { + "name": "php-webdriver/webdriver", + "version": "1.7.1", + "source": { + "type": "git", + "url": "https://github.com/php-webdriver/php-webdriver.git", + "reference": "e43de70f3c7166169d0f14a374505392734160e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/e43de70f3c7166169d0f14a374505392734160e5", + "reference": "e43de70f3c7166169d0f14a374505392734160e5", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-zip": "*", + "php": "^5.6 || ~7.0", + "symfony/process": "^2.8 || ^3.1 || ^4.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.0", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "php-coveralls/php-coveralls": "^2.0", + "php-mock/php-mock-phpunit": "^1.1", + "phpunit/phpunit": "^5.7", + "sebastian/environment": "^1.3.4 || ^2.0 || ^3.0", + "squizlabs/php_codesniffer": "^2.6", + "symfony/var-dumper": "^3.3 || ^4.0" + }, + "suggest": { + "ext-SimpleXML": "For Firefox profile creation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-community": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Facebook\\WebDriver\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "A PHP client for Selenium WebDriver", + "homepage": "https://github.com/facebook/php-webdriver", + "keywords": [ + "facebook", + "php", + "selenium", + "webdriver" + ], + "time": "2019-06-13T08:02:18+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.0.0", @@ -7860,149 +7344,29 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, - { - "name": "symfony/browser-kit", - "version": "v4.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/browser-kit.git", - "reference": "e19e465c055137938afd40cfddd687e7511bbbf0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e19e465c055137938afd40cfddd687e7511bbbf0", - "reference": "e19e465c055137938afd40cfddd687e7511bbbf0", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/dom-crawler": "^3.4|^4.0|^5.0" - }, - "require-dev": { - "symfony/css-selector": "^3.4|^4.0|^5.0", - "symfony/http-client": "^4.3|^5.0", - "symfony/mime": "^4.3|^5.0", - "symfony/process": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony BrowserKit Component", - "homepage": "https://symfony.com", - "time": "2019-10-28T20:30:34+00:00" - }, - { - "name": "symfony/dom-crawler", - "version": "v4.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "36bbcab9369fc2f583220890efd43bf262d563fd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/36bbcab9369fc2f583220890efd43bf262d563fd", - "reference": "36bbcab9369fc2f583220890efd43bf262d563fd", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "masterminds/html5": "<2.6" - }, - "require-dev": { - "masterminds/html5": "^2.6", - "symfony/css-selector": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com", - "time": "2019-10-29T11:38:30+00:00" - }, { "name": "symfony/yaml", - "version": "v4.4.2", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "a08832b974dd5fafe3085a66d41fe4c84bb2628c" + "reference": "69b44e3b8f90949aee2eb3aa9b86ceeb01cbf62a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/a08832b974dd5fafe3085a66d41fe4c84bb2628c", - "reference": "a08832b974dd5fafe3085a66d41fe4c84bb2628c", + "url": "https://api.github.com/repos/symfony/yaml/zipball/69b44e3b8f90949aee2eb3aa9b86ceeb01cbf62a", + "reference": "69b44e3b8f90949aee2eb3aa9b86ceeb01cbf62a", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/console": "<3.4" + "symfony/console": "<4.4" }, "require-dev": { - "symfony/console": "^3.4|^4.0|^5.0" + "symfony/console": "^4.4|^5.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -8010,7 +7374,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -8037,7 +7401,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-12-10T10:33:21+00:00" + "time": "2020-01-21T11:12:28+00:00" }, { "name": "theseer/tokenizer", @@ -8134,7 +7498,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.1.3", + "php": "^7.2.0", "ext-curl": "*", "ext-intl": "*", "ext-mbstring": "*", diff --git a/packages/Webkul/Admin/src/Resources/views/sales/invoices/pdf.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/invoices/pdf.blade.php index 1d69d82c4..0dadd3305 100755 --- a/packages/Webkul/Admin/src/Resources/views/sales/invoices/pdf.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/sales/invoices/pdf.blade.php @@ -45,7 +45,7 @@ padding: 5px 10px; border-bottom: solid 1px #d3d3d3; border-left: solid 1px #d3d3d3; - color: $font-color; + color: #3A3A3A; vertical-align: middle; } @@ -127,7 +127,7 @@

{{ $invoice->order->shipping_address->city }}

{{ $invoice->order->shipping_address->state }}

{{ core()->country_name($invoice->order->shipping_address->country) }} {{ $invoice->order->shipping_address->postcode }}

- {{ __('shop::app.checkout.onepage.contact') }} : {{ $invoice->order->shipping_address->phone }} + {{ __('shop::app.checkout.onepage.contact') }} : {{ $invoice->order->shipping_address->phone }} @endif @@ -187,7 +187,7 @@ @if (isset($item->additional['attributes']))
- + @foreach ($item->additional['attributes'] as $attribute) {{ $attribute['attribute_name'] }} : {{ $attribute['option_label'] }}
@endforeach diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/orders/pdf.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/orders/pdf.blade.php index 3ce020082..00dd5bbe8 100755 --- a/packages/Webkul/Shop/src/Resources/views/customers/account/orders/pdf.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/orders/pdf.blade.php @@ -45,7 +45,7 @@ padding: 5px 10px; border-bottom: solid 1px #d3d3d3; border-left: solid 1px #d3d3d3; - color: $font-color; + color: #3A3A3A; vertical-align: middle; font-family: DejaVu Sans; sans-serif; } @@ -87,12 +87,12 @@
{{ __('shop::app.customer.account.order.view.invoice-id') }} - - #{{ $invoice->id }} + {{ $invoice->id }}
{{ __('shop::app.customer.account.order.view.order-id') }} - - #{{ $invoice->order->increment_id }} + {{ $invoice->order->increment_id }}
@@ -124,7 +124,7 @@

{{ __('shop::app.customer.account.order.view.contact') }} : {{ $invoice->order->billing_address->phone }} - + @if ($invoice->order->shipping_address)

{{ $invoice->order->shipping_address->name }}

@@ -193,7 +193,7 @@ @if (isset($item->additional['attributes']))
- + @foreach ($item->additional['attributes'] as $attribute) {{ $attribute['attribute_name'] }} : {{ $attribute['option_label'] }}
@endforeach From 4e03cd81d354ad27171e44b8749e4b35f597dce2 Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Wed, 22 Jan 2020 18:59:39 +0530 Subject: [PATCH 32/34] codeception/module-asserts --- composer.json | 1 + composer.lock | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3a95dbcdd..5ac8c0258 100755 --- a/composer.json +++ b/composer.json @@ -39,6 +39,7 @@ "require-dev": { "barryvdh/laravel-debugbar": "^3.1", "codeception/codeception": "^4.0", + "codeception/module-asserts": "^1.1", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "laravel/dusk": "^5.7.0", diff --git a/composer.lock b/composer.lock index 09e536452..b3f29d8bb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7462e554659628e02c0730d3dfb372a4", + "content-hash": "c3640c1ee1912fd52af7f7321113a3de", "packages": [ { "name": "astrotomic/laravel-translatable", @@ -5471,6 +5471,58 @@ ], "time": "2019-11-13T17:28:28+00:00" }, + { + "name": "codeception/module-asserts", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/Codeception/module-asserts.git", + "reference": "87c83ca3ccfbc0d79f5effb57e1f82eeaab0cb3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/module-asserts/zipball/87c83ca3ccfbc0d79f5effb57e1f82eeaab0cb3e", + "reference": "87c83ca3ccfbc0d79f5effb57e1f82eeaab0cb3e", + "shasum": "" + }, + "require": { + "codeception/codeception": "*@dev", + "codeception/lib-asserts": "^1.0.0", + "php": ">=5.6.0 <8.0" + }, + "conflict": { + "codeception/codeception": "<4.0" + }, + "require-dev": { + "codeception/util-robohelpers": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk" + }, + { + "name": "Gintautas Miselis" + } + ], + "description": "Codeception module containing various assertions", + "homepage": "http://codeception.com/", + "keywords": [ + "assertions", + "asserts", + "codeception" + ], + "time": "2019-11-13T17:32:27+00:00" + }, { "name": "codeception/phpunit-wrapper", "version": "7.8.0", From 0a0a86bf465486431a8e6390acc00759327cb22e Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Wed, 22 Jan 2020 19:12:46 +0530 Subject: [PATCH 33/34] codeception/module-filesystem --- composer.json | 1 + composer.lock | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5ac8c0258..249b36317 100755 --- a/composer.json +++ b/composer.json @@ -40,6 +40,7 @@ "barryvdh/laravel-debugbar": "^3.1", "codeception/codeception": "^4.0", "codeception/module-asserts": "^1.1", + "codeception/module-filesystem": "^1.0", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "laravel/dusk": "^5.7.0", diff --git a/composer.lock b/composer.lock index b3f29d8bb..0ea1a584d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c3640c1ee1912fd52af7f7321113a3de", + "content-hash": "6b5675ddb7cd173f6d023056babe71d9", "packages": [ { "name": "astrotomic/laravel-translatable", @@ -5523,6 +5523,57 @@ ], "time": "2019-11-13T17:32:27+00:00" }, + { + "name": "codeception/module-filesystem", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/Codeception/module-filesystem.git", + "reference": "fe3c352479924ec0aaf6a6c3d6825dc14242b81e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/module-filesystem/zipball/fe3c352479924ec0aaf6a6c3d6825dc14242b81e", + "reference": "fe3c352479924ec0aaf6a6c3d6825dc14242b81e", + "shasum": "" + }, + "require": { + "codeception/codeception": "*@dev", + "php": ">=5.6.0 <8.0", + "symfony/finder": ">=2.7 <6.0" + }, + "conflict": { + "codeception/codeception": "<4.0" + }, + "require-dev": { + "codeception/util-robohelpers": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk" + }, + { + "name": "Gintautas Miselis" + } + ], + "description": "Codeception module for testing local filesystem", + "homepage": "http://codeception.com/", + "keywords": [ + "codeception", + "filesystem" + ], + "time": "2019-12-04T17:13:39+00:00" + }, { "name": "codeception/phpunit-wrapper", "version": "7.8.0", From 15aca03e5469cef8e6d782f065373c8319ad5668 Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Wed, 22 Jan 2020 19:16:47 +0530 Subject: [PATCH 34/34] codeception/module-laravel5 --- composer.json | 1 + composer.lock | 225 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 225 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 249b36317..918317d36 100755 --- a/composer.json +++ b/composer.json @@ -41,6 +41,7 @@ "codeception/codeception": "^4.0", "codeception/module-asserts": "^1.1", "codeception/module-filesystem": "^1.0", + "codeception/module-laravel5": "^1.0", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "laravel/dusk": "^5.7.0", diff --git a/composer.lock b/composer.lock index 0ea1a584d..1a2050986 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6b5675ddb7cd173f6d023056babe71d9", + "content-hash": "f89fd224d5966e4af23fb443f7074697", "packages": [ { "name": "astrotomic/laravel-translatable", @@ -5471,6 +5471,59 @@ ], "time": "2019-11-13T17:28:28+00:00" }, + { + "name": "codeception/lib-innerbrowser", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/Codeception/lib-innerbrowser.git", + "reference": "289028f011dcc954c530e946ea34bb7ce4ec2721" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/lib-innerbrowser/zipball/289028f011dcc954c530e946ea34bb7ce4ec2721", + "reference": "289028f011dcc954c530e946ea34bb7ce4ec2721", + "shasum": "" + }, + "require": { + "codeception/codeception": "*@dev", + "php": ">=5.6.0 <8.0", + "symfony/browser-kit": ">=2.7 <6.0", + "symfony/dom-crawler": ">=2.7 <6.0" + }, + "conflict": { + "codeception/codeception": "<4.0" + }, + "require-dev": { + "codeception/util-universalframework": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert@mail.ua", + "homepage": "http://codegyre.com" + }, + { + "name": "Gintautas Miselis" + } + ], + "description": "Parent library for all Codeception framework modules and PhpBrowser", + "homepage": "http://codeception.com/", + "keywords": [ + "codeception" + ], + "time": "2019-11-26T16:50:12+00:00" + }, { "name": "codeception/module-asserts", "version": "1.1.1", @@ -5574,6 +5627,56 @@ ], "time": "2019-12-04T17:13:39+00:00" }, + { + "name": "codeception/module-laravel5", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/Codeception/module-laravel5.git", + "reference": "1cd28f775b4f85a2983fa7d8cb1698d5174e9beb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/module-laravel5/zipball/1cd28f775b4f85a2983fa7d8cb1698d5174e9beb", + "reference": "1cd28f775b4f85a2983fa7d8cb1698d5174e9beb", + "shasum": "" + }, + "require": { + "codeception/codeception": "4.0.x-dev | ^4.0", + "codeception/lib-innerbrowser": "dev-master | ^1.0", + "php": ">=5.6.0 <8.0" + }, + "require-dev": { + "codeception/module-asserts": "dev-master | ^1.0", + "codeception/module-rest": "dev-master | ^1.0", + "codeception/util-robohelpers": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan-Henk Gerritsen" + }, + { + "name": "Michael Bodnarchuk" + } + ], + "description": "Codeception module for Laravel 5 framework", + "homepage": "http://codeception.com/", + "keywords": [ + "codeception", + "laravel5" + ], + "time": "2019-10-10T15:58:56+00:00" + }, { "name": "codeception/phpunit-wrapper", "version": "7.8.0", @@ -7447,6 +7550,126 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, + { + "name": "symfony/browser-kit", + "version": "v5.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/browser-kit.git", + "reference": "b0294489a7fbb4f3f39c39efe6f0328cb09731b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/b0294489a7fbb4f3f39c39efe6f0328cb09731b9", + "reference": "b0294489a7fbb4f3f39c39efe6f0328cb09731b9", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/dom-crawler": "^4.4|^5.0" + }, + "require-dev": { + "symfony/css-selector": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/mime": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0" + }, + "suggest": { + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\BrowserKit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "https://symfony.com", + "time": "2020-01-04T14:08:26+00:00" + }, + { + "name": "symfony/dom-crawler", + "version": "v5.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "439c3c7be4daa569deef0dd1e30cf3562108d062" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/439c3c7be4daa569deef0dd1e30cf3562108d062", + "reference": "439c3c7be4daa569deef0dd1e30cf3562108d062", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "masterminds/html5": "<2.6" + }, + "require-dev": { + "masterminds/html5": "^2.6", + "symfony/css-selector": "^4.4|^5.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "time": "2020-01-04T14:08:26+00:00" + }, { "name": "symfony/yaml", "version": "v5.0.3",