Skip to content

Commit

Permalink
DCOM-25 - Fix SetAutoloadAnnotations
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Oct 31, 2010
1 parent 8565c90 commit a46c618
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/Doctrine/Common/Annotations/AnnotationReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,6 @@ public function __construct(Cache $cache = null, Parser $parser = null)
$this->cache = $cache ?: new \Doctrine\Common\Cache\ArrayCache;
}

/**
* Set whether or not to try and autoload annotation classes.
*
* @param boolean $bool
*/
public function setAutoloadAnnotationClasses($bool)
{
$this->parser->setAutoloadAnnotationClasses($bool);
}

/**
* Sets the default namespace that the AnnotationReader should assume for annotations
* with not fully qualified names.
Expand Down
13 changes: 13 additions & 0 deletions tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,25 @@ public function testNonAnnotationProblem()
$this->assertType('Doctrine\Tests\Common\Annotations\DummyAnnotation', $annotations['Doctrine\Tests\Common\Annotations\DummyAnnotation']);
}

/**
* @return AnnotationReader
*/
public function createAnnotationReader()
{
$reader = new AnnotationReader(new \Doctrine\Common\Cache\ArrayCache);
$reader->setDefaultAnnotationNamespace('Doctrine\Tests\Common\Annotations\\');
return $reader;
}

/**
* @group DCOM-25
*/
public function testSetAutoloadAnnotations()
{
$reader = $this->createAnnotationReader();
$reader->setAutoloadAnnotations(true);
$this->assertTrue($reader->getAutoloadAnnotations());
}
}

class CustomDummyAnnotationClass {
Expand Down

0 comments on commit a46c618

Please sign in to comment.