summaryrefslogtreecommitdiff
path: root/scripts/create-sample-burndown.php
blob: ae0b262712817a047176adc78f7bdb0a9dd6623c (plain)
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
#!/usr/bin/env php
<?php

require __DIR__.'/../app/common.php';

use Model\ProjectDailySummary;
use Model\TaskCreation;
use Model\TaskStatus;

$pds = new ProjectDailySummary($container);
$taskCreation = new TaskCreation($container);
$taskStatus = new TaskStatus($container);

for ($i = 1; $i <= 15; $i++) {

    $task = array(
        'title' => 'Task #'.$i,
        'project_id' => 1,
        'column_id' => rand(1, 4),
        'score' => rand(1, 21)
    );

    $taskCreation->create($task);
}

$pds->updateTotals(1, date('Y-m-d', strtotime('-7 days')));

$taskStatus->close(1);
$pds->updateTotals(1, date('Y-m-d', strtotime('-6 days')));

$taskStatus->close(2);
$taskStatus->close(3);
$pds->updateTotals(1, date('Y-m-d', strtotime('-5 days')));

$taskStatus->close(4);
$pds->updateTotals(1, date('Y-m-d', strtotime('-4 days')));

$taskStatus->close(5);
$pds->updateTotals(1, date('Y-m-d', strtotime('-3 days')));

$taskStatus->close(6);
$taskStatus->close(7);
$taskStatus->close(8);
$pds->updateTotals(1, date('Y-m-d', strtotime('-2 days')));

$taskStatus->close(9);
$taskStatus->close(10);
$pds->updateTotals(1, date('Y-m-d', strtotime('-2 days')));

$taskStatus->close(12);
$taskStatus->close(13);
$pds->updateTotals(1, date('Y-m-d', strtotime('-1 days')));

$taskStatus->close(1);
$pds->updateTotals(1, date('Y-m-d'));