1717class DateTimeFieldMapperTest extends BaseFieldMapperTest
1818{
1919 /**
20- * FQCN of the fieldmapper being tested
21- *
22- * @var mixed
20+ * {@inheritdoc}
2321 */
2422 protected $ fieldMapperClass = DateTimeFieldMapper::class;
2523
2624 /**
27- * List of supported fields
28- *
29- * @var array
25+ * {@inheritdoc}
3026 */
3127 protected $ supportedFields = [
3228 DateTimeImmutable::class,
3329 ];
3430
3531 /**
36- * Valid input data
37- *
38- * @var array
32+ * {@inheritdoc}
3933 */
4034 protected $ validInput = [
4135 'system:filemodifydate ' => '2016-11-17 20:00:00 ' ,
@@ -46,6 +40,11 @@ class DateTimeFieldMapperTest extends BaseFieldMapperTest
4640 'ifd0:modifydate ' => '2016-11-17 20:05:00 ' ,
4741 ];
4842
43+ /**
44+ * {@inheritdoc}
45+ */
46+ protected $ outputAccessor = 'getCreationDate ' ;
47+
4948 /**
5049 * @covers ::mapField
5150 * @group mapper
@@ -58,9 +57,9 @@ public function testMapFieldHasDataInOutput()
5857 $ output = new Exif ;
5958 $ mapper = new $ this ->fieldMapperClass ();
6059
61- $ originalData = $ output ->getCreationDate ();
60+ $ originalData = $ output ->{ $ this -> outputAccessor } ();
6261 $ mapper ->mapField ($ field , $ this ->validInput , $ output );
63- $ newData = $ output ->getCreationDate ();
62+ $ newData = $ output ->{ $ this -> outputAccessor } ();
6463
6564 $ this ->assertNotSame ($ originalData , $ newData );
6665
@@ -98,9 +97,9 @@ public function testMapFieldTraversesSetOfKeys()
9897
9998 $ newKey = $ keys [0 ];
10099
101- $ originalData = $ output ->getCreationDate ();
100+ $ originalData = $ output ->{ $ this -> outputAccessor } ();
102101 $ mapper ->mapField ($ field , $ this ->validInput , $ output );
103- $ newData = $ output ->getCreationDate ();
102+ $ newData = $ output ->{ $ this -> outputAccessor } ();
104103
105104 $ this ->assertNotSame ($ originalData , $ newData );
106105
@@ -115,37 +114,4 @@ public function testMapFieldTraversesSetOfKeys()
115114 );
116115 }
117116 }
118-
119- /**
120- * @covers ::getValidKeys
121- * @group mapper
122- *
123- * @return void
124- */
125- public function testGetValidKeysReturnsArray ()
126- {
127- $ mapper = new $ this ->fieldMapperClass ();
128- $ this ->assertInternalType (
129- 'array ' ,
130- $ mapper ->getValidKeys ()
131- );
132- }
133-
134- /**
135- * @covers ::setValidKeys
136- * @group mapper
137- *
138- * @return void
139- */
140- public function testSetValidKeysSetsCorrectData ()
141- {
142- $ mapper = new $ this ->fieldMapperClass ();
143- $ data = [
144- 'foo ' , 'bar ' , 'baz ' ,
145- ];
146-
147- $ this ->assertNotEquals ($ data , $ mapper ->getValidKeys ());
148- $ mapper ->setValidKeys ($ data );
149- $ this ->assertEquals ($ data , $ mapper ->getValidKeys ());
150- }
151117}
0 commit comments