Changeset 2452 for branches/0.11/tests2

Show
Ignore:
Timestamp:
05/02/08 10:08:34 (8 months ago)
Author:
david
Message:

routing test cases can now have an 'exportFailure' array with a list of tests that are expected to fail; as a result, the test case for #502 does not appear as failed anymore

Location:
branches/0.11/tests2/routing
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/tests2/routing/WebRoutingTest.php

    r1653 r2452  
    3434    $this->_r = new AgaviWebRouting(); 
    3535    $this->_r->initialize($ctx); 
    36     $this->assertEquals($export['prefix'], $this->_r->getPrefix(), '[' . $export['message'] . '] getPrefix() ('.$export['prefix'].':'.$this->_r->getPrefix().')'); 
    37     $this->assertEquals($export['input'], $this->_r->getInput(), '[' . $export['message'] . '] getInput()('.$export['input'].':'.$this->_r->getInput().')'); 
    38     $this->assertEquals($export['basePath'], $this->_r->getBasePath(), '[' . $export['message'] . '] getBasePath()'); 
    39     $this->assertEquals($export['baseHref'], $this->_r->getBaseHref(), '[' . $export['message'] . '] getBaseHref()'); 
     36     
     37    if(!isset($export['expectFailure'])) { 
     38      $export['expectFailure'] = array(); 
     39    } 
     40     
     41    if(in_array('prefix', $export['expectFailure'])) { 
     42      $assertMethod = 'assertNotEquals'; 
     43    } else { 
     44      $assertMethod = 'assertEquals'; 
     45    } 
     46    $this->$assertMethod($export['prefix'], $this->_r->getPrefix(), '[' . $export['message'] . '] getPrefix() ('.$export['prefix'].':'.$this->_r->getPrefix().')'); 
     47     
     48    if(in_array('input', $export['expectFailure'])) { 
     49      $assertMethod = 'assertNotEquals'; 
     50    } else { 
     51      $assertMethod = 'assertEquals'; 
     52    } 
     53    $this->$assertMethod($export['input'], $this->_r->getInput(), '[' . $export['message'] . '] getInput()('.$export['input'].':'.$this->_r->getInput().')'); 
     54     
     55    if(in_array('basePath', $export['expectFailure'])) { 
     56      $assertMethod = 'assertNotEquals'; 
     57    } else { 
     58      $assertMethod = 'assertEquals'; 
     59    } 
     60    $this->$assertMethod($export['basePath'], $this->_r->getBasePath(), '[' . $export['message'] . '] getBasePath()'); 
     61     
     62    if(in_array('baseHref', $export['expectFailure'])) { 
     63      $assertMethod = 'assertNotEquals'; 
     64    } else { 
     65      $assertMethod = 'assertEquals'; 
     66    } 
     67    $this->$assertMethod($export['baseHref'], $this->_r->getBaseHref(), '[' . $export['message'] . '] getBaseHref()'); 
    4068  } 
    4169 
  • branches/0.11/tests2/routing/cases/Apache22ModuleSubdir.case.php

    r2194 r2452  
    597597  ), 
    598598  array( 
     599    'expectFailure' => array( 
     600      'prefix', 
     601      'input', 
     602      'basePath', 
     603      'baseHref', 
     604    ), 
    599605    'message' => 'Sub-directory, rewritten, called path in dir with two slashes; THIS TEST IS EXPECTED TO FAIL, SEE #502!', 
    600606    'input' => '/fubar',