ProjetsFixture.php
4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* ProjetsFixture
*/
class ProjetsFixture extends TestFixture
{
/*
* (EP202009)
*
* Pour importer automatiquement la définition de la table projets
* (https://book.cakephp.org/3/en/development/testing.html#importing-table-information)
*
*/
public $import = ['model' => 'Projets'];
/*
* Si on n'utilise pas la variable $import ci-dessus,
* alors il faut définir tous les champs utilisés,
* comme ci-dessous, avec la variable $fields,
* GALÈRE !!!
*
*/
/**
* 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, 'collate' => 'latin1_swedish_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
'description' => ['type' => 'text', 'length' => null, 'null' => true, 'default' => null, 'collate' => 'latin1_swedish_ci', 'comment' => '', 'precision' => null],
'groupes_thematique_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
'chef_science_id' => ['type' => 'string', 'length' => 45, 'null' => true, 'default' => null, 'collate' => 'latin1_swedish_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
'chef_projet_id' => ['type' => 'string', 'length' => 45, 'null' => true, 'default' => null, 'collate' => 'latin1_swedish_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
'date_start' => ['type' => 'date', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null],
'date_stop' => ['type' => 'date', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null],
'_indexes' => [
'fk_projets_groupes_thematique_id' => ['type' => 'index', 'columns' => ['groupes_thematique_id'], 'length' => []],
'fk_projets_chef_science_id' => ['type' => 'index', 'columns' => ['chef_science_id'], 'length' => []],
'fk_projets_chef_projet_id' => ['type' => 'index', 'columns' => ['chef_projet_id'], 'length' => []],
],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
'nom' => ['type' => 'unique', 'columns' => ['nom'], 'length' => []],
'fk_projets_groupes_thematique_id' => ['type' => 'foreign', 'columns' => ['groupes_thematique_id'], 'references' => ['groupes_thematiques', 'id'], 'update' => 'restrict', 'delete' => 'setNull', 'length' => []],
//'fk_projets_chef_projet_id' => ['type' => 'foreign', 'columns' => ['chef_projet_id'], 'references' => ['users', 'username'], 'update' => 'restrict', 'delete' => 'noAction', 'length' => []],
'fk_projets_chef_projet_id' => ['type' => 'foreign', 'columns' => ['chef_projet_id'], 'references' => ['users', 'id'], 'update' => 'restrict', 'delete' => 'noAction', 'length' => []],
//'fk_projets_chef_science_id' => ['type' => 'foreign', 'columns' => ['chef_science_id'], 'references' => ['users', 'username'], 'update' => 'restrict', 'delete' => 'noAction', 'length' => []],
'fk_projets_chef_science_id' => ['type' => 'foreign', 'columns' => ['chef_science_id'], 'references' => ['users', 'id'], 'update' => 'restrict', 'delete' => 'noAction', 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'latin1_swedish_ci'
],
];
// @codingStandardsIgnoreEnd
*/
/**
* Init method
*
* @return void
*/
public function init()
{
$this->records = [
[
'id' => 1,
'nom' => 'Lorem ipsum dolor sit amet',
'description' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
'groupes_thematique_id' => 1,
'chef_science_id' => 1,
'chef_projet_id' => 1,
'date_start' => '2020-09-08',
'date_stop' => '2020-09-08'
],
];
parent::init();
}
}