Archive: 2025-02 | Page 14
Archive: February 2025
-
Feb 10, 2025
Mocking everything a class touches, indiscriminately, produces unit tests that break on every refactor even though the application's behavior never changed. Gerard Meszaros' taxonomy distinguishes dummy, stub, fake, spy and mock as five clearly separated roles, each with a different purpose, a different verification logic and a different degree of coupling to implementation details. This article walks through the theory behind every test double using hand-written PHP implementations, independent of any particular testing framework.
-
Feb 9, 2025
An open port does not mean an application is truly ready. Docker Healthchecks give containers a voice of their own: they report when a service can actually process requests, when it is degraded, and when a restart is needed. Without this mechanism, container orchestration stays blind.
-
Feb 9, 2025
Requisition Lists are the B2B tool for repeat customers who regularly order the same line items, with their own data model, their own API, and a clear functional distinction from wishlists. Building a custom frontend integration means knowing how the data model is structured, which API operations are available, and where the default feature reaches its limits.
-
Feb 9, 2025
Duplicated test data in every setUp, magic arrays in DataProviders, and hardcoded IDs scattered across hundreds of test classes. These are the typical signs of a test suite without a clear data organization strategy. The Builder pattern, fixture classes and factory methods bring order without overengineering.
-
Feb 9, 2025
Anyone who still ships product images and CMS assets only as JPEG or PNG is giving away load time and Core Web Vitals points on every page view. An automated WebP conversion in the build and deploy process generates a much smaller WebP variant for every image, serves it through the picture element with a clean fallback, and integrates fully into an existing Hyvä deploy sequence without ever putting the storefront at risk if a conversion fails.
-
Feb 9, 2025
Anyone using Elasticsearch only for full text search is leaving most of its analytical power on the table. Bucket aggregations group documents by field values, value ranges or time intervals, while metric aggregations compute concrete numbers such as average, sum or minimum from those groups. Only when both aggregation types work together do you get the dashboards, facets and reports that separate a production search application from a simple keyword search.
-
Feb 9, 2025
For a simple autocomplete on brand or category names, a full-fledged completion suggester with its own suggest index and dedicated mapping is often overkill. The terms enum API offers a considerably lighter alternative: it reads the unique values already present in a field's term index directly and returns prefix matches, without running a complete search request with scoring, relevance calculation, or document retrieval. That makes it well suited for fast suggestion lists on low-cardinality keyword fields such as brand or category names. How the terms enum API works technically, how it differs from the completion suggester, and how a practical brand autocomplete can be built on top of it is what this article covers.
-
Feb 8, 2025
Named volumes are the standard way to keep persistent data out of containers, yet without a solid backup strategy they remain a blind spot in operations. Snapshot containers, tar archives and deduplicating tools like restic protect volumes consistently, efficiently and traceably, with retention policies and regular restore tests instead of unverified trust.
-
Feb 8, 2025
An entrypoint script with arrays and process substitution runs fine locally and fails inside an Alpine container with exec format error. The reason is BusyBox ash, which serves as /bin/sh in the default Alpine image instead of Bash and offers only a fraction of the familiar feature set.
-
Feb 8, 2025
PHP-FPM processes every request in its own synchronous worker process, which only becomes available for the next request once the current one has fully completed. Blocking Redis commands such as BLPOP, BRPOP, or XREAD BLOCK actively wait for an event before returning, which fundamentally clashes with this model: a single such call inside a Magento controller or plugin can tie up an entire PHP-FPM worker for seconds or even minutes, while other visitors wait for a free worker. This article shows why these commands are problematic in web processes, where they tend to end up by accident in practice, and which alternatives for event-driven flows actually work within a synchronous PHP architecture.