Skip to content

Instantly share code, notes, and snippets.

View piotrekkaminski's full-sized avatar

Piotr Kaminski piotrekkaminski

View GitHub Profile
@piotrekkaminski
piotrekkaminski / gist:7f2d90232ad36ea42a61
Last active March 31, 2016 20:35
Customer attribute example
Let’s assume that new module (app/code/community/NewCustomerAttributeModule) adds new select attribute to customer backend form which is displayed on ‘My Dashboard’ in customer account on Frontend.
We are going to test this attribute while creating customer on Backend.
The following needs to be done:
1) As you added a new namespace, file dev/tests/functional/composer.json should be updated to use it:
"psr-4": {
"Magento\\": ["lib/Magento/", "vendor/magento/mtf/Magento/", "testsuites/Magento/"],
"Mage\\": ["generated/Mage/", "tests/app/Mage/"],
"Enterprise\\": ["generated/Community/", "tests/app/Community/"],
"Community\\": ["generated/Community/", "tests/app/Community/"],
"Test\\": "generated/Test/"
Index: dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertProductIsPresentOnCustomWebsite.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertProductIsPresentOnCustomWebsite.php (revision 133010710c8351e2bc0f3d64631a99633732a7c1)
+++ dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertProductIsPresentOnCustomWebsite.php (revision )
@@ -34,7 +34,6 @@
use Magento\Mtf\Fixture\FixtureFactory;
use Magento\Mtf\Fixture\InjectableFixture;
@piotrekkaminski
piotrekkaminski / website_selection.patch
Created June 8, 2015 21:51
website_selection.patch
Index: dev/tests/functional/tests/app/Mage/CatalogRule/Test/Repository/CatalogRule.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- dev/tests/functional/tests/app/Mage/CatalogRule/Test/Repository/CatalogRule.xml (revision 133010710c8351e2bc0f3d64631a99633732a7c1)
+++ dev/tests/functional/tests/app/Mage/CatalogRule/Test/Repository/CatalogRule.xml (revision )
@@ -33,7 +33,9 @@
<field name="description" xsi:type="string">-50% of price, Priority = 0</field>
<field name="is_active" xsi:type="string">Active</field>
@piotrekkaminski
piotrekkaminski / PATCH_SUPEE-4814_EE_1.14.1.0_v1.sh
Created April 17, 2015 14:36
PATCH_SUPEE-4814_EE_1.14.1.0_v1.sh
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
### Keybase proof
I hereby claim:
* I am piotrekkaminski on github.
* I am piotrekkaminski (https://keybase.io/piotrekkaminski) on keybase.
* I have a public key whose fingerprint is 5C18 197D 1390 24D9 8973 0F57 6968 AA3A 830C 1DB3
To claim this, I am signing this object:
@piotrekkaminski
piotrekkaminski / gist:14f49b6ddcb69640d697
Created April 6, 2015 21:41
MPERF-7015: Session Cookies not stored for shop on root (2nd level) domain
diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php
index 4d2bf60..c580932 100644
--- a/app/code/core/Mage/Core/Model/Session/Abstract.php
+++ b/app/code/core/Mage/Core/Model/Session/Abstract.php
@@ -566,14 +566,24 @@ public function renewSession()
{
$this->getCookie()->delete($this->getSessionName());
$this->regenerateSessionId();
+ $this->_deleteCookiesForSameParentDomain();
Index: downloader/lib/Mage/HTTP/Client/Curl.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- downloader/lib/Mage/HTTP/Client/Curl.php (revision 70e08f1032574126d01d9c7022d9bdafa1c27303)
+++ downloader/lib/Mage/HTTP/Client/Curl.php (revision )
@@ -374,7 +374,7 @@
$this->_ch = curl_init();
$this->curlOption(CURLOPT_URL, $uriModified);
Index: downloader/lib/Mage/HTTP/Client/Curl.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- downloader/lib/Mage/HTTP/Client/Curl.php (revision 775b8b8d41a4079655efb9e64fc869baf44646e5)
+++ downloader/lib/Mage/HTTP/Client/Curl.php (revision )
@@ -379,7 +379,7 @@
$this->curlOption(CURLOPT_URL, $uri);
@piotrekkaminski
piotrekkaminski / gist:8315e60a5ac3650f10d3
Created February 26, 2015 18:48
Popular Magento 1 dev tools
Commerce Bug http://store.pulsestorm.net/products/commerce-bug-2
Magicento http://magicento.com/
n98-magerun https://github.com/netz98/n98-magerun
Modman https://github.com/colinmollenhour/modman
AOE_Profiler https://github.com/AOEpeople/Aoe_Profiler
@piotrekkaminski
piotrekkaminski / swatchesfallback.patch
Last active August 29, 2015 14:09
[PATCH] Fixed issue where language fallback swatch images would not be loaded from media/wysiwyg/swatches
diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php
index 2de62ed..c284811 100644
--- a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php
+++ b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php
@@ -227,6 +227,8 @@ class Mage_ConfigurableSwatches_Helper_Productimg extends Mage_Core_Helper_Abstr
$fileExt = self::SWATCH_FILE_EXT;
}
+ // normalize to all lower case so that value can be used as array key below
+ $value = Mage_ConfigurableSwatches_Helper_Data::normalizeKey($value);