Code Duplication    Length = 25-25 lines in 4 locations

Tests/Extension/BuiltInFunctionsExtensionTest.php 4 locations

@@ 43-67 (lines=25) @@
40
        $this->assertSame('2012-06-03T21:52:22+0200', $todayResult, 'The today function result did not produce the expected result with ofset '.$offset);
41
    }
42
43
    public function testStartOfDay()
44
    {
45
        $extension = $this->getExtension();
46
47
        $startOfDayResult = $extension->startOfDay();
48
        $this->assertSame('2012-06-03T00:00:00+0200', $startOfDayResult, 'The startOfDay function result did not produce the expected result');
49
50
        $startOfDayResult = $extension->startOfDay('+2 hours');
51
        $this->assertSame('2012-06-04T00:00:00+0200', $startOfDayResult, 'The startOfDay function result did not produce the expected result');
52
53
        $startOfDayResult = $extension->startOfDay('-5 days');
54
        $this->assertSame('2012-05-29T00:00:00+0200', $startOfDayResult, 'The startOfDay function result did not produce the expected result');
55
56
        $startOfDayResult = $extension->startOfDay('+1 month');
57
        $this->assertSame('2012-07-03T00:00:00+0200', $startOfDayResult, 'The startOfDay function result did not produce the expected result');
58
59
        $startOfDayResult = $extension->startOfDay('15-05-2012');
60
        $this->assertSame('2012-05-15T00:00:00+0200', $startOfDayResult, 'The startOfDay function result did not produce the expected result');
61
62
        $startOfDayResult = $extension->startOfDay('2012-05-15');
63
        $this->assertSame('2012-05-15T00:00:00+0200', $startOfDayResult, 'The startOfDay function result did not produce the expected result');
64
65
        $startOfDayResult = $extension->startOfDay('15.05.2012');
66
        $this->assertSame('2012-05-15T00:00:00+0200', $startOfDayResult, 'The startOfDay function result did not produce the expected result');
67
    }
68
69
    public function testStartOfWeek()
70
    {
@@ 69-93 (lines=25) @@
66
        $this->assertSame('2012-05-15T00:00:00+0200', $startOfDayResult, 'The startOfDay function result did not produce the expected result');
67
    }
68
69
    public function testStartOfWeek()
70
    {
71
        $extension = $this->getExtension();
72
73
        $startOfWeekResult = $extension->startOfWeek();
74
        $this->assertSame('2012-05-28T00:00:00+0200', $startOfWeekResult, 'The startOfWeek function result did not produce the expected result');
75
76
        $startOfWeekResult = $extension->startOfWeek('+2 hours');
77
        $this->assertSame('2012-06-04T00:00:00+0200', $startOfWeekResult, 'The startOfWeek function result did not produce the expected result');
78
79
        $startOfWeekResult = $extension->startOfWeek('-5 days');
80
        $this->assertSame('2012-05-28T00:00:00+0200', $startOfWeekResult, 'The startOfWeek function result did not produce the expected result');
81
82
        $startOfWeekResult = $extension->startOfWeek('+1 month');
83
        $this->assertSame('2012-07-02T00:00:00+0200', $startOfWeekResult, 'The startOfWeek function result did not produce the expected result');
84
85
        $startOfWeekResult = $extension->startOfWeek('15-05-2012');
86
        $this->assertSame('2012-05-14T00:00:00+0200', $startOfWeekResult, 'The startOfWeek function result did not produce the expected result');
87
88
        $startOfWeekResult = $extension->startOfWeek('2012-05-15');
89
        $this->assertSame('2012-05-14T00:00:00+0200', $startOfWeekResult, 'The startOfWeek function result did not produce the expected result');
90
91
        $startOfWeekResult = $extension->startOfWeek('15.05.2012');
92
        $this->assertSame('2012-05-14T00:00:00+0200', $startOfWeekResult, 'The startOfWeek function result did not produce the expected result');
93
    }
94
95
    public function testStartOfMonth()
96
    {
@@ 95-119 (lines=25) @@
92
        $this->assertSame('2012-05-14T00:00:00+0200', $startOfWeekResult, 'The startOfWeek function result did not produce the expected result');
93
    }
94
95
    public function testStartOfMonth()
96
    {
97
        $extension = $this->getExtension();
98
99
        $startOfMonthResult = $extension->startOfMonth();
100
        $this->assertSame('2012-06-01T00:00:00+0200', $startOfMonthResult, 'The startOfMonth function result did not produce the expected result');
101
102
        $startOfMonthResult = $extension->startOfMonth('+2 hours');
103
        $this->assertSame('2012-06-01T00:00:00+0200', $startOfMonthResult, 'The startOfMonth function result did not produce the expected result');
104
105
        $startOfMonthResult = $extension->startOfMonth('-5 days');
106
        $this->assertSame('2012-05-01T00:00:00+0200', $startOfMonthResult, 'The startOfMonth function result did not produce the expected result');
107
108
        $startOfMonthResult = $extension->startOfMonth('+1 month');
109
        $this->assertSame('2012-07-01T00:00:00+0200', $startOfMonthResult, 'The startOfMonth function result did not produce the expected result');
110
111
        $startOfMonthResult = $extension->startOfMonth('15-05-2012');
112
        $this->assertSame('2012-05-01T00:00:00+0200', $startOfMonthResult, 'The startOfMonth function result did not produce the expected result');
113
114
        $startOfMonthResult = $extension->startOfMonth('2012-05-15');
115
        $this->assertSame('2012-05-01T00:00:00+0200', $startOfMonthResult, 'The startOfMonth function result did not produce the expected result');
116
117
        $startOfMonthResult = $extension->startOfMonth('15.05.2012');
118
        $this->assertSame('2012-05-01T00:00:00+0200', $startOfMonthResult, 'The startOfMonth function result did not produce the expected result');
119
    }
120
121
    public function testStartOfYear()
122
    {
@@ 121-145 (lines=25) @@
118
        $this->assertSame('2012-05-01T00:00:00+0200', $startOfMonthResult, 'The startOfMonth function result did not produce the expected result');
119
    }
120
121
    public function testStartOfYear()
122
    {
123
        $extension = $this->getExtension();
124
125
        $startOfYearResult = $extension->startOfYear();
126
        $this->assertSame('2012-01-01T00:00:00+0200', $startOfYearResult, 'The startOfYear function result did not produce the expected result');
127
128
        $startOfYearResult = $extension->startOfYear('+2 hours');
129
        $this->assertSame('2012-01-01T00:00:00+0200', $startOfYearResult, 'The startOfYear function result did not produce the expected result');
130
131
        $startOfYearResult = $extension->startOfYear('-5 days');
132
        $this->assertSame('2012-01-01T00:00:00+0200', $startOfYearResult, 'The startOfYear function result did not produce the expected result');
133
134
        $startOfYearResult = $extension->startOfYear('+1 month');
135
        $this->assertSame('2012-01-01T00:00:00+0200', $startOfYearResult, 'The startOfYear function result did not produce the expected result');
136
137
        $startOfYearResult = $extension->startOfYear('15-05-2012');
138
        $this->assertSame('2012-01-01T00:00:00+0200', $startOfYearResult, 'The startOfYear function result did not produce the expected result');
139
140
        $startOfYearResult = $extension->startOfYear('2012-05-15');
141
        $this->assertSame('2012-01-01T00:00:00+0200', $startOfYearResult, 'The startOfYear function result did not produce the expected result');
142
143
        $startOfYearResult = $extension->startOfYear('15.05.2012');
144
        $this->assertSame('2012-01-01T00:00:00+0200', $startOfYearResult, 'The startOfYear function result did not produce the expected result');
145
    }
146
147
    public function testCurrentUser()
148
    {