Mercurial > hg > isophonics-drupal-site
comparison vendor/phar-io/manifest/tests/ManifestLoaderTest.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php | |
2 | |
3 namespace PharIo\Manifest; | |
4 | |
5 /** | |
6 * @covers \PharIo\Manifest\ManifestLoader | |
7 * | |
8 * @uses \PharIo\Manifest\Author | |
9 * @uses \PharIo\Manifest\AuthorCollection | |
10 * @uses \PharIo\Manifest\AuthorCollectionIterator | |
11 * @uses \PharIo\Manifest\AuthorElement | |
12 * @uses \PharIo\Manifest\AuthorElementCollection | |
13 * @uses \PharIo\Manifest\ApplicationName | |
14 * @uses \PharIo\Manifest\BundledComponent | |
15 * @uses \PharIo\Manifest\BundledComponentCollection | |
16 * @uses \PharIo\Manifest\BundledComponentCollectionIterator | |
17 * @uses \PharIo\Manifest\BundlesElement | |
18 * @uses \PharIo\Manifest\ComponentElement | |
19 * @uses \PharIo\Manifest\ComponentElementCollection | |
20 * @uses \PharIo\Manifest\ContainsElement | |
21 * @uses \PharIo\Manifest\CopyrightElement | |
22 * @uses \PharIo\Manifest\CopyrightInformation | |
23 * @uses \PharIo\Manifest\ElementCollection | |
24 * @uses \PharIo\Manifest\Email | |
25 * @uses \PharIo\Manifest\ExtElement | |
26 * @uses \PharIo\Manifest\ExtElementCollection | |
27 * @uses \PharIo\Manifest\License | |
28 * @uses \PharIo\Manifest\LicenseElement | |
29 * @uses \PharIo\Manifest\Manifest | |
30 * @uses \PharIo\Manifest\ManifestDocument | |
31 * @uses \PharIo\Manifest\ManifestDocumentMapper | |
32 * @uses \PharIo\Manifest\ManifestElement | |
33 * @uses \PharIo\Manifest\ManifestLoader | |
34 * @uses \PharIo\Manifest\PhpElement | |
35 * @uses \PharIo\Manifest\PhpExtensionRequirement | |
36 * @uses \PharIo\Manifest\PhpVersionRequirement | |
37 * @uses \PharIo\Manifest\RequirementCollection | |
38 * @uses \PharIo\Manifest\RequirementCollectionIterator | |
39 * @uses \PharIo\Manifest\RequiresElement | |
40 * @uses \PharIo\Manifest\Type | |
41 * @uses \PharIo\Manifest\Url | |
42 * @uses \PharIo\Version\Version | |
43 * @uses \PharIo\Version\VersionConstraint | |
44 */ | |
45 class ManifestLoaderTest extends \PHPUnit_Framework_TestCase { | |
46 public function testCanBeLoadedFromFile() { | |
47 $this->assertInstanceOf( | |
48 Manifest::class, | |
49 ManifestLoader::fromFile(__DIR__ . '/_fixture/library.xml') | |
50 ); | |
51 } | |
52 | |
53 public function testCanBeLoadedFromString() { | |
54 $this->assertInstanceOf( | |
55 Manifest::class, | |
56 ManifestLoader::fromString( | |
57 file_get_contents(__DIR__ . '/_fixture/library.xml') | |
58 ) | |
59 ); | |
60 } | |
61 | |
62 public function testCanBeLoadedFromPhar() { | |
63 $this->assertInstanceOf( | |
64 Manifest::class, | |
65 ManifestLoader::fromPhar(__DIR__ . '/_fixture/test.phar') | |
66 ); | |
67 | |
68 } | |
69 | |
70 public function testLoadingNonExistingFileThrowsException() { | |
71 $this->expectException(ManifestLoaderException::class); | |
72 ManifestLoader::fromFile('/not/existing'); | |
73 } | |
74 | |
75 /** | |
76 * @uses \PharIo\Manifest\ManifestDocumentLoadingException | |
77 */ | |
78 public function testLoadingInvalidXmlThrowsException() { | |
79 $this->expectException(ManifestLoaderException::class); | |
80 ManifestLoader::fromString('<?xml version="1.0" ?><broken>'); | |
81 } | |
82 | |
83 } |