Sfoglia il codice sorgente

Fix tests for 2.3 branch

Konstantin.Myakshin 9 anni fa
parent
commit
214b9e7de6

+ 4 - 7
.travis.yml

@@ -12,7 +12,7 @@ sudo: false
 
 cache:
   directories:
-    - $HOME/.composer/cache
+    - $HOME/.composer/cache/files
     - $HOME/.cache/pip
 
 env:
@@ -38,14 +38,11 @@ matrix:
     - php: 5.6
       env: SYMFONY_VERSION=2.7.*
     - php: 5.6
-      env: SYMFONY_VERSION=2.8.*@dev
-    - php: 5.6
-      env: SYMFONY_VERSION="3.0.x-dev as 2.8"
+      env: SYMFONY_VERSION=2.8.*
   allow_failures:
     - php: 7.0
     - php: hhvm
-    - env: SYMFONY_VERSION=2.8.*@dev
-    - env: SYMFONY_VERSION="3.0.x-dev as 2.8"
+    - env: SYMFONY_VERSION=2.8.*
 
 before_script:
   - mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d && echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
@@ -53,7 +50,7 @@ before_script:
   - composer config -q -g github-oauth.github.com $GITHUB_OAUTH_TOKEN
   - composer global require phpunit/phpunit:@stable fabpot/php-cs-fixer --no-update
   - composer global update --prefer-dist --no-interaction
-  - if [ "$SYMFONY_VERSION" = "2.8.*@dev" ] || [ "$SYMFONY_VERSION" = "3.0.x-dev as 2.8" ]; then SYMFONY_DEPRECATIONS_HELPER=strict; fi;
+  - if [ "$SYMFONY_VERSION" = "2.8.*" ]; then SYMFONY_DEPRECATIONS_HELPER=strict; fi;
   - if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
   - travis_wait composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
   - export PATH=$HOME/.local/bin:$PATH

+ 4 - 4
Resources/doc/cookbook/recipe_sortable_listing.rst

@@ -109,7 +109,7 @@ also define the sort by field to be position
     {
         $this->positionService = $positionHandler;
     }
-    
+
     protected $datagridValues = array(
         '_page' => 1,
         '_sort_order' => 'ASC',
@@ -132,9 +132,9 @@ also define the sort by field to be position
 And in  the admin.yml add the following call
 
 .. code-block:: yaml
-    
-	- [ setContainer, [ @service_container ] ]
-	- [ setPositionService, [@pix_sortable_behavior.position]]
+
+    - [ setContainer, [ "@service_container" ]]
+    - [ setPositionService, [ "@pix_sortable_behavior.position" ]]
 
 
 You should now have in your listing a new action column with 4 arrows to sort your records.

+ 4 - 4
Resources/doc/reference/advanced.rst

@@ -106,8 +106,8 @@ You have 2 ways of defining the dependencies inside ``services.xml``:
                 - Acme\ProjectBundle\Entity\Project
                 - ~
             calls:
-                - [ setLabelTranslatorStrategy, [ @sonata.admin.label.strategy.native ]]
-                - [ setRouteBuilder, [ @sonata.admin.route.path_info ]]
+                - [ setLabelTranslatorStrategy, [ "@sonata.admin.label.strategy.native" ]]
+                - [ setRouteBuilder, [ "@sonata.admin.route.path_info" ]]
 
 If you want to modify the service that is going to be injected, add the following code to your
 application's config file:
@@ -179,9 +179,9 @@ To create your own RouteBuilder create the PHP class and register it as a servic
 
         services:
             acme.admin.entity_route_builder:
-                class: %acme.admin.entity_route_builder.class%
+                class: "%acme.admin.entity_route_builder.class%"
                 arguments:
-                    - @sonata.admin.audit.manager
+                    - "@sonata.admin.audit.manager"
 
 
 Inherited classes

+ 5 - 5
Resources/doc/reference/getting_started.rst

@@ -189,7 +189,7 @@ use the correct file extension):
 
         # app/config/config.yml
         imports:
-            - { resource: @AcmeDemoBundle/Resources/config/admin.xml }
+            - { resource: "@AcmeDemoBundle/Resources/config/admin.xml" }
 
 2 - Have your bundle load it
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -202,12 +202,12 @@ file, using the ``load()`` method as described in the `symfony cookbook`_.
     .. code-block:: xml
 
         # Acme/DemoBundle/DependencyInjection/AcmeDemoBundleExtension.php for XML configurations
-        
+
         namespace Acme\DemoBundle\DependencyInjection;
 
         use Symfony\Component\DependencyInjection\Loader;
         use Symfony\Component\Config\FileLocator;
-        
+
         class AcmeDemoBundleExtension extends Extension
         {
             public function load(array $configs, ContainerBuilder $container) {
@@ -220,7 +220,7 @@ file, using the ``load()`` method as described in the `symfony cookbook`_.
     .. code-block:: yaml
 
         # Acme/DemoBundle/DependencyInjection/AcmeDemoBundleExtension.php for YAML configurations
-        
+
         namespace Acme\DemoBundle\DependencyInjection;
 
         use Symfony\Component\DependencyInjection\Loader;
@@ -244,7 +244,7 @@ your mapped model. You can start creating, listing, editing and deleting instanc
 You probably want to put your own project's name and logo on the top bar.
 
 Put your logo file here ``src/Acme/DemoBundle/Resources/public/img/fancy_acme_logo.png``
-    
+
 Install your assets:
 
 .. code-block:: sh

+ 1 - 1
Resources/doc/reference/preview_mode.rst

@@ -124,7 +124,7 @@ Hiding the fieldset tags with css (display:none) will be enough to only show the
 
 Or if you prefer less:
 
-.. code-block:: sass
+.. code-block:: scss
 
     div.sonata-preview-form {
       .row {

+ 4 - 1
Tests/Controller/CRUDControllerTest.php

@@ -19,7 +19,6 @@ use Sonata\AdminBundle\Exception\ModelManagerException;
 use Sonata\AdminBundle\Tests\Fixtures\Controller\BatchAdminController;
 use Sonata\AdminBundle\Util\AdminObjectAclManipulator;
 use Symfony\Bridge\Twig\Extension\FormExtension;
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface;
 use Symfony\Component\HttpFoundation\Request;
@@ -281,6 +280,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
                     return true;
                 }
 
+                if ($id == 'templating') {
+                    return true;
+                }
+
                 return false;
             }));
 

+ 22 - 0
Tests/Controller/CoreControllerTest.php

@@ -46,6 +46,17 @@ class CoreControllerTest extends \PHPUnit_Framework_TestCase
         $container->expects($this->any())->method('get')->will($this->returnCallback(function ($id) use ($values) {
             return $values[$id];
         }));
+
+        $container->expects($this->any())
+            ->method('has')
+            ->will($this->returnCallback(function ($id) {
+                if ($id == 'templating') {
+                    return true;
+                }
+
+                return false;
+            }));
+
         $container->expects($this->any())->method('getParameter')->will($this->returnCallback(function ($name) {
             if ($name == 'sonata.admin.configuration.dashboard_blocks') {
                 return array();
@@ -89,6 +100,17 @@ class CoreControllerTest extends \PHPUnit_Framework_TestCase
         $container->expects($this->any())->method('get')->will($this->returnCallback(function ($id) use ($values) {
             return $values[$id];
         }));
+
+        $container->expects($this->any())
+            ->method('has')
+            ->will($this->returnCallback(function ($id) {
+                if ($id == 'templating') {
+                    return true;
+                }
+
+                return false;
+            }));
+
         $container->expects($this->any())->method('getParameter')->will($this->returnCallback(function ($name) {
             if ($name == 'sonata.admin.configuration.dashboard_blocks') {
                 return array();

+ 3 - 0
composer.json

@@ -41,6 +41,9 @@
         "knplabs/knp-menu-bundle": ">=1.1.0,<3.0.0",
         "knplabs/knp-menu": ">=1.1.0,<3.0.0"
     },
+    "conflict": {
+        "symfony/security": ">2.8.999"
+    },
     "require-dev": {
         "jms/translation-bundle": "~1.1",
         "symfony/yaml": "~2.3",