IFTTTparseTime   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_parseTimeIntoTimestamp() 0 8 1
1
<?php
2
3
namespace dokuwiki\plugin\swarmwebhook\test;
4
5
/**
6
 * General tests for the swarmwebhook plugin
7
 *
8
 * @group plugin_swarmwebhook
9
 * @group plugins
10
 */
11
class IFTTTparseTime extends \DokuWikiTest
12
{
13
    /** @var array alway enable the needed plugins */
14
    protected $pluginsEnabled = ['swarmwebhook'];
15
16
    public function test_parseTimeIntoTimestamp()
17
    {
18
        $IFTTT = new mock\IFTTT();
19
20
        $actualDateTime = $IFTTT->parseTimeIntoDateTime('May 24, 2018 at 06:02PM', '1527178045');
21
22
        $this->assertEquals('2018-05-24', $actualDateTime->format('Y-m-d'));
23
        $this->assertEquals('2018-05-24T18:02:00+02:00', $actualDateTime->format(\DateTime::ATOM));
24
    }
25
}