File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,6 +101,12 @@ Datasource
101101 This allows you to create dynamic validation messages based on the entity
102102 state and validation rule options.
103103
104+ Error
105+ -----
106+
107+ - Custom exceptions can have specific error handling logic defined in
108+ ``ErrorController ``.
109+
104110ORM
105111---
106112
112118 used to hydrate junction table records.
113119- ``Table::findOrCreate() `` now accepts an array as second argument to directly pass data in.
114120
121+ TestSuite
122+ ---------
123+
124+ - ``TestFixture::$strictFields `` was added. Enabling this property will make
125+ fixtures raise an error if a fixture's record list contains fields that do not
126+ exist in the schema.
127+
115128View
116129----
117130
122135- ``FormHelper `` now uses the ``containerClass `` template to apply a class to
123136 the form control div. The default value is ``input ``.
124137
125- Error
126- -----
127-
128- - Custom exceptions can have specific error handling logic defined in
129- ``ErrorController ``.
Original file line number Diff line number Diff line change @@ -629,6 +629,28 @@ should be an associative array of the columns and values for the row. Just keep
629629in mind that each record in the ``$records `` array must have the same keys as
630630rows are bulk inserted.
631631
632+ As you evolve your schema your fixture records may accumulate unused or
633+ unsupported fields. You can enable ``strictFields `` on a fixture to have errors
634+ raised when a record contains fields that are not defined in the schema::
635+
636+ namespace App\Test\Fixture;
637+
638+ use Cake\TestSuite\Fixture\TestFixture;
639+
640+ class ArticlesFixture extends TestFixture
641+ {
642+ protected $strictFields = true;
643+
644+ // rest of fixture
645+ }
646+
647+ The ``strictFields `` mode can be useful in catching typos or when you want to
648+ enforce stricter maintenance of test data.
649+
650+ .. versionadded :: 5.2.0
651+ ``TestFixture::$strictFields `` was added.
652+
653+
632654Dynamic Data
633655------------
634656
You can’t perform that action at this time.
0 commit comments