Skip to content

Commit 6ae3a88

Browse files
authored
Merge pull request #8111 from cakephp/docs-18959
Add docs for cakephp/cakephp#18959
2 parents 5af9f7e + 49e161a commit 6ae3a88

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

en/appendices/5-3-migration-guide.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ TestSuite
160160
- ``assertRedirectBackToReferer()`` added to assert a successful redirect has been made to the referer URL.
161161
- ``assertFlashMessageContains()`` and ``assertFlashMessageContainsAt()`` were added. These methods enable
162162
substring matching of flash message content.
163+
- ``TestFixture::$tableAlias`` was added. This property lets you define the
164+
table alias that will be used to load an ``ORM\Table`` instance for a fixture.
165+
This improves compatibility for schemas that do not closely follow naming conventions.
163166

164167
Utility
165168
-------

en/development/testing.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,20 @@ in your **tests/Fixture** directory, with the following content::
550550

551551
class ArticlesFixture extends TestFixture
552552
{
553-
// Optional. Set this property to load fixtures to a different test datasource
553+
// Optional. Set this property to load fixtures
554+
// to a different test datasource
554555
public $connection = 'test';
555556

557+
// Optional. Lets you define which table alias is used when
558+
// reflecting schema and inserting rows. Inferred from the
559+
// class name by default. Added in 5.3.0
560+
public $tableAlias = 'Articles';
561+
562+
// Optional. Lets you define the table name for a fixture.
563+
// If defined, this table name will be camelized to create
564+
// $tableAlias.
565+
public $table = 'articles';
566+
556567
public $records = [
557568
[
558569
'title' => 'First Article',

0 commit comments

Comments
 (0)