public function testSanitizeLayout() { $data = file_get_contents(__DIR__ . '/_files/sanitize.xml'); $xml = new Varien_Simplexml_Element($data); Mage_DesignEditor_Model_Layout::sanitizeLayout($xml); $this->assertStringMatchesFormatFile(__DIR__ . '/_files/sanitize_expected.txt', $xml->asNiceXml()); }
/** * Test covers both setSanitizing and setWrapping methods in one test because of similar method logic * * @param string $property * @param bool $value * @throws InvalidArgumentException * * @dataProvider flagsDataProvider */ public function testFlags($property, $value) { $this->_model = $this->_prepareLayoutObject(); switch ($property) { case self::PROPERTY_SANITIZING: $this->_model->setSanitizing($value); break; case self::PROPERTY_WRAPPING: $this->_model->setWrapping($value); break; default: throw new InvalidArgumentException('Unknown property.'); } $this->assertAttributeSame($value, $property, $this->_model); }