Magento 2 Experten — Hyvä Theme, Tailwind CSS & SEO aus einer Hand ›

Block 11 Summary: Testing

Block 11 Summary: Testing

~14 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026

Block 11 is COMPLETE, the SHORTEST block of this course. BOTH the API AND the frontend NOW have an AUTOMATED safety-net layer.

What block 11 covered

  • Chapter 93: ApiTestCase, assertJsonContains, JSON schema validation.
  • Chapter 94: generating a test user and JWT token programmatically, testing the voter automatically.
  • Chapter 95: Vitest and React Testing Library, userEvent.
  • Chapter 96: Mock Service Worker, server.use() for error cases.

This course's complete test pyramid

Test levelPurpose
PHPUnit integration tests (chapters 93-94)Check the API AGAINST a REAL (test) database, FULL Symfony kernel
React component tests (chapters 95-96)Check UI behavior IN ISOLATION, with a MOCKED API via MSW

DELIBERATELY NO real end-to-end tests (Playwright/Cypress, known from the SEPARATE testing courses) – for THIS course, the TWO levels shown are ENOUGH to convey the PRINCIPLE, WITHOUT BLOWING UP the scope.

Apply it yourself: testing the TaskVoter

If the chapter 56 exercise (TaskVoter) was completed: write ONE ApiTestCase test FOLLOWING the pattern from chapter 94, that checks THAT A user WITHOUT owner rights on the RELATED project is NOT allowed to edit a task.

What's coming in block 12

Block 12 (chapters 98-100, the LAST block) brings aufgaben-manager-api and aufgaben-manager-web to a PRODUCTION-READY deployment – environment variables for PRODUCTION instead of development, a build process for React, and a FINAL look back over ALL 100 chapters.

Tipp: Running bin/phpunit (API) AND npm run test (React) BEFORE EVERY commit is a GOOD habit – block 12 shows HOW BOTH commands can be integrated into a CI pipeline, SO this happens GUARANTEED even WITHOUT manual discipline.