@@ -20,10 +20,10 @@ class ParserTest extends \PHPUnit\Framework\TestCase
2020 /**
2121 * @throws Exception
2222 */
23- public function setUp ()
23+ protected function setUp (): void
2424 {
2525 $ file = __DIR__ . DIRECTORY_SEPARATOR . 'resources ' . DIRECTORY_SEPARATOR . 'EBHS.apk ' ;
26- $ this ->subject = new Parser ($ file );
26+ $ this ->subject = new Parser ($ file, [ ' manifest_only ' => false ] );
2727 }
2828
2929 /**
@@ -44,7 +44,7 @@ public function testPermissions()
4444 {
4545 $ permissions = $ this ->subject ->getManifest ()->getPermissions ();
4646
47- $ this ->assertEquals ( count ( $ permissions ), 4 );
47+ $ this ->assertCount ( 4 , $ permissions );
4848 $ this ->assertArrayHasKey ('INTERNET ' , $ permissions , "INTERNET permission not found! " );
4949 $ this ->assertArrayHasKey ('CAMERA ' , $ permissions , "CAMERA permission not found! " );
5050 $ this ->assertArrayHasKey ('BLUETOOTH ' , $ permissions , "BLUETOOTH permission not found! " );
@@ -75,10 +75,15 @@ public function testIconResources()
7575 $ application = $ this ->subject ->getManifest ()->getApplication ();
7676 $ resources = $ this ->subject ->getResources ($ application ->getIcon ());
7777
78- $ expected = array ( 'res/drawable-ldpi/ebhs.png ' , 'res/drawable-mdpi/ebhs.png ' , 'res/drawable-hdpi/ebhs.png ' ) ;
78+ $ expected = [ 'res/drawable-ldpi/ebhs.png ' , 'res/drawable-mdpi/ebhs.png ' , 'res/drawable-hdpi/ebhs.png ' ] ;
7979 $ this ->assertEquals ($ resources , $ expected );
8080 }
8181
82+ public function testGetMissingResources ()
83+ {
84+ $ this ->assertFalse ($ this ->subject ->getResources ('missing ' ));
85+ }
86+
8287 /**
8388 * @throws \PHPUnit\Framework\ExpectationFailedException
8489 * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
@@ -90,7 +95,7 @@ public function testIconStream()
9095 $ file = __DIR__ . DIRECTORY_SEPARATOR . 'resources ' . DIRECTORY_SEPARATOR . 'ebhs.png ' ;
9196 $ expected = file_get_contents ($ file );
9297
93- $ this ->assertTrue ( is_resource ( $ stream) );
98+ $ this ->assertIsResource ( $ stream );
9499 $ this ->assertEquals (base64_encode ($ icon ), base64_encode ($ expected ));
95100 }
96101
@@ -104,7 +109,7 @@ public function testLabelResources()
104109 $ application = $ this ->subject ->getManifest ()->getApplication ();
105110 $ resources = $ this ->subject ->getResources ($ application ->getLabel ());
106111
107- $ expected = array ( 'EBHS ' ) ;
112+ $ expected = [ 'EBHS ' ] ;
108113 $ this ->assertEquals ($ resources , $ expected );
109114 }
110115}
0 commit comments