@@ -30,11 +30,33 @@ public function testTitle()
30
30
public function testCreatedDate ()
31
31
{
32
32
$ trial = new Trial ();
33
- $ trial ->created_date = date ('Y-m-d ' , strtotime ('2012-12-21 ' ));
34
- $ this ->assertEquals ($ trial ->getCreatedDateForDisplay (), '21 Dec 2012 ' );
33
+ $ trial ->started_date = date ('Y-m-d ' , strtotime ('2012-12-21 ' ));
34
+ $ this ->assertEquals ($ trial ->getStartedDateForDisplay (), '21 Dec 2012 ' );
35
35
36
- $ trial ->created_date = date ('Y-m-d ' , strtotime ('1970-1-1 ' ));
37
- $ this ->assertEquals ($ trial ->getCreatedDateForDisplay (), '1 Jan 1970 ' );
36
+ $ trial ->started_date = date ('Y-m-d ' , strtotime ('1970-1-1 ' ));
37
+ $ this ->assertEquals ($ trial ->getStartedDateForDisplay (), '1 Jan 1970 ' );
38
+
39
+ $ trial ->started_date = null ;
40
+ $ this ->assertEquals ($ trial ->getStartedDateForDisplay (), 'Pending ' );
41
+ }
42
+
43
+ public function testClosedDate ()
44
+ {
45
+ $ trial = new Trial ();
46
+ $ trial ->started_date = date ('Y-m-d ' , strtotime ('1970-01-01 ' ));
47
+ $ trial ->closed_date = date ('Y-m-d ' , strtotime ('2012-12-21 ' ));
48
+ $ this ->assertEquals ($ trial ->getClosedDateForDisplay (), '21 Dec 2012 ' );
49
+
50
+ $ trial ->closed_date = date ('Y-m-d ' , strtotime ('1970-1-1 ' ));
51
+ $ this ->assertEquals ($ trial ->getClosedDateForDisplay (), '1 Jan 1970 ' );
52
+
53
+ $ trial ->started_date = null ;
54
+ $ trial ->closed_date = null ;
55
+ $ this ->assertNull ($ trial ->getClosedDateForDisplay ());
56
+
57
+ $ trial ->started_date = date ('Y-m-d ' , strtotime ('1970-01-01 ' ));
58
+ $ trial ->closed_date = null ;
59
+ $ this ->assertEquals ($ trial ->getClosedDateForDisplay (), 'present ' );
38
60
}
39
61
40
62
public function testDataProvidersExist ()
0 commit comments