registerQueryProcedure('test', fn() => 'test'); $scopedToBeans = $base->scopeTo('beans:'); $scopedToBeans->registerQueryProcedure('test', fn() => 'test in beans'); $scopedToGarf = $base->scopeTo('garf:'); $scopedToGarfield = $scopedToGarf->scopeTo('ield:'); $scopedToGarfield->registerQueryProcedure('test', fn() => 'test in garfield'); $baseTest = $base->getProcedureInfo('test'); $this->assertNotNull($baseTest); $this->assertEquals('test', $baseTest->getName()); $baseBeansTest = $base->getProcedureInfo('beans:test'); $scopedBeansTest = $scopedToBeans->getProcedureInfo('test'); $this->assertNotNull($baseBeansTest); $this->assertSame($baseBeansTest, $scopedBeansTest); $this->assertEquals('beans:test', $scopedBeansTest->getName()); $baseGarfieldTest = $base->getProcedureInfo('garf:ield:test'); $scopedGarfieldTest = $scopedToGarfield->getProcedureInfo('test'); $this->assertNotNull($baseGarfieldTest); $this->assertSame($baseGarfieldTest, $scopedGarfieldTest); $this->assertEquals('garf:ield:test', $scopedGarfieldTest->getName()); } }