Mercurial > hg > isophonics-drupal-site
comparison core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.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 | |
2 | |
3 namespace Drupal\Tests\Component\Annotation; | |
4 | |
5 use Drupal\Component\Annotation\AnnotationBase; | |
6 use PHPUnit\Framework\TestCase; | |
7 | |
8 /** | |
9 * @coversDefaultClass \Drupal\Component\Annotation\AnnotationBase | |
10 * @group Annotation | |
11 */ | |
12 class AnnotationBaseTest extends TestCase { | |
13 | |
14 /** | |
15 * @covers ::getProvider | |
16 * @covers ::setProvider | |
17 */ | |
18 public function testSetProvider() { | |
19 $plugin = new AnnotationBaseStub(); | |
20 $plugin->setProvider('example'); | |
21 $this->assertEquals('example', $plugin->getProvider()); | |
22 } | |
23 | |
24 /** | |
25 * @covers ::getId | |
26 */ | |
27 public function testGetId() { | |
28 $plugin = new AnnotationBaseStub(); | |
29 // Doctrine sets the public prop directly. | |
30 $plugin->id = 'example'; | |
31 $this->assertEquals('example', $plugin->getId()); | |
32 } | |
33 | |
34 /** | |
35 * @covers ::getClass | |
36 * @covers ::setClass | |
37 */ | |
38 public function testSetClass() { | |
39 $plugin = new AnnotationBaseStub(); | |
40 $plugin->setClass('example'); | |
41 $this->assertEquals('example', $plugin->getClass()); | |
42 } | |
43 | |
44 } | |
45 /** | |
46 * {@inheritdoc} | |
47 */ | |
48 class AnnotationBaseStub extends AnnotationBase { | |
49 | |
50 /** | |
51 * {@inheritdoc} | |
52 */ | |
53 public function get() {} | |
54 | |
55 } |