/** * @covers Opt_Cdf_Lexer * @covers Opt_Cdf_Parser * @covers Opt_Cdf_Loader::load * @covers Opt_Cdf_Loader::_addDefinition */ public function testMultilineComments2() { $locator = $this->getMock('Opt_Cdf_Locator_Interface', array('getElementLocation')); $locator->expects($this->once())->method('getElementLocation')->will($this->returnValue(array())); $this->_loader->load(self::PATH . 'comments_multiline.cdf'); $this->assertEquals('Opt_Format_Objective', get_class($this->_manager->getFormat('bar', 'joe', $locator))); }
/** * @covers Opt_Cdf_Manager::getFormat * @covers Opt_Cdf_Manager::addFormat * @covers Opt_Cdf_Manager::setLocality * @covers Opt_Cdf_Manager::clearLocals * @expectedException Opt_NoMatchingFormat_Exception */ public function testDisablingLocalDefinitions() { $locator = $this->getMock('Opt_Cdf_Locator_Interface', array('getElementLocation')); $locator->expects($this->exactly(2))->method('getElementLocation')->will($this->returnValue(array())); $this->_obj->setLocality(Opt_Cdf_Manager::AS_LOCAL); $this->_obj->addFormat('foo', 'bar', 'Array', array()); $this->_obj->addFormat('joe', 'goo', 'Array', array()); $this->assertTrue($this->_obj->getFormat('foo', 'bar', $locator) instanceof Opt_Format_Array); $this->_obj->clearLocals(); $this->_obj->getFormat('joe', 'goo', $locator); }