Files
wp-agentic-writer/vendor/phpdocumentor/reflection/tests/integration/InterfacePropertyTest.php
Dwindi Ramadhana 690991c526 refactor: Cleanup git state - commit all staged changes
Major refactoring cleanup:
- Add new controller architecture (class-controller-*.php)
- Add new settings-v2 UI (views/settings-v2/)
- Add new CSS architecture (agentic-sidebar.css, tokens)
- Add esbuild build pipeline (scripts/build.js, package.json)
- Add composer dependencies (vendor/)
- Add frontend src directory (assets/js/src/index.jsx)
- Add documentation files
- Remove old/obsolete files (class-settings.php, old CSS)

This commits all pending changes from previous refactoring efforts.
2026-06-17 05:27:58 +07:00

45 lines
1.7 KiB
PHP

<?php
declare(strict_types=1);
namespace integration;
use EliasHaeussler\PHPUnitAttributes\Attribute\RequiresPackage;
use phpDocumentor\Reflection\File\LocalFile;
use phpDocumentor\Reflection\Php\ProjectFactory;
use phpDocumentor\Reflection\Php\Visibility;
use phpDocumentor\Reflection\Types\Integer;
use phpDocumentor\Reflection\Types\String_;
use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\TestCase;
#[RequiresPackage('nikic/php-parser', '>= 5.2')]
#[CoversNothing]
final class InterfacePropertyTest extends TestCase
{
public function testInterfacePropertiesAreParsed(): void
{
$file = __DIR__ . '/data/PHP84/InterfaceProperties.php';
$projectFactory = ProjectFactory::createInstance();
$project = $projectFactory->create('My project', [new LocalFile($file)]);
$interfaces = $project->getFiles()[$file]->getInterfaces();
$hasId = $interfaces['\PHP84\HasId'];
$properties = $hasId->getProperties();
$this->assertCount(1, $properties);
$idProperty = $properties['\PHP84\HasId::$id'];
$this->assertEquals(new Integer(), $idProperty->getType());
$this->assertEquals(new Visibility(Visibility::PUBLIC_), $idProperty->getVisibility());
$this->assertCount(1, $idProperty->getHooks());
$this->assertEquals('get', $idProperty->getHooks()[0]->getName());
$hasName = $interfaces['\PHP84\HasName'];
$properties = $hasName->getProperties();
$this->assertCount(1, $properties);
$nameProperty = $properties['\PHP84\HasName::$name'];
$this->assertEquals(new String_(), $nameProperty->getType());
$this->assertCount(2, $nameProperty->getHooks());
}
}