Skip to content

Instantly share code, notes, and snippets.

View piotrekkaminski's full-sized avatar

Piotr Kaminski piotrekkaminski

View GitHub Profile
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);
@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();
### 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 / 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=""
@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>
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 / 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/"
In order to run test on any custom theme first of all you need to update all changed blocks according to new flow. To do this you need
1) create separate theme folder dev/tests/functional/tests/theme/responsive
2) create block that has another behavior then in default theme dev/tests/functional/tests/theme/responsive/Mage/Catalog/Test/Block/Search.php
3) update files autoload in composer.json
"autoload": {
"psr-4": {
"Magento\\": ["lib/Magento/", "vendor/magento/mtf/Magento/", "testsuites/Magento/"],
"Mage\\": ["generated/Mage/", "tests/theme/responsive/Mage/", "tests/app/Mage/"],
"Enterprise\\": ["generated/Community/", "tests/app/Community/"],
FAQ:
We want to run the tests on a custom website. The tests assume main website called Main Website and do not work. Is there a way to provide custom name without changing the tests?
This is an error in the tests. Instead of Main Website it should be main_website and it will select the default website. This patch will be included in next MTF release.
https://gist.github.com/piotrekkaminski/df0b6f570aa410a3c7f6
I get errors in Mage\Adminhtml\Test\TestCase\CreateWebsiteEntityTest. How can I fix it?
diff --git a/app/code/core/Mage/Cms/Block/Block.php b/app/code/core/Mage/Cms/Block/Block.php
index bc81de3..a0dce44 100755
--- a/app/code/core/Mage/Cms/Block/Block.php
+++ b/app/code/core/Mage/Cms/Block/Block.php
@@ -72,4 +72,24 @@ protected function _toHtml()
}
return $html;
}
+
+ /**