CategoriesFixture.php 1.89 KB
<?php
namespace App\Test\Fixture;

use Cake\TestSuite\Fixture\TestFixture;

/**
 * CategoriesFixture
 *
 */
class CategoriesFixture extends TestFixture
{

    /**
     * Fields
     *
     * @var array
     */
    // @codingStandardsIgnoreStart
    public $fields = [
        'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
        'nom' => ['type' => 'string', 'length' => 45, 'null' => false, 'default' => null, 'comment' => 'obligatoire (et unique)', 'precision' => null, 'fixed' => null],
        'sur_categorie_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
        '_indexes' => [
            'fk_sur_categorie_id' => ['type' => 'index', 'columns' => ['sur_categorie_id'], 'length' => []],
        ],
        '_constraints' => [
            'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
            'nom_UNIQUE' => ['type' => 'unique', 'columns' => ['nom'], 'length' => []],
            'fk_sur_categorie_id' => ['type' => 'foreign', 'columns' => ['sur_categorie_id'], 'references' => ['sur_categories', 'id'], 'update' => 'noAction', 'delete' => 'noAction', 'length' => []],
        ],
        '_options' => [
            'engine' => 'InnoDB',
            'collation' => 'latin1_swedish_ci'
        ],
    ];
    // @codingStandardsIgnoreEnd

    /**
     * Records
     *
     * @var array
     */
    public $records = [
        [
            'id' => 1,
            'nom' => 'Categ1',
            'sur_categorie_id' => 1
        ],
        [
            'id' => 2,
            'nom' => 'Categ2',
            'sur_categorie_id' => 1
        ],
        [
            'id' => 3,
            'nom' => 'Categ3',
            'sur_categorie_id' => 2
        ],
    ];
}