Hyvä Theme is Now Open Source: What This Means for Magento Community - Mageplaza
Hyvä is now Open Source and free. Discover what changed, what remains commercial, how it impacts the Magento ecosystem, and how to maximize its full potential.
Cookies help us enhance your experience on our site by storing information about your preferences and interactions. You can customize your cookie settings by choosing which cookies to allow. Please note that disabling certain cookies might impact the functionality and features of our services, such as personalized content and suggestions. Cookie Policy
Cookie PolicyThese cookies are strictly necessary for the site to work and may not be disabled.
InformationThese cookies are strictly necessary for the site to work and may not be disabled.
| Cookie name | Description | Lifetime | Provider |
|---|---|---|---|
| _ce.clock_data | Store the difference in time from the server's time and the current browser. | 1 day | Crazy Egg |
| _ce.clock_event | Prevent repeated requests to the Clock API. | 1 day | Crazy Egg |
| _ce.irv | Store isReturning value during the session | Session | Crazy Egg |
| _ce.s | Track a recording visitor session unique ID, tracking host and start time | 1 year | Crazy Egg |
| _hjSessionUser_2909345 | Store a unique user identifier to track user sessions and interactions for analytics purposes. | 1 year | HotJar |
| _hjSession_2909345 | Store session data to identify and analyze individual user sessions. | 1 day | HotJar |
| apt.uid | Store a unique user identifier for tracking and personalization. | 1 year | Mageplaza |
| cebs | Store user preferences and settings. | Session | Mageplaza |
| cf_clearance | Store a token that indicates a user has passed a Cloudflare security challenge. | 1 year | Cloudflare |
| crisp-client | The crisp-client/session cookie is used to identify and maintain a user session within the Crisp platform. It allows the live chat system to recognize returning users, maintain chat history, and ensure continuity in customer service interactions. | Session | Crisp |
| _ga | Store a unique client identifier (Client ID) for tracking user interactions on the | 2 years | |
| _ga_7B0PZZW26Z | Store session state information for Google Analytics 4. | 2 years | |
| _ga_JTRV42NV3L | Store session state information for Google Analytics 4. | 2 years | |
| _ga_R3HWQ50MM4 | Store a unique client identifier (Client ID) for tracking user interactions on the website. | 2 years | |
| _gid | Store a unique client identifier (Client ID) for tracking user interactions on the website. | 1 day | |
| _gat_UA-76130628-1 | Throttle the request rate to Google Analytics servers. | 1 day |
Advertising cookies deliver ads relevant to your interests, limit ad frequency, and measure ad effectiveness.
InformationAdvertising cookies deliver ads relevant to your interests, limit ad frequency, and measure ad effectiveness.
| Cookie name | Description | Lifetime | Provider |
|---|---|---|---|
| _gcl_au | The cookie is used by Google to track and store conversions. | 1 day | |
| __Secure-3PAPISID | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 2 years | |
| HSID | This security cookie is used by Google to confirm visitor authenticity, prevent fraudulent use of login data and protect visitor data from unauthorized access. | 2 years | |
| __Secure-1PSID | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 2 years | |
| SID | This security cookie is used by Google to confirm visitor authenticity, prevent fraudulent use of login data and protect visitor data from unauthorized access. | 2 years | |
| APISID | This cookie is used by Google to display personalized advertisements on Google sites, based on recent searches and previous interactions. | 2 years | |
| __Secure-1PAPISID | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 2 years | |
| __Secure-3PSID | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 2 years | |
| SSID | This cookie is used by Google to display personalized advertisements on Google sites, based on recent searches and previous interactions. | 2 years | |
| SAPISID | This cookie is used by Google to display personalized advertisements on Google sites, based on recent searches and previous interactions. | 2 years | |
| __Secure-3PSIDTS | This cookie collects information about visitor's interactions with Google services and ads. It is used to measure advertising effectiveness and deliver personalised content based on interests. The cookie contains a unique identifier. | 2 years | |
| __Secure-1PSIDTS | This cookie collects information about visitor's interactions with Google services and ads. It is used to measure advertising effectiveness and deliver personalised content based on interests. The cookie contains a unique identifier. | 2 years | |
| SIDCC | This security cookie is used by Google to confirm visitor authenticity, prevent fraudulent use of login data, and protect visitor data from unauthorized access. | 3 months | |
| __Secure-1PSIDCC | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 1 year | |
| __Secure-3PSIDCC | This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising. | 1 year | |
| 1P_JAR | This cookie is a Google Analytics Cookie created by Google DoubleClick and used to show personalized advertisements (ads) based on previous visits to the website. | 1 month | |
| NID | Show Google ads in Google services for signed-out users. | 6 months |
Analytics cookies collect information and report website usage statistics without personally identifying individual visitors to Google.
InformationAnalytics cookies collect information and report website usage statistics without personally identifying individual visitors to Google.
| Cookie name | Description | Lifetime | Provider |
|---|---|---|---|
| _dc_gtm | Manage and deploy marketing tags through Google Tag Manager. | 1 year | |
| 1P_JAR | Gather website statistics and track conversion rates for Google AdWords campaigns. | 1 month | |
| AEC | 1 month | ||
| ar_debug | Debugging purposes related to augmented reality (AR) functionalities. | 1 month | Doubleclick |
| IDE | The IDE cookie is used by Google DoubleClick to register and report the user's actions after viewing or clicking on one of the advertiser's ads with the purpose of measuring the effectiveness of an ad and to present targeted ads to the user. | 1 year | Doubleclick |
| ad_storage | Enables storage, such as cookies (web) or device identifiers (apps), related to advertising. | 1 year | |
| ad_user_data | Sets consent for sending user data to Google for online advertising purposes. | 1 year | |
| ad_personalization | Sets consent for personalized advertising. | 1 year | |
| analytics_storage | Enables storage, such as cookies (web) or device identifiers (apps), related to analytics, for example, visit duration. | 1 year |
Vinh Jacker | 03-17-2025
Mageplaza publishes Magento 2 Unit Test article, that belongs to the free knowledge base string for Magento 2 store owners. The topic is helpful for those who are beginners and really want to get familiar with the unit tests. To make the guide clear, we will approach to two different ways including:
Before carrying out the unit tests in Magento 2, let’s glance at the overview of the unit test.
Main contents
Unit Testing is a crucial operation, a set of the smallest testable parts of an application, which are called units, in the development of software. The unit testing will ensure that the codes you wrote are running correctly as well as raise the software’s quality you created before. In addition, remember that the unit testing process is separate and completely automatic without any manual handling.
Magento 2 Unit Test offers numerous benefits which would definitely be worth your effort in creating and running it. However, below I will list three advantages of using a unit test that I think are most noticeable.
First of all, it allows auto-defining some errors before launching the software instead of that the developers have to do it by themselves. These errors including both bugs in the implementation of the programmer and the specification’s flaws or missing parts for the unit. As a result, writing a thorough set of testing process would push authors to think through inputs, outputs as well as the error conditions, which would help define the desired behavior of the unit crisply.
Secondly, it enables you to facilitates changes easily. More specifically, the programmer is allowed to refactor code or upgrade system libraries at a later date, which would ensure the module works perfectly. This purpose of this procedure is to write test cases for all functions and methods, which would help quickly identify the fault when it happens.
Last but not least, writing the unit test can keep you focused and help you create better designs as before writing it, you have to think through your design and the thing that must be accomplished. Besides, when you test a piece of code, you will have to define the thing that this code is responsible for, which would lead to well-defined code’s responsibility as well as high cohesion.
You can assume that you have a custom module called Testing under the Mageplaza namespace (app/code/Mageplaza/Testing). Then your unit tests will reside inside the Test/Unit folder based on the standards of naming.
The Class that is going to be tested would be called SampleClass and it will reside in the TestingClass folder. Therefore, the whole path will be app/code/Mageplaza/Testing/TestingClass/SampleClass
Below are how the class code looks like:
<?php
namespace Mageplaza\Testing\TestingClass;
class SampleClass
{
public function getMessage()
{
return 'Hello, this is sample test';
}
}
?>
You might notice that this class is quite straightforward and it just returns a simple string which is Hello, this is sample test.
When you test getMessage() method the test will look like the following:
<?php
namespace Mageplaza\Testing\Test\Unit;
use Mageplaza\Testing\TestingClass\SampleClass;
class SampleTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Mageplaza\Testing\TestingClass\SampleClass
*/
protected $sampleClass;
/**
* @var string
*/
protected $expectedMessage;
public function setUp()
{
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
$this->sampleClass = $objectManager->getObject('Mageplaza\Testing\TestingClass\SampleClass');
$this->expectedMessage = 'Hello, this is sample test';
}
public function testGetMessage()
{
$this->assertEquals($this->expectedMessage, $this->sampleClass->getMessage());
}
}
You can see that this unit test has tested the getMessage() method output. The test need to be equal to expectedMessage property in the test so it can pass. With these test extends PHPUnit, you would have the ability to gives up assertEquals() method as well as various testing functionalities. Besides, a setUp() method is also available which are run before methods inside of a test is testing. It can help sets up the testing environment in company with all the class or property that you will need in the test.
The unit test plays an essential role in improving your manageability. By allowing auto-defining some errors before launching the software instead of that the developers have to do it by themselves, a great amount of time and effort of admins can be saved as well as considerably eliminating the errors when launching your software.
Don’t forget to share this article with Magento friends to help them out.
Thanks for reading!
Jacker is the Chief Technology Officer (CTO) at Mageplaza, bringing over 10 years of experience in Magento, Shopify, and other eCommerce platforms. With deep technical expertise, he has led numerous successful projects, optimizing and scaling online stores for global brands. Beyond his work in eCommerce development, he is passionate about running and swimming.
Related Post
Hyvä Theme is Now Open Source: What This Means for Magento Community - Mageplaza
Hyvä is now Open Source and free. Discover what changed, what remains commercial, how it impacts the Magento ecosystem, and how to maximize its full potential.
Holiday Marketing Hacks 2025 - How to Boost Sales for Magento 2 Stores? - Mageplaza
Discover the best 2025 holiday marketing strategies for Magento 2. Learn key trends, creative campaign ideas, and expert tips to increase seasonal sales.
Hyvä Theme is Now Open Source: What This Means for Magento Community - Mageplaza
Hyvä is now Open Source and free. Discover what changed, what remains commercial, how it impacts the Magento ecosystem, and how to maximize its full potential.
Holiday Marketing Hacks 2025 - How to Boost Sales for Magento 2 Stores? - Mageplaza
Discover the best 2025 holiday marketing strategies for Magento 2. Learn key trends, creative campaign ideas, and expert tips to increase seasonal sales.