Blame view

tests/Fixture/StatsFixture.php 2.71 KB
409758d9   Etienne Pallier   Ajout d'une nouve...
1
2
3
4
5
6
7
8
9
10
<?php
namespace App\Test\Fixture;

use Cake\TestSuite\Fixture\TestFixture;

/**
 * StatsFixture
 */
class StatsFixture extends TestFixture
{
eec4141e   Etienne Pallier   bugfix tests
11
12
13
14
    
    // (EP) pour éviter d'avoir à décrire les champs
    public $import = ['model' => 'Stats'];
    
409758d9   Etienne Pallier   Ajout d'une nouve...
15
16
17
18
19
    /**
     * Fields
     *
     * @var array
     */
eec4141e   Etienne Pallier   bugfix tests
20
21
    
    /* (EP)
409758d9   Etienne Pallier   Ajout d'une nouve...
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    // @codingStandardsIgnoreStart
    public $fields = [
        'year' => ['type' => 'string', 'length' => null, 'null' => false, 'default' => null, 'collate' => null, 'comment' => '', 'precision' => null, 'fixed' => null],
        'user_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null],
        'last_login_time' => ['type' => 'datetime', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null],
        'last_logout_time' => ['type' => 'datetime', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null],
        'connex_nb' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => '0', 'comment' => 'nb connexions sur l\'année', 'precision' => null, 'autoIncrement' => null],
        'connex_dur' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => '0', 'comment' => 'total temps connexion sur l\'année (sec)', 'precision' => null, 'autoIncrement' => null],
        '_indexes' => [
            'fk_stats_users' => ['type' => 'index', 'columns' => ['user_id'], 'length' => []],
            'index_stats_year' => ['type' => 'index', 'columns' => ['year'], 'length' => []],
        ],
        '_constraints' => [
            'primary' => ['type' => 'primary', 'columns' => ['year', 'user_id'], 'length' => []],
            'fk_stats_users' => ['type' => 'foreign', 'columns' => ['user_id'], 'references' => ['users', 'id'], 'update' => 'restrict', 'delete' => 'cascade', 'length' => []],
        ],
        '_options' => [
            'engine' => 'InnoDB',
            'collation' => 'latin1_swedish_ci'
        ],
    ];
eec4141e   Etienne Pallier   bugfix tests
43
44
    */
    
409758d9   Etienne Pallier   Ajout d'une nouve...
45
46
47
48
49
50
51
52
    // @codingStandardsIgnoreEnd
    /**
     * Init method
     *
     * @return void
     */
    public function init()
    {
eec4141e   Etienne Pallier   bugfix tests
53
        // (EP)
bbf540f9   Etienne Pallier   Divers
54
55
        $this->records = null;
        //$this->records = [];
eec4141e   Etienne Pallier   bugfix tests
56
        /*
409758d9   Etienne Pallier   Ajout d'une nouve...
57
58
        $this->records = [
            [
bbf540f9   Etienne Pallier   Divers
59
60
                //'year' => 'a4a821dd-3174-4fa5-9672-b2d5b3d9903c',
                'year' => 2020,
409758d9   Etienne Pallier   Ajout d'une nouve...
61
                'user_id' => 1,
bbf540f9   Etienne Pallier   Divers
62
63
64
65
                //'last_login_time' => '2020-10-21 17:11:18',
                //'last_logout_time' => '2020-10-21 17:11:18',
                //'connex_nb' => 1,
                //'connex_dur' => 1
409758d9   Etienne Pallier   Ajout d'une nouve...
66
67
            ],
        ];
eec4141e   Etienne Pallier   bugfix tests
68
        */
409758d9   Etienne Pallier   Ajout d'une nouve...
69
70
71
        parent::init();
    }
}