Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* @file
* Tests for FeedsDateTime class.
*/
/**
* Test FeedsDateTime class.
*
* Using DrupalWebTestCase as DrupalUnitTestCase is broken in SimpleTest 2.8.
* Not inheriting from Feeds base class as ParserCSV should be moved out of
* Feeds at some time.
*/
class FeedsDateTimeTest extends DrupalWebTestCase {
protected $profile = 'testing';
/**
* Describe this test.
*/
public function getInfo() {
return array(
'name' => t('FeedsDateTime unit tests'),
'description' => t('Unit tests for Feeds date handling.'),
'group' => t('Feeds'),
);
}
/**
* Set up.
*/
public function setUp() {
parent::setUp('feeds', 'feeds_ui', 'ctools', 'job_scheduler');
}
/**
* Dispatch tests, only use one entry point method testX to save time.
*/
public function test() {
$date = new FeedsDateTime('2010-20-12');
$this->assertTrue(is_numeric($date->format('U')));
$date = new FeedsDateTime('created');
$this->assertTrue(is_numeric($date->format('U')));
$date = new FeedsDateTime('12/3/2009 20:00:10');
$this->assertTrue(is_numeric($date->format('U')));
}
}