AuthorElementTest.php 707 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace PharIo\Manifest;
  3. class AuthorElementTest extends \PHPUnit\Framework\TestCase {
  4. /**
  5. * @var AuthorElement
  6. */
  7. private $author;
  8. protected function setUp() {
  9. $dom = new \DOMDocument();
  10. $dom->loadXML('<?xml version="1.0" ?><author xmlns="https://phar.io/xml/manifest/1.0" name="Reiner Zufall" email="reiner@zufall.de" />');
  11. $this->author = new AuthorElement($dom->documentElement);
  12. }
  13. public function testNameCanBeRetrieved() {
  14. $this->assertEquals('Reiner Zufall', $this->author->getName());
  15. }
  16. public function testEmailCanBeRetrieved() {
  17. $this->assertEquals('reiner@zufall.de', $this->author->getEmail());
  18. }
  19. }