aircargobook / cakephp-fixture-importer
CakePHP3 FixtureImporter plugin
Package info
github.com/aircargobook/cakephp-fixture-importer
Type:cakephp-plugin
pkg:composer/aircargobook/cakephp-fixture-importer
1.0.3
2020-08-06 17:37 UTC
Requires
- cakephp/cakephp: ~4.0
This package is auto-updated.
Last update: 2026-03-07 09:23:46 UTC
README
CakePHP Plugin that extends the capability of a Fixture to load not only structure but already.
installation
composer require aircargobook/cakephp-fixture-importer
usage
Load the Trait into your existing fixture.
<?php
namespace App\Test\Fixture;
use Aircargobook\CakephpFixtureImporter\Traits\FixtureImportTrait;
use Cake\TestSuite\Fixture\TestFixture;
class ExampleFixture extends TestFixture
{
/** @var array Set this property to load fixtures to a different test datasource */
public $import = ['table' => 'example', 'connection' => 'test_fixtures'];
/**
* @return void
*/
public function init()
{
parent::init();
$this->insertDataFromSourceTable();
}
}
It will now load the table structure from the test_fixture connection and insert data from the test_fixture connection into the connection test.