AnnotationBaseTest.php in Drupal 8
File
core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php
View source
<?php
namespace Drupal\Tests\Component\Annotation;
use Drupal\Component\Annotation\AnnotationBase;
use PHPUnit\Framework\TestCase;
class AnnotationBaseTest extends TestCase {
public function testSetProvider() {
$plugin = new AnnotationBaseStub();
$plugin
->setProvider('example');
$this
->assertEquals('example', $plugin
->getProvider());
}
public function testGetId() {
$plugin = new AnnotationBaseStub();
$plugin->id = 'example';
$this
->assertEquals('example', $plugin
->getId());
}
public function testSetClass() {
$plugin = new AnnotationBaseStub();
$plugin
->setClass('example');
$this
->assertEquals('example', $plugin
->getClass());
}
}
class AnnotationBaseStub extends AnnotationBase {
public function get() {
}
}