[ Index ] |
PHP Cross Reference of DokuWiki |
[Summary view] [Print] [Text view]
1 <?php 2 3 namespace dokuwiki\test\Remote\OpenApiDoc; 4 5 use dokuwiki\Remote\OpenApiDoc\DocBlockClass; 6 use dokuwiki\Remote\OpenApiDoc\DocBlockMethod; 7 use dokuwiki\Remote\OpenApiDoc\DocBlockProperty; 8 use dokuwiki\Remote\OpenApiDoc\Type; 9 10 /** 11 * Test cases for DocBlockClass 12 * 13 * This test class is also used in the tests itself 14 */ 15 class DocBlockClassTest extends \DokuWikiTest 16 { 17 /** @var string This is a dummy */ 18 public $dummyProperty1 = 'dummy'; 19 20 /** 21 * Parse this test class with the DocBlockClass 22 * 23 * Also tests property and method access 24 * 25 * @return void Tests don't return anything 26 */ 27 public function testClass() 28 { 29 $reflect = new \ReflectionClass($this); 30 $doc = new DocBlockClass($reflect); 31 32 $this->assertStringContainsString('Test cases for DocBlockClass', $doc->getSummary()); 33 $this->assertStringContainsString('used in the tests itself', $doc->getDescription()); 34 35 $property = $doc->getPropertyDocs()['dummyProperty1']; 36 $this->assertInstanceOf(DocBlockProperty::class, $property); 37 $this->assertEquals('This is a dummy', $property->getSummary()); 38 39 $propertyType = $property->getType(); 40 $this->assertInstanceOf(Type::class, $propertyType); 41 $this->assertEquals('string', $propertyType->getBaseType()); 42 43 $method = $doc->getMethodDocs()['testClass']; 44 $this->assertInstanceOf(DocBlockMethod::class, $method); 45 46 $methodReturn = $method->getReturn(); 47 $this->assertInstanceOf(Type::class, $methodReturn['type']); 48 $this->assertEquals('Tests don\'t return anything', $methodReturn['description']); 49 } 50 51 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body