Changeset 1115

Show
Ignore:
Timestamp:
12/05/07 18:19:43 (1 year ago)
Author:
mikey
Message:

enhanced test to make sure that an exception will be thrown on every further request to create the non-existing annotation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/test/php/net/stubbles/reflection/annotations/stubAnnotationFactoryTestCase.php

    r1114 r1115  
    292292        $this->assertFalse(stubAnnotationCache::hasNot(stubAnnotation::TARGET_CLASS, __FILE__ . '::' . 'MyClass', 'NonExistingAnnotation')); 
    293293        try { 
    294             $myAnnotation1 = stubAnnotationFactory::create($this->commentComplex, 'NonExistingAnnotation', stubAnnotation::TARGET_CLASS, 'MyClass', __FILE__); 
     294            $annotation = stubAnnotationFactory::create($this->commentComplex, 'NonExistingAnnotation', stubAnnotation::TARGET_CLASS, 'MyClass', __FILE__); 
    295295        } catch (Exception $e) { 
    296296            $this->assertFalse(stubAnnotationCache::has(stubAnnotation::TARGET_CLASS, __FILE__  . '::' . 'MyClass', 'NonExistingAnnotation')); 
    297297            $this->assertTrue(stubAnnotationCache::hasNot(stubAnnotation::TARGET_CLASS, __FILE__ . '::' . 'MyClass', 'NonExistingAnnotation')); 
     298            $this->expectException('ReflectionException'); 
     299            $annotation = stubAnnotationFactory::create($this->commentComplex, 'NonExistingAnnotation', stubAnnotation::TARGET_CLASS, 'MyClass', __FILE__); 
    298300            return; 
    299301        }