getMockBuilder('oat\taoQtiItem\model\qti\interaction\CustomInteraction') ->setMockClassName('FakeInteractionMock') ->getMock(); CustomInteractionRegistry::getRegistry()->set('fakeInteraction', 'FakeInteractionMock'); $interactions = CustomInteractionRegistry::getRegistry()->getMap(); $this->assertEquals('FakeInteractionMock', $interactions['fakeInteraction']); } /** * @depends testSet * * @author Lionel Lecaque, lionel@taotesting.com */ public function testGet() { $interactions = CustomInteractionRegistry::getRegistry()->getMap(); $this->assertEquals($interactions['fakeInteraction'], CustomInteractionRegistry::getRegistry()->get('fakeInteraction')); $this->assertEquals(CustomInteractionRegistry::getCustomInteractionByName('fakeInteraction'), CustomInteractionRegistry::getRegistry()->get('fakeInteraction')); } /** * @depends testSet * * @author Lionel Lecaque, lionel@taotesting.com */ public function testRemove() { $interactions = CustomInteractionRegistry::getRegistry()->getMap(); $this->assertTrue(isset($interactions['fakeInteraction'])); CustomInteractionRegistry::getRegistry()->remove('fakeInteraction'); $interactions = CustomInteractionRegistry::getRegistry()->getMap(); } }