Mercurial > hg > isophonics-drupal-site
comparison vendor/phar-io/manifest/tests/values/ApplicationNameTest.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php declare(strict_types = 1); | |
2 namespace PharIo\Manifest; | |
3 | |
4 use PHPUnit\Framework\TestCase; | |
5 | |
6 class ApplicationNameTest extends TestCase { | |
7 | |
8 public function testCanBeCreatedWithValidName() { | |
9 $this->assertInstanceOf( | |
10 ApplicationName::class, | |
11 new ApplicationName('foo/bar') | |
12 ); | |
13 } | |
14 | |
15 public function testUsingInvalidFormatForNameThrowsException() { | |
16 $this->expectException(InvalidApplicationNameException::class); | |
17 $this->expectExceptionCode(InvalidApplicationNameException::InvalidFormat); | |
18 new ApplicationName('foo'); | |
19 } | |
20 | |
21 public function testUsingWrongTypeForNameThrowsException() { | |
22 $this->expectException(InvalidApplicationNameException::class); | |
23 $this->expectExceptionCode(InvalidApplicationNameException::NotAString); | |
24 new ApplicationName(123); | |
25 } | |
26 | |
27 public function testReturnsTrueForEqualNamesWhenCompared() { | |
28 $app = new ApplicationName('foo/bar'); | |
29 $this->assertTrue( | |
30 $app->isEqual($app) | |
31 ); | |
32 } | |
33 | |
34 public function testReturnsFalseForNonEqualNamesWhenCompared() { | |
35 $app1 = new ApplicationName('foo/bar'); | |
36 $app2 = new ApplicationName('foo/foo'); | |
37 $this->assertFalse( | |
38 $app1->isEqual($app2) | |
39 ); | |
40 } | |
41 | |
42 public function testCanBeConvertedToString() { | |
43 $this->assertEquals( | |
44 'foo/bar', | |
45 new ApplicationName('foo/bar') | |
46 ); | |
47 } | |
48 } |