annotate vendor/phar-io/manifest/tests/values/CopyrightInformationTest.php @ 19:fa3358dc1485 tip

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