Chris@2: dom = new DOMDocument(); Chris@2: $this->dom->loadXML(''); Chris@2: $this->bundles = new BundlesElement($this->dom->documentElement); Chris@2: } Chris@2: Chris@2: public function testThrowsExceptionWhenGetComponentElementsIsCalledButNodesAreMissing() { Chris@2: $this->expectException(ManifestElementException::class); Chris@2: $this->bundles->getComponentElements(); Chris@2: } Chris@2: Chris@2: public function testGetComponentElementsReturnsComponentElementCollection() { Chris@2: $this->addComponent(); Chris@2: $this->assertInstanceOf( Chris@2: ComponentElementCollection::class, $this->bundles->getComponentElements() Chris@2: ); Chris@2: } Chris@2: Chris@2: private function addComponent() { Chris@2: $this->dom->documentElement->appendChild( Chris@2: $this->dom->createElementNS('https://phar.io/xml/manifest/1.0', 'component') Chris@2: ); Chris@2: } Chris@2: }