Changeset 2643

Show
Ignore:
Timestamp:
08/05/08 13:23:49 (5 months ago)
Author:
impl
Message:

branches/david-xml_only_config_system (refs #519): Update unit tests

Location:
branches/david-xml_only_config_system/tests2
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/david-xml_only_config_system/tests2/config/ConfigHandlersConfigHandlerTest.php

    r2635 r2643  
    2929    $CHCH = new AgaviConfigHandlersConfigHandler(); 
    3030 
    31     $file = $this->getIncludeFile($CHCH->execute(AgaviConfig::get('core.config_dir') . '/tests/config_handlers.xml')); 
     31    $document = AgaviXmlConfigParser::run( 
     32      AgaviConfig::get('core.config_dir') . '/tests/config_handlers.xml', 
     33      '', 
     34      '', 
     35      array( 
     36        AgaviXmlConfigParser::STAGE_SINGLE => array( 
     37          AgaviConfig::get('core.agavi_dir') . '/config/xsl/config_handlers.xsl', 
     38        ), 
     39        AgaviXmlConfigParser::STAGE_COMPILATION => array( 
     40        ), 
     41      ), 
     42      array( 
     43        AgaviXmlConfigParser::STAGE_SINGLE => array( 
     44          AgaviXmlConfigParser::STEP_TRANSFORMATIONS_BEFORE => array( 
     45          ), 
     46          AgaviXmlConfigParser::STEP_TRANSFORMATIONS_AFTER => array( 
     47            AgaviXmlConfigParser::VALIDATION_TYPE_RELAXNG => array( 
     48              AgaviConfig::get('core.agavi_dir') . '/config/rng/config_handlers.rng', 
     49            ), 
     50          ), 
     51        ), 
     52        AgaviXmlConfigParser::STAGE_COMPILATION => array( 
     53          AgaviXmlConfigParser::STEP_TRANSFORMATIONS_BEFORE => array(), 
     54          AgaviXmlConfigParser::STEP_TRANSFORMATIONS_AFTER => array() 
     55        ), 
     56      ) 
     57    ); 
     58    $file = $this->getIncludeFile($CHCH->execute($document)); 
    3259    include($file); 
    3360    unlink($file); 
     
    3663    $this->assertTrue(isset(self::$handlers[$hf])); 
    3764    $this->assertSame('CHCHTestHandler', self::$handlers[$hf]['class']); 
    38     $this->assertSame(AgaviConfig::get('core.agavi_dir') . '/config/xsd/routing.xsd', self::$handlers[$hf]['validations']['xml_schema'][0]); 
     65    $this->assertSame(AgaviConfig::get('core.agavi_dir') . '/config/xsd/routing.xsd', self::$handlers[$hf]['validations']['single']['after-transformations']['xml_schema'][0]); 
    3966    $this->assertSame(array('foo' => 'bar', 'dir' => AgaviConfig::get('core.agavi_dir')) , self::$handlers[$hf]['parameters']); 
    4067  } 
  • branches/david-xml_only_config_system/tests2/sandbox2/config/tests/config_handlers.xml

    r2384 r2643  
    33  <configuration> 
    44    <handlers> 
    5       <handler pattern="%core.config_dir%/routing.xml" validate="%core.agavi_dir%/config/xsd/routing.xsd" class="CHCHTestHandler" parser="MyParserClass"> 
     5      <handler pattern="%core.config_dir%/routing.xml" validate="%core.agavi_dir%/config/xsd/routing.xsd" class="CHCHTestHandler"> 
    66        <parameters> 
    77          <parameter name="foo">bar</parameter>