UsersFixture.php 5.26 KB
<?php
namespace App\Test\Fixture;

use Cake\TestSuite\Fixture\TestFixture;

/**
 * UsersFixture
 *
 */
class UsersFixture 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' => true, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null],
        'username' => ['type' => 'string', 'length' => 26, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null],
        'password' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null],
        'email' => ['type' => 'string', 'length' => 45, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null],
        'role' => ['type' => 'string', 'length' => 45, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null],
        'groupes_metier_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
    	'groupe_thematique_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
		'sur_categorie_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
        '_indexes' => [
            'fk_users_groupes_travails1' => ['type' => 'index', 'columns' => ['groupes_metier_id'], 'length' => []],
        	'fk_users_groupe_thematique_id' => ['type' => 'index', 'columns' => ['groupe_thematique_id'], 'length' => []],
			'fk_users_sur_categorie_id' => ['type' => 'index', 'columns' => ['sur_categorie_id'], 'length' => []],
        ],
        '_constraints' => [
            'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
            'login_UNIQUE' => ['type' => 'unique', 'columns' => ['username'], 'length' => []],
            'fk_users_groupes_travails1' => ['type' => 'foreign', 'columns' => ['groupes_metier_id'], 'references' => ['groupes_metiers', 'id'], 'update' => 'noAction', 'delete' => 'noAction', 'length' => []],
        	'fk_users_groupe_thematique_id' => ['type' => 'foreign', 'columns' => ['groupe_thematique_id'], 'references' => ['groupes_thematiques', 'id'], 'update' => 'noAction', 'delete' => 'noAction', 'length' => []],
			'fk_users_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 = [
        
        // Superadmin
        [
            'id' => 1,
            //'nom' => 'test1 test2',
            'nom' => 'user1 SUPER',
            //'username' => 'testa',
            'username' => 'user1_SUPER',
            'password' => '$2y$10$VtYdA8Evkc.K.VpvqmF9wui5hc9ep19f8ukWBeFBIlunXSHPqw.K2',
            //'email' => 'testa@test.fr',
            'email' => 'user1_SUPER@test.fr',
            'role' => 'Super Administrateur',
            'groupes_metier_id' => 1,
            'groupe_thematique_id' => 1
        ],
        
        // Adminplus
		[
    		'id' => 2,
    		//'nom' => 'test3 test4',
    		'nom' => 'user2 ADMINP',
    		//'username' => 'testz',
    		'username' => 'user2_ADMINPLUS',
    		'password' => '$2y$10$VtYdA8Evkc.K.VpvqmF9wui5hc9ep19f8ukWBeFBIlunXSHPqw.K2',
    		'email' => 'testz@test.fr',
    		'role' => 'Administration Plus',
    		'groupes_metier_id' => 1,
    		'groupe_thematique_id' => 1
		],
        
        // Admin
		[
    		'id' => 3,
    		//'nom' => 'test5 test6',
    		'nom' => 'user3 ADMIN',
    		//'username' => 'teste',
    		'username' => 'user3_ADMIN',
    		'password' => '$2y$10$VtYdA8Evkc.K.VpvqmF9wui5hc9ep19f8ukWBeFBIlunXSHPqw.K2',
    		'email' => 'teste@test.fr',
    		'role' => 'Administration',
    		'groupes_metier_id' => 1,
    		'groupe_thematique_id' => 1
		],
        
        // Responsable
		[
    		'id' => 4,
	        //'nom' => 'test7 test8',
	        'nom' => 'user4 RESP',
    		//'username' => 'testr',
    		'username' => 'user4_RESP',
    		'password' => '$2y$10$VtYdA8Evkc.K.VpvqmF9wui5hc9ep19f8ukWBeFBIlunXSHPqw.K2',
    		'email' => 'testr@test.fr',
    		'role' => 'Responsable',
    		'groupes_metier_id' => 1,
    		'groupe_thematique_id' => 1
		],
        
        // User (simple user, authentified, but no priviledge)
		[
    		'id' => 5,
    		//'nom' => 'test9 test0',
    		'nom' => 'user5 USER',
    		//'username' => 'testt',
    		'username' => 'user5_USER',
    		'password' => '$2y$10$VtYdA8Evkc.K.VpvqmF9wui5hc9ep19f8ukWBeFBIlunXSHPqw.K2',
    		'email' => 'testt@test.fr',
    		'role' => 'Utilisateur',
    		'groupes_metier_id' => 1,
    		'groupe_thematique_id' => 1
		],
        
    ];
}