11<?php
22
3+ use PHPExif \Adapter \AbstractAdapter ;
34use PHPExif \Adapter \Exiftool ;
45use PHPExif \Adapter \Native ;
56
910class AbstractAdapterTest extends PHPUnit \Framework \TestCase
1011{
1112 /**
12- * @var \PHPExif\Adapter\ Exiftool|\PHPExif\Adapter\ Native
13+ * @var Exiftool|Native
1314 */
1415 protected Exiftool |Native $ adapter ;
1516
1617 protected function setUp (): void
1718 {
18- $ this ->adapter = new \ PHPExif \ Adapter \ Native ();
19+ $ this ->adapter = new Native ();
1920 }
2021
2122 /**
@@ -36,13 +37,13 @@ public function testSetOptionsCorrectlySetsProperties()
3637 {
3738 $ expected = array (
3839 'requiredSections ' => array ('foo ' , 'bar ' , 'baz ' ,),
39- 'includeThumbnail ' => \ PHPExif \ Adapter \ Native::INCLUDE_THUMBNAIL ,
40- 'sectionsAsArrays ' => \ PHPExif \ Adapter \ Native::SECTIONS_AS_ARRAYS ,
40+ 'includeThumbnail ' => Native::INCLUDE_THUMBNAIL ,
41+ 'sectionsAsArrays ' => Native::SECTIONS_AS_ARRAYS ,
4142 );
4243 $ this ->adapter ->setOptions ($ expected );
4344
4445 foreach ($ expected as $ key => $ value ) {
45- $ reflProp = new \ReflectionProperty ('\\ PHPExif \\ Adapter \\ Native ' , $ key );
46+ $ reflProp = new \ReflectionProperty (Native::class , $ key );
4647 $ reflProp ->setAccessible (true );
4748 $ this ->assertEquals ($ value , $ reflProp ->getValue ($ this ->adapter ));
4849 }
@@ -60,7 +61,7 @@ public function testSetOptionsIgnoresPropertiesWithoutSetters()
6061 $ this ->adapter ->setOptions ($ expected );
6162
6263 foreach ($ expected as $ key => $ value ) {
63- $ reflProp = new \ReflectionProperty ('\\ PHPExif \\ Adapter \\ Native ' , $ key );
64+ $ reflProp = new \ReflectionProperty (Native::class , $ key );
6465 $ reflProp ->setAccessible (true );
6566 $ this ->assertNotEquals ($ value , $ reflProp ->getValue ($ this ->adapter ));
6667 }
@@ -75,13 +76,13 @@ public function testConstructorSetsOptions()
7576 {
7677 $ expected = array (
7778 'requiredSections ' => array ('foo ' , 'bar ' , 'baz ' ,),
78- 'includeThumbnail ' => \ PHPExif \ Adapter \ Native::INCLUDE_THUMBNAIL ,
79- 'sectionsAsArrays ' => \ PHPExif \ Adapter \ Native::SECTIONS_AS_ARRAYS ,
79+ 'includeThumbnail ' => Native::INCLUDE_THUMBNAIL ,
80+ 'sectionsAsArrays ' => Native::SECTIONS_AS_ARRAYS ,
8081 );
81- $ adapter = new \ PHPExif \ Adapter \ Native ($ expected );
82+ $ adapter = new Native ($ expected );
8283
8384 foreach ($ expected as $ key => $ value ) {
84- $ reflProp = new \ReflectionProperty ('\\ PHPExif \\ Adapter \\ Native ' , $ key );
85+ $ reflProp = new \ReflectionProperty (Native::class , $ key );
8586 $ reflProp ->setAccessible (true );
8687 $ this ->assertEquals ($ value , $ reflProp ->getValue ($ adapter ));
8788 }
@@ -107,7 +108,7 @@ public function testSetMapperCorrectlySetsInProperty()
107108 $ mapper = new \PHPExif \Mapper \Native ();
108109 $ this ->adapter ->setMapper ($ mapper );
109110
110- $ reflProp = new \ReflectionProperty ('\\ PHPExif \\ Adapter \\ AbstractAdapter ' , 'mapper ' );
111+ $ reflProp = new \ReflectionProperty (AbstractAdapter::class , 'mapper ' );
111112 $ reflProp ->setAccessible (true );
112113 $ this ->assertSame ($ mapper , $ reflProp ->getValue ($ this ->adapter ));
113114 }
@@ -119,7 +120,7 @@ public function testSetMapperCorrectlySetsInProperty()
119120 public function testGetMapperCorrectlyReturnsFromProperty ()
120121 {
121122 $ mapper = new \PHPExif \Mapper \Native ();
122- $ reflProp = new \ReflectionProperty ('\\ PHPExif \\ Adapter \\ AbstractAdapter ' , 'mapper ' );
123+ $ reflProp = new \ReflectionProperty (AbstractAdapter::class , 'mapper ' );
123124 $ reflProp ->setAccessible (true );
124125 $ reflProp ->setValue ($ this ->adapter , $ mapper );
125126 $ this ->assertSame ($ mapper , $ this ->adapter ->getMapper ());
@@ -187,7 +188,7 @@ public function testSetHydratorCorrectlySetsInProperty()
187188 $ hydrator = new \PHPExif \Hydrator \Mutator ();
188189 $ this ->adapter ->setHydrator ($ hydrator );
189190
190- $ reflProp = new \ReflectionProperty ('\\ PHPExif \\ Adapter \\ AbstractAdapter ' , 'hydrator ' );
191+ $ reflProp = new \ReflectionProperty (AbstractAdapter::class , 'hydrator ' );
191192 $ reflProp ->setAccessible (true );
192193 $ this ->assertSame ($ hydrator , $ reflProp ->getValue ($ this ->adapter ));
193194 }
@@ -199,7 +200,7 @@ public function testSetHydratorCorrectlySetsInProperty()
199200 public function testGetHydratorCorrectlyReturnsFromProperty ()
200201 {
201202 $ hydrator = new \PHPExif \Hydrator \Mutator ();
202- $ reflProp = new \ReflectionProperty ('\\ PHPExif \\ Adapter \\ AbstractAdapter ' , 'hydrator ' );
203+ $ reflProp = new \ReflectionProperty (AbstractAdapter::class , 'hydrator ' );
203204 $ reflProp ->setAccessible (true );
204205 $ reflProp ->setValue ($ this ->adapter , $ hydrator );
205206 $ this ->assertSame ($ hydrator , $ this ->adapter ->getHydrator ());
0 commit comments