ExtensionElementTest.php 737B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace PharIo\Manifest;
  3. class ExtensionElementTest extends \PHPUnit_Framework_TestCase {
  4. /**
  5. * @var ExtensionElement
  6. */
  7. private $extension;
  8. protected function setUp() {
  9. $dom = new \DOMDocument();
  10. $dom->loadXML('<?xml version="1.0" ?><extension xmlns="https://phar.io/xml/manifest/1.0" for="phar-io/phive" compatible="~0.6" />');
  11. $this->extension = new ExtensionElement($dom->documentElement);
  12. }
  13. public function testNForCanBeRetrieved() {
  14. $this->assertEquals('phar-io/phive', $this->extension->getFor());
  15. }
  16. public function testCompatibleVersionConstraintCanBeRetrieved() {
  17. $this->assertEquals('~0.6', $this->extension->getCompatible());
  18. }
  19. }