Mercurial > hg > cmmr2012-drupal-site
comparison core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
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 } |