1<?php 2 3namespace dokuwiki\test\Remote\OpenApiDoc; 4 5use dokuwiki\Remote\OpenApiDoc\DocBlockClass; 6use dokuwiki\Remote\OpenApiDoc\DocBlockMethod; 7use dokuwiki\Remote\OpenApiDoc\DocBlockProperty; 8 9/** 10 * Test cases for DocBlockClass 11 * 12 * This test class is also used in the tests itself 13 */ 14class DocBlockClassTest extends \DokuWikiTest 15{ 16 /** @var string This is a dummy */ 17 public $dummyProperty1 = 'dummy'; 18 19 /** 20 * Parse this test class with the DocBlockClass 21 * 22 * Also tests property and method access 23 * 24 * @return void 25 */ 26 public function testClass() 27 { 28 $reflect = new \ReflectionClass($this); 29 $doc = new DocBlockClass($reflect); 30 31 $this->assertStringContainsString('Test cases for DocBlockClass', $doc->getSummary()); 32 $this->assertStringContainsString('used in the tests itself', $doc->getDescription()); 33 34 $this->assertInstanceOf(DocBlockProperty::class, $doc->getPropertyDocs()['dummyProperty1']); 35 $this->assertEquals('This is a dummy', $doc->getPropertyDocs()['dummyProperty1']->getSummary()); 36 37 $this->assertInstanceOf(DocBlockMethod::class, $doc->getMethodDocs()['testClass']); 38 } 39 40} 41