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