No Description

CopyrightInformationTest.php 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /*
  3. * This file is part of PharIo\Manifest.
  4. *
  5. * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace PharIo\Manifest;
  11. use PHPUnit\Framework\TestCase;
  12. /**
  13. * @covers PharIo\Manifest\CopyrightInformation
  14. *
  15. * @uses PharIo\Manifest\AuthorCollection
  16. * @uses PharIo\Manifest\AuthorCollectionIterator
  17. * @uses PharIo\Manifest\Author
  18. * @uses PharIo\Manifest\Email
  19. * @uses PharIo\Manifest\License
  20. * @uses PharIo\Manifest\Url
  21. */
  22. class CopyrightInformationTest extends TestCase {
  23. /**
  24. * @var CopyrightInformation
  25. */
  26. private $copyrightInformation;
  27. /**
  28. * @var Author
  29. */
  30. private $author;
  31. /**
  32. * @var License
  33. */
  34. private $license;
  35. protected function setUp() {
  36. $this->author = new Author('Joe Developer', new Email('user@example.com'));
  37. $this->license = new License('BSD-3-Clause', new Url('https://github.com/sebastianbergmann/phpunit/blob/master/LICENSE'));
  38. $authors = new AuthorCollection;
  39. $authors->add($this->author);
  40. $this->copyrightInformation = new CopyrightInformation($authors, $this->license);
  41. }
  42. public function testCanBeCreated() {
  43. $this->assertInstanceOf(CopyrightInformation::class, $this->copyrightInformation);
  44. }
  45. public function testAuthorsCanBeRetrieved() {
  46. $this->assertContains($this->author, $this->copyrightInformation->getAuthors());
  47. }
  48. public function testLicenseCanBeRetrieved() {
  49. $this->assertEquals($this->license, $this->copyrightInformation->getLicense());
  50. }
  51. }