Mercurial > hg > cmmr2012-drupal-site
annotate core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\Tests\Component\Annotation; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Component\Annotation\AnnotationBase; |
Chris@0 | 6 use PHPUnit\Framework\TestCase; |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * @coversDefaultClass \Drupal\Component\Annotation\AnnotationBase |
Chris@0 | 10 * @group Annotation |
Chris@0 | 11 */ |
Chris@0 | 12 class AnnotationBaseTest extends TestCase { |
Chris@0 | 13 |
Chris@0 | 14 /** |
Chris@0 | 15 * @covers ::getProvider |
Chris@0 | 16 * @covers ::setProvider |
Chris@0 | 17 */ |
Chris@0 | 18 public function testSetProvider() { |
Chris@0 | 19 $plugin = new AnnotationBaseStub(); |
Chris@0 | 20 $plugin->setProvider('example'); |
Chris@0 | 21 $this->assertEquals('example', $plugin->getProvider()); |
Chris@0 | 22 } |
Chris@0 | 23 |
Chris@0 | 24 /** |
Chris@0 | 25 * @covers ::getId |
Chris@0 | 26 */ |
Chris@0 | 27 public function testGetId() { |
Chris@0 | 28 $plugin = new AnnotationBaseStub(); |
Chris@0 | 29 // Doctrine sets the public prop directly. |
Chris@0 | 30 $plugin->id = 'example'; |
Chris@0 | 31 $this->assertEquals('example', $plugin->getId()); |
Chris@0 | 32 } |
Chris@0 | 33 |
Chris@0 | 34 /** |
Chris@0 | 35 * @covers ::getClass |
Chris@0 | 36 * @covers ::setClass |
Chris@0 | 37 */ |
Chris@0 | 38 public function testSetClass() { |
Chris@0 | 39 $plugin = new AnnotationBaseStub(); |
Chris@0 | 40 $plugin->setClass('example'); |
Chris@0 | 41 $this->assertEquals('example', $plugin->getClass()); |
Chris@0 | 42 } |
Chris@0 | 43 |
Chris@0 | 44 } |
Chris@0 | 45 /** |
Chris@0 | 46 * {@inheritdoc} |
Chris@0 | 47 */ |
Chris@0 | 48 class AnnotationBaseStub extends AnnotationBase { |
Chris@0 | 49 |
Chris@0 | 50 /** |
Chris@0 | 51 * {@inheritdoc} |
Chris@0 | 52 */ |
Chris@0 | 53 public function get() {} |
Chris@0 | 54 |
Chris@0 | 55 } |