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