22
33namespace Drupal \Tests \bamboo_twig \Functional ;
44
5+ use Drupal \bamboo_twig_loader \TwigExtension \Loader ;
56use Drupal \Core \StreamWrapper \PublicStream ;
67use Drupal \file \FileInterface ;
78use Drupal \Tests \taxonomy \Traits \TaxonomyTestTrait ;
9+ use PHPUnit \Framework \Attributes \CoversClass ;
10+ use PHPUnit \Framework \Attributes \CoversMethod ;
11+ use PHPUnit \Framework \Attributes \Group ;
812use PHPUnit \Framework \Attributes \RunTestsInSeparateProcesses ;
913
1014/**
1115 * Tests Loaders twig filters and functions.
1216 *
1317 * @group bamboo_twig
1418 * @group bamboo_twig_functional
15- * @group bamboo_twig_loader
1619 */
20+ #[CoversClass(Loader::class)]
21+ #[CoversMethod(Loader::class, 'loadCurrentUser ' )]
22+ #[CoversMethod(Loader::class, 'loadEntity ' )]
23+ #[CoversMethod(Loader::class, 'loadEntityRevision ' )]
24+ #[CoversMethod(Loader::class, 'loadField ' )]
25+ #[CoversMethod(Loader::class, 'loadImage ' )]
26+ #[Group('bamboo_twig ' )]
27+ #[Group('bamboo_twig_functional ' )]
28+ #[Group('bamboo_twig_loader ' )]
1729#[RunTestsInSeparateProcesses]
1830class BambooTwigLoaderTest extends BambooTwigTestBase {
1931 use TaxonomyTestTrait;
@@ -98,7 +110,7 @@ public function setUp(): void {
98110 }
99111
100112 /**
101- * @covers Drupal\bamboo_twig_loader\TwigExtension\Loader:: loadCurrentUser
113+ * Tests loadCurrentUser() loads the current user in templates.
102114 */
103115 public function testCurrentUser () {
104116 $ this ->drupalGet ('/bamboo-twig-loader ' );
@@ -114,7 +126,7 @@ public function testCurrentUser() {
114126 }
115127
116128 /**
117- * @covers Drupal\bamboo_twig_loader\TwigExtension\Loader:: loadEntity
129+ * Tests loadEntity() loads nodes, taxonomy terms, files, and users.
118130 */
119131 public function testEntity () {
120132 $ this ->drupalGet ('/bamboo-twig-loader ' );
@@ -222,7 +234,7 @@ public function testEntity() {
222234 }
223235
224236 /**
225- * @covers Drupal\bamboo_twig_loader\TwigExtension\Loader:: loadEntityRevision
237+ * Tests loadEntityRevision() loads specific revisions of entities.
226238 */
227239 public function testEntityRevision () {
228240 $ this ->drupalGet ('/bamboo-twig-loader-revision ' );
@@ -252,8 +264,7 @@ public function testEntityRevision() {
252264 }
253265
254266 /**
255- * @covers Drupal\bamboo_twig_loader\TwigExtension\Loader::loadEntity
256- * @covers Drupal\bamboo_twig_loader\TwigExtension\Loader::loadEntityRevision
267+ * Tests loadEntity() and loadEntityRevision() load entities from route.
257268 */
258269 public function testEntityFromRoutes () {
259270 // Accessing unpublished revision page required to be authenticated.
@@ -287,7 +298,7 @@ public function testEntityFromRoutes() {
287298 }
288299
289300 /**
290- * @covers Drupal\bamboo_twig_loader\TwigExtension\Loader:: loadField
301+ * Tests loadField() loads individual field values from entities.
291302 */
292303 public function testField () {
293304 $ this ->drupalGet ('/bamboo-twig-loader ' );
@@ -391,7 +402,7 @@ public function testField() {
391402 }
392403
393404 /**
394- * @covers Drupal\bamboo_twig_loader\TwigExtension\Loader:: loadImage
405+ * Tests loadImage() loads an image by URI and by module path.
395406 */
396407 public function testImage () {
397408 $ this ->drupalGet ('/bamboo-twig-loader ' );
0 commit comments