@@ 102-113 (lines=12) @@ | ||
99 | $this->assertNull($processedSubmission); |
|
100 | } |
|
101 | ||
102 | public function testFilesRemoved() |
|
103 | { |
|
104 | $config = SiteConfig::current_site_config(); |
|
105 | $config->SendDailyEmail = true; |
|
106 | $config->SendMailTo = '[email protected]'; |
|
107 | $config->write(); |
|
108 | $this->job->setup(); |
|
109 | $this->job->process(); |
|
110 | $this->job->afterComplete(); |
|
111 | ||
112 | $this->assertFileNotExists('/tmp/Export of TestForm - 2018-01-01 12:00:00.csv'); |
|
113 | } |
|
114 | ||
115 | public function testNewJobCreated() |
|
116 | { |
|
@@ 153-166 (lines=14) @@ | ||
150 | $this->assertEquals($expected, $emails); |
|
151 | } |
|
152 | ||
153 | public function testCommaSeparatedUsers() |
|
154 | { |
|
155 | $config = SiteConfig::current_site_config(); |
|
156 | $config->SendDailyEmail = true; |
|
157 | $config->SendMailTo = '[email protected], [email protected] , [email protected]'; |
|
158 | $config->write(); |
|
159 | ||
160 | $this->job->setup(); |
|
161 | $this->job->process(); |
|
162 | ||
163 | $this->assertEmailSent('[email protected]'); |
|
164 | $this->assertEmailSent('[email protected]'); |
|
165 | $this->assertEmailSent('[email protected]'); |
|
166 | } |
|
167 | ||
168 | public function testFromAddressSet() |
|
169 | { |
|
@@ 168-179 (lines=12) @@ | ||
165 | $this->assertEmailSent('[email protected]'); |
|
166 | } |
|
167 | ||
168 | public function testFromAddressSet() |
|
169 | { |
|
170 | $config = SiteConfig::current_site_config(); |
|
171 | $config->SendDailyEmail = true; |
|
172 | $config->SendMailTo = '[email protected]'; |
|
173 | $config->SendMailFrom = '[email protected]'; |
|
174 | $config->write(); |
|
175 | ||
176 | $this->job->setup(); |
|
177 | $this->job->process(); |
|
178 | $this->assertEmailSent('[email protected]', '[email protected]'); |
|
179 | } |
|
180 | ||
181 | public function testFromAddressNotSet() |
|
182 | { |
|
@@ 181-191 (lines=11) @@ | ||
178 | $this->assertEmailSent('[email protected]', '[email protected]'); |
|
179 | } |
|
180 | ||
181 | public function testFromAddressNotSet() |
|
182 | { |
|
183 | $config = SiteConfig::current_site_config(); |
|
184 | $config->SendDailyEmail = true; |
|
185 | $config->SendMailTo = '[email protected]'; |
|
186 | $config->write(); |
|
187 | ||
188 | $this->job->setup(); |
|
189 | $this->job->process(); |
|
190 | $this->assertEmailSent('[email protected]', 'site@' . Director::host()); |
|
191 | } |
|
192 | ||
193 | protected function setUp() |
|
194 | { |