diff --git a/en/appendices/5-3-migration-guide.rst b/en/appendices/5-3-migration-guide.rst index 8598a8039b..e4d393f24a 100644 --- a/en/appendices/5-3-migration-guide.rst +++ b/en/appendices/5-3-migration-guide.rst @@ -160,6 +160,9 @@ TestSuite - ``assertRedirectBackToReferer()`` added to assert a successful redirect has been made to the referer URL. - ``assertFlashMessageContains()`` and ``assertFlashMessageContainsAt()`` were added. These methods enable substring matching of flash message content. +- ``TestFixture::$tableAlias`` was added. This property lets you define the + table alias that will be used to load an ``ORM\Table`` instance for a fixture. + This improves compatibility for schemas that do not closely follow naming conventions. Utility ------- diff --git a/en/development/testing.rst b/en/development/testing.rst index 50f255f4f0..5a76064ed2 100644 --- a/en/development/testing.rst +++ b/en/development/testing.rst @@ -550,9 +550,20 @@ in your **tests/Fixture** directory, with the following content:: class ArticlesFixture extends TestFixture { - // Optional. Set this property to load fixtures to a different test datasource + // Optional. Set this property to load fixtures + // to a different test datasource public $connection = 'test'; + // Optional. Lets you define which table alias is used when + // reflecting schema and inserting rows. Inferred from the + // class name by default. Added in 5.3.0 + public $tableAlias = 'Articles'; + + // Optional. Lets you define the table name for a fixture. + // If defined, this table name will be camelized to create + // $tableAlias. + public $table = 'articles'; + public $records = [ [ 'title' => 'First Article',