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