Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
[zen-60] Make doctrine/common an optional dependency
Browse files Browse the repository at this point in the history
- Marked doctrine/common via require-dev and suggests in composer.json
- Updated travis config to pass --dev flag to composer
- Added test constant flags to test configuration to skip annotation
  tests unless flag is true
  • Loading branch information
weierophinney committed Jun 29, 2012
1 parent 7b24d99 commit e07c774
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -8,7 +8,7 @@ php:
before_install:
- cp tests/TestConfiguration.php.travis tests/TestConfiguration.php
- curl -s http://getcomposer.org/installer | php
- php composer.phar install
- php composer.phar install --dev

script:
- php ./tests/run-tests.php
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Expand Up @@ -9,9 +9,14 @@
"homepage": "http://framework.zend.com/",
"license": "BSD-3-Clause",
"require": {
"php": ">=5.3.3",
"php": ">=5.3.3"
},
"require-dev": {
"doctrine/common": ">=2.1"
},
"suggest": {
"doctrine/common": "Doctrine\\Common >=2.1 for annotation features"
},
"autoload": {
"psr-0": {
"Zend": "library/"
Expand Down
16 changes: 16 additions & 0 deletions tests/TestConfiguration.php.dist
Expand Up @@ -65,6 +65,14 @@ defined('TESTS_ZEND_CACHE_MEMCACHED_ENABLED') || define('TESTS_ZEND_CACHE_MEMCAC
defined('TESTS_ZEND_CACHE_MEMCACHED_HOST') || define('TESTS_ZEND_CACHE_MEMCACHED_HOST', '127.0.0.1');
defined('TESTS_ZEND_CACHE_MEMCACHED_PORT') || define('TESTS_ZEND_CACHE_MEMCACHED_PORT', 11211);

/**
* Zend\Code\Annotation
*
* Enable this if you have installed Doctrine\Common on the include_path or via
* composer.
*/
defined('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT') || define('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT', false);

/**
* Zend\Config
*/
Expand Down Expand Up @@ -181,6 +189,14 @@ defined('TESTS_ZEND_FEED_PUBSUBHUBBUB_BASEURI') || define('TESTS_ZEND_FEED_PUBSU
*/
defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED') || define('TESTS_ZEND_FEED_READER_ONLINE_ENABLED', false);

/**
* Zend\Form\Annotation
*
* Enable this if you have installed Doctrine\Common on the include_path or via
* composer.
*/
defined('TESTS_ZEND_FORM_ANNOTATION_SUPPORT') || define('TESTS_ZEND_FORM_ANNOTATION_SUPPORT', false);

/**
* Zend\GData tests
*
Expand Down
12 changes: 11 additions & 1 deletion tests/TestConfiguration.php.travis
Expand Up @@ -17,15 +17,25 @@
* Never commit passwords to the source code repository.
*/

/**
* Zend\Code\Annotation
*/
defined('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT') || define('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT', true);

/**
* Zend\Auth\Adapter\DbTable tests
*/
defined('TESTS_ZEND_AUTH_ADAPTER_DBTABLE_PDO_SQLITE_ENABLED') || define('TESTS_ZEND_AUTH_ADAPTER_DBTABLE_PDO_SQLITE_ENABLED', true);

/**
* Zend\Form\Annotation
*/
defined('TESTS_ZEND_FORM_ANNOTATION_SUPPORT') || define('TESTS_ZEND_FORM_ANNOTATION_SUPPORT', true);

/**
* Zend\Cache\Storage\Adapter
*/
defined('TESTS_ZEND_CACHE_APC_ENABLED') || define('TESTS_ZEND_CACHE_APC_ENABLED', true);
defined('TESTS_ZEND_CACHE_SQLITE_ENABLED') || define('TESTS_ZEND_CACHE_SQLITE_ENABLED', true);

require_once __DIR__ . '/TestConfiguration.php.dist';
require_once __DIR__ . '/TestConfiguration.php.dist';
6 changes: 6 additions & 0 deletions tests/Zend/Code/Annotation/AnnotationManagerTest.php
Expand Up @@ -29,6 +29,12 @@ class AnnotationManagerTest extends TestCase
{
public function setUp()
{
if (!defined('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT')
|| !constant('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT')
) {
$this->markTestSkipped('Enable TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT to test doctrine annotation parsing');
}

$this->manager = new Annotation\AnnotationManager();
}

Expand Down
6 changes: 6 additions & 0 deletions tests/Zend/Code/Annotation/DoctrineAnnotationParserTest.php
Expand Up @@ -29,6 +29,12 @@ class DoctrineAnnotationParserTest extends TestCase
{
public function setUp()
{
if (!defined('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT')
|| !constant('TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT')
) {
$this->markTestSkipped('Enable TESTS_ZEND_CODE_ANNOTATION_DOCTRINE_SUPPORT to test doctrine annotation parsing');
}

$this->parser = new Annotation\Parser\DoctrineAnnotationParser();
}

Expand Down
10 changes: 10 additions & 0 deletions tests/Zend/Form/Annotation/AnnotationBuilderTest.php
Expand Up @@ -27,6 +27,16 @@

class AnnotationBuilderTest extends TestCase
{
public function setUp()
{
if (!defined('TESTS_ZEND_FORM_ANNOTATION_SUPPORT')
|| !constant('TESTS_ZEND_FORM_ANNOTATION_SUPPORT')
) {
$this->markTestSkipped('Enable TESTS_ZEND_FORM_ANNOTATION_SUPPORT to test annotation parsing');
}

}

public function testCanCreateFormFromStandardEntity()
{
$entity = new TestAsset\Annotation\Entity();
Expand Down

0 comments on commit e07c774

Please sign in to comment.