resolver = new ClassConstantByWildcardResolver($this->project_analyzer->getCodebase()); } public function testWillParseAllClassConstants(): void { $this->addFile( 'psalm-assert.php', ' project_analyzer->getCodebase(); $codebase->scanFiles(); $resolved = $this->resolver->resolve('ReconciliationTest\\Foo', '*'); self::assertNotEmpty($resolved); foreach ($resolved as $type) { self::assertInstanceOf(TLiteralString::class, $type); self::assertTrue($type->value === 'bar' || $type->value === 'baz'); } } public function testWillParseMatchingClassConstants(): void { $this->addFile( 'psalm-assert.php', ' project_analyzer->getCodebase(); $codebase->scanFiles(); $resolved = $this->resolver->resolve('ReconciliationTest\\Foo', 'BA*'); self::assertNotEmpty($resolved); foreach ($resolved as $type) { self::assertInstanceOf(TLiteralString::class, $type); self::assertTrue($type->value === 'bar' || $type->value === 'baz'); } $resolved = $this->resolver->resolve('ReconciliationTest\\Foo', 'QOO'); self::assertNotNull($resolved); self::assertCount(1, $resolved); $type = reset($resolved); self::assertInstanceOf(TLiteralString::class, $type); self::assertTrue($type->value === 'qoo'); } }