public function SmsFrameworkUserActiveHoursServiceTest::testInHoursDifferentDay in SMS Framework 8
Same name and namespace in other branches
- 2.x modules/sms_user/tests/src/Kernel/SmsFrameworkUserActiveHoursServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserActiveHoursServiceTest::testInHoursDifferentDay()
- 2.1.x modules/sms_user/tests/src/Kernel/SmsFrameworkUserActiveHoursServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserActiveHoursServiceTest::testInHoursDifferentDay()
Test if in hours with day not in active hours.
File
- modules/
sms_user/ tests/ src/ Kernel/ SmsFrameworkUserActiveHoursServiceTest.php, line 96
Class
- SmsFrameworkUserActiveHoursServiceTest
- Tests active hours service.
Namespace
Drupal\Tests\sms_user\KernelCode
public function testInHoursDifferentDay() {
$this
->activeHoursStatus(TRUE);
$this
->setActiveHours([
[
'start' => '2016-03-14 monday 9:00',
'end' => '2016-03-14 monday 17:00',
],
]);
$user = $this
->createUser([
'timezone' => 'America/New_York',
]);
$now = '2016-03-13 Sunday 12pm America/New_York';
$this
->assertFalse($this->activeHoursService
->inHours($user, $now));
}