Permalink
Browse files

[zen-60] Make doctrine/common an optional dependency

- 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...
1 parent 7b24d99 commit e07c774ea0f620ef3895ed1f1070ed367b1d0006 @weierophinney weierophinney committed Jun 29, 2012
View
@@ -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
View
@@ -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/"
@@ -66,6 +66,14 @@ defined('TESTS_ZEND_CACHE_MEMCACHED_HOST') || define('TESTS_ZEND_CACHE_MEMCACHED
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
*/
defined('TESTS_ZEND_CONFIG_YAML_ENABLED') || define('TESTS_ZEND_CONFIG_YAML_ENABLED', false);
@@ -182,6 +190,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
*
* If the ONLINE_ENABLED property is false, only tests that can be executed with
@@ -18,14 +18,24 @@
*/
/**
+ * 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';
@@ -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();
}
@@ -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();
}
@@ -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();

0 comments on commit e07c774

Please sign in to comment.