Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

Removed unneded static-method and added unit tests for Configuration.php #54

Merged
merged 2 commits into from Dec 19, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 0 additions & 10 deletions lib/Doctrine/Search/Mapping/Driver/AnnotationDriver.php
Expand Up @@ -53,16 +53,6 @@ class AnnotationDriver extends BaseAnnotationDriver
);


/**
* Registers annotation classes to the common registry.
*
* This method should be called when bootstrapping your application.
*/
public static function registerAnnotationClasses()
{
AnnotationRegistry::registerFile(__DIR__ . '/../Annotations/DoctrineAnnotations.php');
}

/**
* {@inheritDoc}
*
Expand Down
93 changes: 37 additions & 56 deletions tests/Unit/Doctrine/Search/ConfigurationTest.php
Expand Up @@ -12,100 +12,81 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
/**
* @var Configuration
*/
protected $object;
protected $configuration;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$this->object = new Configuration;
$this->configuration = new Configuration();
}

/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown()
{
}

/**
* @todo Implement testGetMetadataDriverImpl().
*/
public function testGetMetadataDriverImpl()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$metadataDriverImpl = $this->configuration->getMetadataDriverImpl();
$this->assertInstanceOf('\Doctrine\Search\Mapping\Driver\AnnotationDriver', $metadataDriverImpl);
}

/**
* @todo Implement testSetMetadataDriverImpl().
*/

public function testSetMetadataDriverImpl()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$mockedMetadataDriverImpl = $this->getMock('\\Doctrine\\Search\\Mapping\\Driver\\Driver'
, array(), array(), '', false);
$this->configuration->setMetadataDriverImpl($mockedMetadataDriverImpl);

$metadataDriverImpl = $this->configuration->getMetadataDriverImpl();
$this->assertInstanceOf('\Doctrine\Search\Mapping\Driver\Driver', $metadataDriverImpl);

}

/**
* @todo Implement testSetMetadataCacheImpl().
* @expectedException PHPUnit_Framework_Error
*/
public function testSetMetadataCacheImpl()
public function testSetMetadataCacheImplWrongParameter()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->configuration->setMetadataCacheImpl(array());
}

/**
* @todo Implement testGetMetadataCacheImpl().
*/
public function testGetMetadataCacheImpl()
public function testSetMetadataCacheImpl()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$mockedMetadataCacheImpl = $this->getMock('\Doctrine\Common\Cache\Cache');
$this->configuration->setMetadataCacheImpl($mockedMetadataCacheImpl);

$cacheMetadataImpl = $this->configuration->getMetadataCacheImpl();
$this->assertInstanceOf('\Doctrine\Common\Cache\Cache', $cacheMetadataImpl);
}

/**
* @todo Implement testNewDefaultAnnotationDriver().
*/

public function testNewDefaultAnnotationDriver()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$defaultAnnotationDriver = $this->configuration->newDefaultAnnotationDriver();
$this->assertInstanceOf('\Doctrine\Search\Mapping\Driver\AnnotationDriver', $defaultAnnotationDriver);
}

/**
* @todo Implement testSetClassMetadataFactoryName().
* @expectedException PHPUnit_Framework_Error
*/
public function testNewDefaultAnnotationDriverWrongParameter()
{
$this->configuration->newDefaultAnnotationDriver(new \StdClass());
}

public function testSetClassMetadataFactoryName()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->configuration = new Configuration();
$this->configuration->setClassMetadataFactoryName('test');
$this->assertEquals('test', $this->configuration->getClassMetadataFactoryName());
}

/**
* @todo Implement testGetClassMetadataFactoryName().
*/

public function testGetClassMetadataFactoryName()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->configuration = new Configuration();
$className = $this->configuration->getClassMetadataFactoryName();
$this->assertEquals($className, 'Doctrine\Search\Mapping\ClassMetadataFactory');
}
}
?>
Expand Up @@ -58,9 +58,6 @@ private function getDocumentManager()
}


/**
* @todo Implement testLoadClassMetadata().
*/
public function testLoadClassMetadata()
{
$dm = $this->getDocumentManager();
Expand Down
11 changes: 0 additions & 11 deletions tests/Unit/Doctrine/Search/Mapping/Driver/AnnotationDriverTest.php
Expand Up @@ -40,17 +40,6 @@ protected function setUp()
$this->annotationDriver = new AnnotationDriver($this->reader);
}

/**
* @todo Implement testRegisterAnnotationClasses().
*/
public function testRegisterAnnotationClasses()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}

public function testLoadMetadataForClass()
{

Expand Down