Added Laravel project

This commit is contained in:
2017-09-17 00:35:10 +02:00
parent a3c19304d5
commit ecf605b8f5
6246 changed files with 682270 additions and 2 deletions

View File

@@ -0,0 +1,48 @@
<?php declare(strict_types = 1);
namespace PharIo\Manifest;
use PHPUnit\Framework\TestCase;
class ApplicationNameTest extends TestCase {
public function testCanBeCreatedWithValidName() {
$this->assertInstanceOf(
ApplicationName::class,
new ApplicationName('foo/bar')
);
}
public function testUsingInvalidFormatForNameThrowsException() {
$this->expectException(InvalidApplicationNameException::class);
$this->expectExceptionCode(InvalidApplicationNameException::InvalidFormat);
new ApplicationName('foo');
}
public function testUsingWrongTypeForNameThrowsException() {
$this->expectException(InvalidApplicationNameException::class);
$this->expectExceptionCode(InvalidApplicationNameException::NotAString);
new ApplicationName(123);
}
public function testReturnsTrueForEqualNamesWhenCompared() {
$app = new ApplicationName('foo/bar');
$this->assertTrue(
$app->isEqual($app)
);
}
public function testReturnsFalseForNonEqualNamesWhenCompared() {
$app1 = new ApplicationName('foo/bar');
$app2 = new ApplicationName('foo/foo');
$this->assertFalse(
$app1->isEqual($app2)
);
}
public function testCanBeConvertedToString() {
$this->assertEquals(
'foo/bar',
new ApplicationName('foo/bar')
);
}
}

View File

@@ -0,0 +1,44 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PHPUnit\Framework\TestCase;
/**
* @covers PharIo\Manifest\Application
* @covers PharIo\Manifest\Type
*/
class ApplicationTest extends TestCase {
/**
* @var Application
*/
private $type;
protected function setUp() {
$this->type = Type::application();
}
public function testCanBeCreated() {
$this->assertInstanceOf(Application::class, $this->type);
}
public function testIsApplication() {
$this->assertTrue($this->type->isApplication());
}
public function testIsNotLibrary() {
$this->assertFalse($this->type->isLibrary());
}
public function testIsNotExtension() {
$this->assertFalse($this->type->isExtension());
}
}

View File

@@ -0,0 +1,62 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PHPUnit\Framework\TestCase;
/**
* @covers \PharIo\Manifest\AuthorCollection
* @covers \PharIo\Manifest\AuthorCollectionIterator
*
* @uses \PharIo\Manifest\Author
* @uses \PharIo\Manifest\Email
*/
class AuthorCollectionTest extends TestCase {
/**
* @var AuthorCollection
*/
private $collection;
/**
* @var Author
*/
private $item;
protected function setUp() {
$this->collection = new AuthorCollection;
$this->item = new Author('Joe Developer', new Email('user@example.com'));
}
public function testCanBeCreated() {
$this->assertInstanceOf(AuthorCollection::class, $this->collection);
}
public function testCanBeCounted() {
$this->collection->add($this->item);
$this->assertCount(1, $this->collection);
}
public function testCanBeIterated() {
$this->collection->add(
new Author('Dummy First', new Email('dummy@example.com'))
);
$this->collection->add($this->item);
$this->assertContains($this->item, $this->collection);
}
public function testKeyPositionCanBeRetreived() {
$this->collection->add($this->item);
foreach($this->collection as $key => $item) {
$this->assertEquals(0, $key);
}
}
}

View File

@@ -0,0 +1,45 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PHPUnit\Framework\TestCase;
/**
* @covers PharIo\Manifest\Author
*
* @uses PharIo\Manifest\Email
*/
class AuthorTest extends TestCase {
/**
* @var Author
*/
private $author;
protected function setUp() {
$this->author = new Author('Joe Developer', new Email('user@example.com'));
}
public function testCanBeCreated() {
$this->assertInstanceOf(Author::class, $this->author);
}
public function testNameCanBeRetrieved() {
$this->assertEquals('Joe Developer', $this->author->getName());
}
public function testEmailCanBeRetrieved() {
$this->assertEquals('user@example.com', $this->author->getEmail());
}
public function testCanBeUsedAsString() {
$this->assertEquals('Joe Developer <user@example.com>', $this->author);
}
}

View File

@@ -0,0 +1,63 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PharIo\Version\Version;
use PHPUnit\Framework\TestCase;
/**
* @covers \PharIo\Manifest\BundledComponentCollection
* @covers \PharIo\Manifest\BundledComponentCollectionIterator
*
* @uses \PharIo\Manifest\BundledComponent
* @uses \PharIo\Version\Version
*/
class BundledComponentCollectionTest extends TestCase {
/**
* @var BundledComponentCollection
*/
private $collection;
/**
* @var BundledComponent
*/
private $item;
protected function setUp() {
$this->collection = new BundledComponentCollection;
$this->item = new BundledComponent('phpunit/php-code-coverage', new Version('4.0.2'));
}
public function testCanBeCreated() {
$this->assertInstanceOf(BundledComponentCollection::class, $this->collection);
}
public function testCanBeCounted() {
$this->collection->add($this->item);
$this->assertCount(1, $this->collection);
}
public function testCanBeIterated() {
$this->collection->add($this->createMock(BundledComponent::class));
$this->collection->add($this->item);
$this->assertContains($this->item, $this->collection);
}
public function testKeyPositionCanBeRetreived() {
$this->collection->add($this->item);
foreach($this->collection as $key => $item) {
$this->assertEquals(0, $key);
}
}
}

View File

@@ -0,0 +1,42 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PharIo\Version\Version;
use PHPUnit\Framework\TestCase;
/**
* @covers PharIo\Manifest\BundledComponent
*
* @uses \PharIo\Version\Version
*/
class BundledComponentTest extends TestCase {
/**
* @var BundledComponent
*/
private $bundledComponent;
protected function setUp() {
$this->bundledComponent = new BundledComponent('phpunit/php-code-coverage', new Version('4.0.2'));
}
public function testCanBeCreated() {
$this->assertInstanceOf(BundledComponent::class, $this->bundledComponent);
}
public function testNameCanBeRetrieved() {
$this->assertEquals('phpunit/php-code-coverage', $this->bundledComponent->getName());
}
public function testVersionCanBeRetrieved() {
$this->assertEquals('4.0.2', $this->bundledComponent->getVersion()->getVersionString());
}
}

View File

@@ -0,0 +1,62 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PHPUnit\Framework\TestCase;
/**
* @covers PharIo\Manifest\CopyrightInformation
*
* @uses PharIo\Manifest\AuthorCollection
* @uses PharIo\Manifest\AuthorCollectionIterator
* @uses PharIo\Manifest\Author
* @uses PharIo\Manifest\Email
* @uses PharIo\Manifest\License
* @uses PharIo\Manifest\Url
*/
class CopyrightInformationTest extends TestCase {
/**
* @var CopyrightInformation
*/
private $copyrightInformation;
/**
* @var Author
*/
private $author;
/**
* @var License
*/
private $license;
protected function setUp() {
$this->author = new Author('Joe Developer', new Email('user@example.com'));
$this->license = new License('BSD-3-Clause', new Url('https://github.com/sebastianbergmann/phpunit/blob/master/LICENSE'));
$authors = new AuthorCollection;
$authors->add($this->author);
$this->copyrightInformation = new CopyrightInformation($authors, $this->license);
}
public function testCanBeCreated() {
$this->assertInstanceOf(CopyrightInformation::class, $this->copyrightInformation);
}
public function testAuthorsCanBeRetrieved() {
$this->assertContains($this->author, $this->copyrightInformation->getAuthors());
}
public function testLicenseCanBeRetrieved() {
$this->assertEquals($this->license, $this->copyrightInformation->getLicense());
}
}

View File

@@ -0,0 +1,35 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PHPUnit\Framework\TestCase;
/**
* @covers PharIo\Manifest\Email
*/
class EmailTest extends TestCase {
public function testCanBeCreatedForValidEmail() {
$this->assertInstanceOf(Email::class, new Email('user@example.com'));
}
public function testCanBeUsedAsString() {
$this->assertEquals('user@example.com', new Email('user@example.com'));
}
/**
* @covers PharIo\Manifest\InvalidEmailException
*/
public function testCannotBeCreatedForInvalidEmail() {
$this->expectException(InvalidEmailException::class);
new Email('invalid');
}
}

View File

@@ -0,0 +1,109 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PharIo\Version\AnyVersionConstraint;
use PharIo\Version\Version;
use PharIo\Version\VersionConstraint;
use PharIo\Version\VersionConstraintParser;
use PHPUnit\Framework\TestCase;
/**
* @covers \PharIo\Manifest\Extension
* @covers \PharIo\Manifest\Type
*
* @uses \PharIo\Version\VersionConstraint
* @uses \PharIo\Manifest\ApplicationName
*/
class ExtensionTest extends TestCase {
/**
* @var Extension
*/
private $type;
/**
* @var ApplicationName|\PHPUnit_Framework_MockObject_MockObject
*/
private $name;
protected function setUp() {
$this->name = $this->createMock(ApplicationName::class);
$this->type = Type::extension($this->name, new AnyVersionConstraint);
}
public function testCanBeCreated() {
$this->assertInstanceOf(Extension::class, $this->type);
}
public function testIsNotApplication() {
$this->assertFalse($this->type->isApplication());
}
public function testIsNotLibrary() {
$this->assertFalse($this->type->isLibrary());
}
public function testIsExtension() {
$this->assertTrue($this->type->isExtension());
}
public function testApplicationCanBeRetrieved()
{
$this->assertInstanceOf(ApplicationName::class, $this->type->getApplicationName());
}
public function testVersionConstraintCanBeRetrieved() {
$this->assertInstanceOf(
VersionConstraint::class,
$this->type->getVersionConstraint()
);
}
public function testApplicationCanBeQueried()
{
$this->name->method('isEqual')->willReturn(true);
$this->assertTrue(
$this->type->isExtensionFor($this->createMock(ApplicationName::class))
);
}
public function testCompatibleWithReturnsTrueForMatchingVersionConstraintAndApplicaiton() {
$app = new ApplicationName('foo/bar');
$extension = Type::extension($app, (new VersionConstraintParser)->parse('^1.0'));
$version = new Version('1.0.0');
$this->assertTrue(
$extension->isCompatibleWith($app, $version)
);
}
public function testCompatibleWithReturnsFalseForNotMatchingVersionConstraint() {
$app = new ApplicationName('foo/bar');
$extension = Type::extension($app, (new VersionConstraintParser)->parse('^1.0'));
$version = new Version('2.0.0');
$this->assertFalse(
$extension->isCompatibleWith($app, $version)
);
}
public function testCompatibleWithReturnsFalseForNotMatchingApplication() {
$app1 = new ApplicationName('foo/bar');
$app2 = new ApplicationName('foo/foo');
$extension = Type::extension($app1, (new VersionConstraintParser)->parse('^1.0'));
$version = new Version('1.0.0');
$this->assertFalse(
$extension->isCompatibleWith($app2, $version)
);
}
}

View File

@@ -0,0 +1,44 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PHPUnit\Framework\TestCase;
/**
* @covers PharIo\Manifest\Library
* @covers PharIo\Manifest\Type
*/
class LibraryTest extends TestCase {
/**
* @var Library
*/
private $type;
protected function setUp() {
$this->type = Type::library();
}
public function testCanBeCreated() {
$this->assertInstanceOf(Library::class, $this->type);
}
public function testIsNotApplication() {
$this->assertFalse($this->type->isApplication());
}
public function testIsLibrary() {
$this->assertTrue($this->type->isLibrary());
}
public function testIsNotExtension() {
$this->assertFalse($this->type->isExtension());
}
}

View File

@@ -0,0 +1,41 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PHPUnit\Framework\TestCase;
/**
* @covers PharIo\Manifest\License
*
* @uses PharIo\Manifest\Url
*/
class LicenseTest extends TestCase {
/**
* @var License
*/
private $license;
protected function setUp() {
$this->license = new License('BSD-3-Clause', new Url('https://github.com/sebastianbergmann/phpunit/blob/master/LICENSE'));
}
public function testCanBeCreated() {
$this->assertInstanceOf(License::class, $this->license);
}
public function testNameCanBeRetrieved() {
$this->assertEquals('BSD-3-Clause', $this->license->getName());
}
public function testUrlCanBeRetrieved() {
$this->assertEquals('https://github.com/sebastianbergmann/phpunit/blob/master/LICENSE', $this->license->getUrl());
}
}

View File

@@ -0,0 +1,187 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PharIo\Version\Version;
use PharIo\Version\AnyVersionConstraint;
use PHPUnit\Framework\TestCase;
/**
* @covers \PharIo\Manifest\Manifest
*
* @uses \PharIo\Manifest\ApplicationName
* @uses \PharIo\Manifest\Author
* @uses \PharIo\Manifest\AuthorCollection
* @uses \PharIo\Manifest\BundledComponent
* @uses \PharIo\Manifest\BundledComponentCollection
* @uses \PharIo\Manifest\CopyrightInformation
* @uses \PharIo\Manifest\Email
* @uses \PharIo\Manifest\License
* @uses \PharIo\Manifest\RequirementCollection
* @uses \PharIo\Manifest\PhpVersionRequirement
* @uses \PharIo\Manifest\Type
* @uses \PharIo\Manifest\Application
* @uses \PharIo\Manifest\Url
* @uses \PharIo\Version\Version
* @uses \PharIo\Version\VersionConstraint
*/
class ManifestTest extends TestCase {
/**
* @var ApplicationName
*/
private $name;
/**
* @var Version
*/
private $version;
/**
* @var Type
*/
private $type;
/**
* @var CopyrightInformation
*/
private $copyrightInformation;
/**
* @var RequirementCollection
*/
private $requirements;
/**
* @var BundledComponentCollection
*/
private $bundledComponents;
/**
* @var Manifest
*/
private $manifest;
protected function setUp() {
$this->version = new Version('5.6.5');
$this->type = Type::application();
$author = new Author('Joe Developer', new Email('user@example.com'));
$license = new License('BSD-3-Clause', new Url('https://github.com/sebastianbergmann/phpunit/blob/master/LICENSE'));
$authors = new AuthorCollection;
$authors->add($author);
$this->copyrightInformation = new CopyrightInformation($authors, $license);
$this->requirements = new RequirementCollection;
$this->requirements->add(new PhpVersionRequirement(new AnyVersionConstraint));
$this->bundledComponents = new BundledComponentCollection;
$this->bundledComponents->add(new BundledComponent('phpunit/php-code-coverage', new Version('4.0.2')));
$this->name = new ApplicationName('phpunit/phpunit');
$this->manifest = new Manifest(
$this->name,
$this->version,
$this->type,
$this->copyrightInformation,
$this->requirements,
$this->bundledComponents
);
}
public function testCanBeCreated() {
$this->assertInstanceOf(Manifest::class, $this->manifest);
}
public function testNameCanBeRetrieved() {
$this->assertEquals($this->name, $this->manifest->getName());
}
public function testVersionCanBeRetrieved() {
$this->assertEquals($this->version, $this->manifest->getVersion());
}
public function testTypeCanBeRetrieved() {
$this->assertEquals($this->type, $this->manifest->getType());
}
public function testTypeCanBeQueried() {
$this->assertTrue($this->manifest->isApplication());
$this->assertFalse($this->manifest->isLibrary());
$this->assertFalse($this->manifest->isExtension());
}
public function testCopyrightInformationCanBeRetrieved() {
$this->assertEquals($this->copyrightInformation, $this->manifest->getCopyrightInformation());
}
public function testRequirementsCanBeRetrieved() {
$this->assertEquals($this->requirements, $this->manifest->getRequirements());
}
public function testBundledComponentsCanBeRetrieved() {
$this->assertEquals($this->bundledComponents, $this->manifest->getBundledComponents());
}
/**
* @uses \PharIo\Manifest\Extension
*/
public function testExtendedApplicationCanBeQueriedForExtension()
{
$appName = new ApplicationName('foo/bar');
$manifest = new Manifest(
new ApplicationName('foo/foo'),
new Version('1.0.0'),
Type::extension($appName, new AnyVersionConstraint),
$this->copyrightInformation,
new RequirementCollection,
new BundledComponentCollection
);
$this->assertTrue($manifest->isExtensionFor($appName));
}
public function testNonExtensionReturnsFalseWhenQueriesForExtension() {
$appName = new ApplicationName('foo/bar');
$manifest = new Manifest(
new ApplicationName('foo/foo'),
new Version('1.0.0'),
Type::library(),
$this->copyrightInformation,
new RequirementCollection,
new BundledComponentCollection
);
$this->assertFalse($manifest->isExtensionFor($appName));
}
/**
* @uses \PharIo\Manifest\Extension
*/
public function testExtendedApplicationCanBeQueriedForExtensionWithVersion()
{
$appName = new ApplicationName('foo/bar');
$manifest = new Manifest(
new ApplicationName('foo/foo'),
new Version('1.0.0'),
Type::extension($appName, new AnyVersionConstraint),
$this->copyrightInformation,
new RequirementCollection,
new BundledComponentCollection
);
$this->assertTrue($manifest->isExtensionFor($appName, new Version('1.2.3')));
}
}

View File

@@ -0,0 +1,26 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PHPUnit\Framework\TestCase;
/**
* @covers PharIo\Manifest\PhpExtensionRequirement
*/
class PhpExtensionRequirementTest extends TestCase {
public function testCanBeCreated() {
$this->assertInstanceOf(PhpExtensionRequirement::class, new PhpExtensionRequirement('dom'));
}
public function testCanBeUsedAsString() {
$this->assertEquals('dom', new PhpExtensionRequirement('dom'));
}
}

View File

@@ -0,0 +1,38 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PharIo\Version\ExactVersionConstraint;
use PHPUnit\Framework\TestCase;
/**
* @covers PharIo\Manifest\PhpVersionRequirement
*
* @uses \PharIo\Version\VersionConstraint
*/
class PhpVersionRequirementTest extends TestCase {
/**
* @var PhpVersionRequirement
*/
private $requirement;
protected function setUp() {
$this->requirement = new PhpVersionRequirement(new ExactVersionConstraint('7.1.0'));
}
public function testCanBeCreated() {
$this->assertInstanceOf(PhpVersionRequirement::class, $this->requirement);
}
public function testVersionConstraintCanBeRetrieved() {
$this->assertEquals('7.1.0', $this->requirement->getVersionConstraint()->asString());
}
}

View File

@@ -0,0 +1,63 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PharIo\Version\ExactVersionConstraint;
use PHPUnit\Framework\TestCase;
/**
* @covers \PharIo\Manifest\RequirementCollection
* @covers \PharIo\Manifest\RequirementCollectionIterator
*
* @uses \PharIo\Manifest\PhpVersionRequirement
* @uses \PharIo\Version\VersionConstraint
*/
class RequirementCollectionTest extends TestCase {
/**
* @var RequirementCollection
*/
private $collection;
/**
* @var Requirement
*/
private $item;
protected function setUp() {
$this->collection = new RequirementCollection;
$this->item = new PhpVersionRequirement(new ExactVersionConstraint('7.1.0'));
}
public function testCanBeCreated() {
$this->assertInstanceOf(RequirementCollection::class, $this->collection);
}
public function testCanBeCounted() {
$this->collection->add($this->item);
$this->assertCount(1, $this->collection);
}
public function testCanBeIterated() {
$this->collection->add(new PhpVersionRequirement(new ExactVersionConstraint('5.6.0')));
$this->collection->add($this->item);
$this->assertContains($this->item, $this->collection);
}
public function testKeyPositionCanBeRetreived() {
$this->collection->add($this->item);
foreach($this->collection as $key => $item) {
$this->assertEquals(0, $key);
}
}
}

View File

@@ -0,0 +1,35 @@
<?php
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PharIo\Manifest;
use PHPUnit\Framework\TestCase;
/**
* @covers PharIo\Manifest\Url
*/
class UrlTest extends TestCase {
public function testCanBeCreatedForValidUrl() {
$this->assertInstanceOf(Url::class, new Url('https://phar.io/'));
}
public function testCanBeUsedAsString() {
$this->assertEquals('https://phar.io/', new Url('https://phar.io/'));
}
/**
* @covers PharIo\Manifest\InvalidUrlException
*/
public function testCannotBeCreatedForInvalidUrl() {
$this->expectException(InvalidUrlException::class);
new Url('invalid');
}
}