Automated testing with CakePHP
summary
Shows CakePHP 4.3 test tooling: migrations replace schema-in-fixtures so tests reuse app migrations; fixtures run inside transactions to avoid persistent truncation; dynamic data comes from faker-backed fixture-factories or simple factory traits. Demonstrates the DI container with service providers for lazy wiring, injecting mocked services or HTTP-response mocks for deterministic tests. Adds Panther browser automation using a shared sqlite test URL, page objects and data-test-id selectors for stable UI tests; demos mostly work after minor setup hiccups.
AI-written summary · about
chapters (14)
- 0:00Introduction to testing
- 2:13Setting up database migrations
- 3:39Upgrading to CakePHP 4.3
- 4:25New fixture system in 4.3
- 14:09Transaction-based tests
- 23:03Dynamic fixtures with factories
- 29:43Model validation testing
- 48:12Dependency injection container
- 1:08:15Mocking services and network requests
- 1:29:53Logging and configuration
- 1:30:14Browser automation with Panther
- 2:07:38Page objects and refactoring
- 2:16:26CI setup and caching tricks
- 2:23:27Test suites and closing remarks
