Procházet zdrojové kódy

Use composer to install development requirements

Miha Vrhovnik před 13 roky
rodič
revize
c9b1d17e84
4 změnil soubory, kde provedl 36 přidání a 2 odebrání
  1. 2 0
      .gitignore
  2. 28 0
      Tests/bootstrap.php
  3. 5 1
      composer.json
  4. 1 1
      phpunit.xml.dist

+ 2 - 0
.gitignore

@@ -1,2 +1,4 @@
 /phpunit.xml
 *~
+composer.lock
+/vendor/

+ 28 - 0
Tests/bootstrap.php

@@ -0,0 +1,28 @@
+<?php
+/*
+ * Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+$loader = include_once dirname(__DIR__).'/vendor/autoload.php';
+
+Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(function($class) use ($loader) {
+    if (0 === strpos(ltrim($class, '/'), 'JMS\SerializerBundle\Annotation')) {
+        if (file_exists($file = dirname(__DIR__).'/'.substr(str_replace('\\', '/', $class), strlen('JMS\SerializerBundle')).'.php')) {
+            require_once $file;
+        }
+    }
+
+    return class_exists($class, false);
+});

+ 5 - 1
composer.json

@@ -16,7 +16,11 @@
         "jms/metadata": ">=1.1.0"
     },
     "require-dev": {
-        "symfony/framework-bundle": "2.*"
+        "symfony/framework-bundle": "2.*",
+        "symfony/yaml": "2.*",
+        "symfony/form": "2.*",
+        "symfony/validator": "2.*",
+        "twig/twig": "dev-master"
     },
     "autoload": {
         "psr-0": { "JMS\\SerializerBundle": "" }

+ 1 - 1
phpunit.xml.dist

@@ -9,7 +9,7 @@
          processIsolation="false"
          stopOnFailure="false"
          syntaxCheck="false"
-         bootstrap="./../../../../app/autoload.php"
+         bootstrap="Tests/bootstrap.php"
 >
          
     <testsuites>