|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @namespace Asm\Test |
|
4
|
|
|
*/ |
|
5
|
|
|
namespace Asm\Test; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Class TestData |
|
9
|
|
|
* |
|
10
|
|
|
* @package Asm\Test |
|
11
|
|
|
* @author Marc Aschmann <[email protected]> |
|
12
|
|
|
*/ |
|
13
|
|
|
class TestData |
|
14
|
|
|
{ |
|
15
|
|
|
public static function getYamlImportFile() |
|
16
|
|
|
{ |
|
17
|
|
|
return <<<EOT |
|
18
|
|
|
--- |
|
19
|
|
|
testkey_5: |
|
20
|
|
|
default: yaddayadda |
|
21
|
|
|
my_test: is testing hard |
|
22
|
|
|
EOT; |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* provide yaml schema testdata |
|
27
|
|
|
* |
|
28
|
|
|
* @return string |
|
29
|
|
|
*/ |
|
30
|
|
|
public static function getYamlConfigFile() |
|
31
|
|
|
{ |
|
32
|
|
|
return <<<EOT |
|
33
|
|
|
--- |
|
34
|
|
|
default: |
|
35
|
|
|
testkey_4: 'default test' |
|
36
|
|
|
prod: |
|
37
|
|
|
testkey_1: 'testvalue' |
|
38
|
|
|
testkey_2: |
|
39
|
|
|
- dummy1 |
|
40
|
|
|
- dummy2 |
|
41
|
|
|
- dummy3 |
|
42
|
|
|
testkey_3: |
|
43
|
|
|
subkey_1: subvalue1 |
|
44
|
|
|
subkey_2: 123 |
|
45
|
|
|
subkey_3: ~ |
|
46
|
|
|
|
|
47
|
|
|
stage: [] |
|
48
|
|
|
test: [] |
|
49
|
|
|
dev: |
|
50
|
|
|
testkey_2: |
|
51
|
|
|
- 25 |
|
52
|
|
|
- 69 |
|
53
|
|
|
EOT; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* provide yaml schema testdata |
|
58
|
|
|
* |
|
59
|
|
|
* @return string |
|
60
|
|
|
*/ |
|
61
|
|
|
public static function getYamlImportConfigFile() |
|
62
|
|
|
{ |
|
63
|
|
|
return <<<EOT |
|
64
|
|
|
--- |
|
65
|
|
|
imports: |
|
66
|
|
|
- { resource: 'vfs://configs/testimport.yml' } |
|
67
|
|
|
default: |
|
68
|
|
|
testkey_4: 'default test' |
|
69
|
|
|
prod: |
|
70
|
|
|
testkey_1: 'testvalue' |
|
71
|
|
|
testkey_2: |
|
72
|
|
|
- dummy1 |
|
73
|
|
|
- dummy2 |
|
74
|
|
|
- dummy3 |
|
75
|
|
|
testkey_3: |
|
76
|
|
|
subkey_1: subvalue1 |
|
77
|
|
|
subkey_2: 123 |
|
78
|
|
|
subkey_3: ~ |
|
79
|
|
|
|
|
80
|
|
|
stage: [] |
|
81
|
|
|
test: [] |
|
82
|
|
|
dev: |
|
83
|
|
|
testkey_2: |
|
84
|
|
|
- 25 |
|
85
|
|
|
- 69 |
|
86
|
|
|
EOT; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* testdata/default config for german holiday-based timers |
|
91
|
|
|
* |
|
92
|
|
|
* @return string |
|
93
|
|
|
*/ |
|
94
|
|
|
public static function getYamlTimerConfigFile() |
|
95
|
|
|
{ |
|
96
|
|
|
$today = new \DateTime(); |
|
97
|
|
|
$tomorrow = new \DateTime('tomorrow'); |
|
98
|
|
|
|
|
99
|
|
|
return <<<EOT |
|
100
|
|
|
--- |
|
101
|
|
|
timers: |
|
102
|
|
|
example_timer_config_1: |
|
103
|
|
|
interval: |
|
104
|
|
|
- [ "2013-02-06" ] # 00:00:00 - 23:59:59 |
|
105
|
|
|
- [ "{$today->format('Y-m-d H:i:s')}", "{$tomorrow->format('Y-m-d H:i:s')}" ] |
|
106
|
|
|
|
|
107
|
|
|
example_timer_config_2: |
|
108
|
|
|
interval: |
|
109
|
|
|
- [ "2013-02-28" ] # only works for this day, 00:00:00 - 23:59:59 |
|
110
|
|
|
- [ "2013-04-24" ] |
|
111
|
|
|
|
|
112
|
|
|
example_timer_config_3: |
|
113
|
|
|
day: [ monday, tuesday, wednesday, thursday ] # works weekdays 00:00:00 - 23:59:59 |
|
114
|
|
|
|
|
115
|
|
|
example_timer_config_3.1: |
|
116
|
|
|
day: [ monday, tuesday, wednesday, thursday, friday, saturday, sunday ] |
|
117
|
|
|
|
|
118
|
|
|
example_timer_config_4: |
|
119
|
|
|
day: [ monday ] # works only mondays |
|
120
|
|
|
time: |
|
121
|
|
|
- [ "01:05:00", "17:00:00" ] # from 01:05:00 to 17:00:00 |
|
122
|
|
|
|
|
123
|
|
|
example_timer_config_4.1: |
|
124
|
|
|
day: [ monday, tuesday, wednesday, thursday, friday, saturday, sunday ] |
|
125
|
|
|
time: |
|
126
|
|
|
- [ "01:05:00", "17:00:00" ] # from 01:05:00 to 17:00:00 |
|
127
|
|
|
|
|
128
|
|
|
example_timer_config_5: |
|
129
|
|
|
time: |
|
130
|
|
|
- [ "01:05:00", "17:00:00" ] # from 01:05:00 to 17:00:00 |
|
131
|
|
|
|
|
132
|
|
|
example_timer_config_6: |
|
133
|
|
|
holiday: |
|
134
|
|
|
use_gerneral: true # if false, uses separate holidays conf |
|
135
|
|
|
additional: [ sub, 1 ] # add or subract n days to holiday to create range |
|
136
|
|
|
|
|
137
|
|
|
example_timer_config_7: |
|
138
|
|
|
holiday: |
|
139
|
|
|
use_gerneral: true # if false, uses separate holidays conf |
|
140
|
|
|
additional: [ sub, 1 ] # add or subract n days to holiday to create range |
|
141
|
|
|
interval: [ "16:00:00", "16:00:00" ] # start and end time |
|
142
|
|
|
|
|
143
|
|
|
example_timer_config_7.1: |
|
144
|
|
|
holiday: |
|
145
|
|
|
use_gerneral: true |
|
146
|
|
|
additional: [ add, 1 ] |
|
147
|
|
|
interval: [ "16:00:00", "16:00:00" ] # start and end time |
|
148
|
|
|
|
|
149
|
|
|
general_shipping_promise: |
|
150
|
|
|
holiday: |
|
151
|
|
|
use_general: true |
|
152
|
|
|
additional: [ sub, 1 ] # add or subract n days to holiday to create range |
|
153
|
|
|
interval: [ "16:00:00", "16:00:00" ] # start and end time |
|
154
|
|
|
day: [ monday, tuesday, wednesday, thursday, friday, sunday ] |
|
155
|
|
|
|
|
156
|
|
|
shipping_promise_sunday: |
|
157
|
|
|
day: [ sunday ] # works only sundays |
|
158
|
|
|
time: |
|
159
|
|
|
- [ "00:00:01", "16:00:00" ] # from 00:00:01 to 16:00:00 |
|
160
|
|
|
|
|
161
|
|
|
|
|
162
|
|
|
|
|
163
|
|
|
holidays: |
|
164
|
|
|
- [ "2014-10-29" ] # can be intervals or single dates/DateTime touples |
|
165
|
|
|
|
|
166
|
|
|
general_holidays: # german (baden-wuerttemberg) holidays |
|
167
|
|
|
- { name: "Neujahr", value: [ "01", "01" ], type: fix } |
|
168
|
|
|
- { name: "heilige drei Koenige", value: [ "01", "06" ], type: fix } |
|
169
|
|
|
- { name: "Karfreitag", value: [ sub, 2 ], type: var } |
|
170
|
|
|
- { name: "Ostermontag", value: [ add, 1 ], type: var } |
|
171
|
|
|
- { name: "Tag der Arbeit", value: [ "05", "01" ], type: fix } |
|
172
|
|
|
- { name: "Christi Himmelfahrt", value: [ add, 39], type: var } |
|
173
|
|
|
- { name: "Pfingstmontag", value: [ add, 50], type: var } |
|
174
|
|
|
- { name: "Fronleichnam", value: [ add, 60], type: var } |
|
175
|
|
|
- { name: "Tag der deutschen Einheit", value: [ "10", "03" ], type: fix } |
|
176
|
|
|
- { name: "allerheiligen", value: [ "11", "01" ], type: fix } |
|
177
|
|
|
- { name: "Heiligabend", value: [ "12", "24" ], type: fix } |
|
178
|
|
|
- { name: "erster Weihnachtstag", value: [ "12", "25" ], type: fix } |
|
179
|
|
|
- { name: "zweiter Weihnachtstag", value: [ "12", "26" ], type: fix } |
|
180
|
|
|
- { name: "Silvester", value: [ "12", "31" ], type: fix } |
|
181
|
|
|
EOT; |
|
182
|
|
|
|
|
183
|
|
|
} |
|
184
|
|
|
} |
|
185
|
|
|
|