File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ abstract class Feature extends KmlObject {
2222 protected $ atomAuthor ;
2323 protected $ atomLink ;
2424 protected $ address ;
25- protected $ addressDetails ;
2625 protected $ phoneNumber ;
2726 protected $ snippet ;
2827 protected $ description ;
@@ -89,14 +88,6 @@ public function setAtomLink(?Link $atomLink): void {
8988 $ this ->atomLink = $ atomLink ;
9089 }
9190
92- public function getAddressDetails () {
93- return $ this ->addressDetails ;
94- }
95-
96- public function setAddressDetails ($ addressDetails ) {
97- $ this ->addressDetails = $ addressDetails ;
98- }
99-
10091 public function getPhoneNumber (): ?string {
10192 return $ this ->phoneNumber ;
10293 }
Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ class TimeStamp extends TimePrimitive {
1111
1212 private $ when ;
1313
14+ public static function fromInteger (int $ unixTimestamp ) {
15+ $ timeStamp = new TimeStamp ();
16+ $ timeStamp ->when = date (DATE_ISO8601 , $ unixTimestamp );
17+ return $ timeStamp ;
18+ }
19+
1420 public function accept (KmlObjectVisitorInterface $ visitor ): void {
1521 $ visitor ->visitTimeStamp ($ this );
1622 }
Original file line number Diff line number Diff line change 33namespace LibKml \Tests \Domain \AbstractView ;
44
55use LibKml \Domain \AbstractView \Camera ;
6+ use LibKml \Domain \FieldType \AltitudeMode ;
67use LibKml \Domain \KmlObjectVisitorInterface ;
8+ use LibKml \Domain \TimePrimitive \TimeStamp ;
79use PHPUnit \Framework \TestCase ;
810
911class CameraTest extends TestCase {
@@ -39,4 +41,20 @@ public function testRollField() {
3941 $ this ->assertEquals ($ roll , $ this ->camera ->getRoll ());
4042 }
4143
44+ public function testAltitudeModeField () {
45+ $ altitudeMode = AltitudeMode::ABSOLUTE ;
46+
47+ $ this ->camera ->setAltitudeMode ($ altitudeMode );
48+
49+ $ this ->assertEquals ($ altitudeMode , $ this ->camera ->getAltitudeMode ());
50+ }
51+
52+ public function testTimePrimitive () {
53+ $ timeStamp = TimeStamp::fromInteger (time ());
54+
55+ $ this ->camera ->setTimePrimitive ($ timeStamp );
56+
57+ $ this ->assertEquals ($ timeStamp , $ this ->camera ->getTimePrimitive ());
58+ }
59+
4260}
Original file line number Diff line number Diff line change @@ -37,5 +37,13 @@ public function testWhenField() {
3737
3838 $ this ->assertEquals ($ when , $ this ->timeStamp ->getWhen ());
3939 }
40+
41+ public function testFromInteger () {
42+ $ unixTimestamp = time ();
43+
44+ $ timeStamp = TimeStamp::fromInteger ($ unixTimestamp );
45+
46+ $ this ->assertEquals (date (DATE_ISO8601 , $ unixTimestamp ), $ timeStamp ->getWhen ());
47+ }
4048
4149}
You can’t perform that action at this time.
0 commit comments