/** @test */ public function registeredOperatorParser() { $operatorParserMock = $this->getMockBuilder('Superruzafa\\Rules\\Loader\\Xml\\OperatorParser')->setMethods(array('getElementName'))->getMockForAbstractClass(); $operatorParserMock->expects($this->exactly(2))->method('getElementName')->will($this->returnValue('JARL')); OperatorParserFactoryMethod::registerParser($operatorParserMock); $this->assertSame($operatorParserMock, OperatorParserFactoryMethod::create('JARL')); OperatorParserFactoryMethod::unregisterParser($operatorParserMock); }