File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -41,4 +41,22 @@ public function testConstructDefault()
41
41
$ this ->assertEquals ($ date , $ oTrackChange ->getDate ());
42
42
$ this ->assertEquals (TrackChange::INSERTED , $ oTrackChange ->getChangeType ());
43
43
}
44
+
45
+ /**
46
+ * New instance with invalid \DateTime (produced by \DateTime::createFromFormat(...))
47
+ */
48
+ public function testConstructDefaultWithInvalidDate ()
49
+ {
50
+ $ author = 'Test User ' ;
51
+ $ date = false ;
52
+ $ oTrackChange = new TrackChange (TrackChange::INSERTED , $ author , $ date );
53
+
54
+ $ oText = new Text ('dummy text ' );
55
+ $ oText ->setTrackChange ($ oTrackChange );
56
+
57
+ $ this ->assertInstanceOf ('PhpOffice \\PhpWord \\Element \\TrackChange ' , $ oTrackChange );
58
+ $ this ->assertEquals ($ author , $ oTrackChange ->getAuthor ());
59
+ $ this ->assertEquals ($ date , null );
60
+ $ this ->assertEquals (TrackChange::INSERTED , $ oTrackChange ->getChangeType ());
61
+ }
44
62
}
You can’t perform that action at this time.
0 commit comments