Ejemplo n.º 1
0
 /**
  * @param string $path
  * @dataProvider layoutFileDataProvider
  */
 public function testLayouts($path)
 {
     $xml = simplexml_load_file($path);
     $classes = Utility_Classes::collectLayoutClasses($xml);
     foreach (Utility_Classes::getXmlAttributeValues($xml, '/layout//@helper', 'helper') as $class) {
         $classes[] = Utility_Classes::getCallbackClass($class);
     }
     $classes = array_merge($classes, Utility_Classes::getXmlAttributeValues($xml, '/layout//@module', 'module'));
     $this->_assertNonFactoryName(array_unique($classes));
     $tabs = Utility_Classes::getXmlNodeValues($xml, '/layout//action[@method="addTab"]/block');
     $this->_assertNonFactoryName(array_unique($tabs), true);
 }
Ejemplo n.º 2
0
 /**
  * @param string $path
  * @dataProvider layoutFileDataProvider
  */
 public function testLayoutFile($path)
 {
     $xml = simplexml_load_file($path);
     $classes = Utility_Classes::getXmlNodeValues($xml, '/layout//*[contains(text(), "_Block_") or contains(text(), "_Model_") or contains(text(), "_Helper_")]');
     foreach (Utility_Classes::getXmlAttributeValues($xml, '/layout//@helper', 'helper') as $class) {
         $classes[] = Utility_Classes::getCallbackClass($class);
     }
     foreach (Utility_Classes::getXmlAttributeValues($xml, '/layout//@module', 'module') as $module) {
         $classes[] = "{$module}_Helper_Data";
     }
     $classes = array_merge($classes, Utility_Classes::collectLayoutClasses($xml));
     $this->_assertClassesExist(array_unique($classes));
 }