Code Duplication    Length = 25-25 lines in 4 locations

Tests/Extension/BuiltInFunctionsExtensionTest.php 4 locations

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