Development

Changeset 20690

You must first sign up to be able to contribute.

Changeset 20690

Show
Ignore:
Timestamp:
08/02/09 13:41:12 (5 years ago)
Author:
bschussek
Message:

Fixed: Annotation support can be enabled in included files

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/lime/branches/2.0-experimental/lib/LimeAnnotationSupport.php

    r20493 r20690  
    106106  protected static function getScriptPath() 
    107107  { 
    108     $script = null; 
    109  
    110108    $traces = debug_backtrace(); 
    111     $file = __FILE__; 
    112  
    113     for ($i = 0; $i < count($traces) && $file == __FILE__; ++$i) 
    114     { 
    115       $file = $traces[$i]['file']; 
    116     } 
     109    $file = $traces[count($traces)-1]['file']; 
    117110 
    118111    if (!is_file($file)) 
  • tools/lime/branches/2.0-experimental/test/unit/LimeAnnotationSupportTest.php

    r20495 r20690  
    2222 
    2323 
    24 $t = new LimeAnnotationSupportTest(37); 
     24$t = new LimeAnnotationSupportTest(39); 
    2525 
    2626$root = '/test/unit/LimeAnnotationSupport'; 
     
    416416  $t->is($result, 0, 'The file returned exit status 0 (success)'); 
    417417  $t->isOutput($actual, $expected); 
     418 
     419 
     420$t->diag('The annotation support can be enabled in included bootstrap files'); 
     421 
     422  // test 
     423  list($result, $actual) = execute($file = 'test_include.php'); 
     424  // assertion 
     425  $expected = <<<EOF 
     426$root/@$file 
     4271..0 
     428Before 
     429Test 1 
     430Before 
     431Test 2 
     432 Looks like everything went fine. 
     433EOF; 
     434  $t->is($result, 0, 'The file returned exit status 0 (success)'); 
     435  $t->isOutput($actual, $expected);