Procházet zdrojové kódy

Merge branch '2.3'

Andrej Hudec před 9 roky
rodič
revize
fbea66f5d9

+ 1 - 1
Resources/doc/getting_started/creating_an_admin.rst

@@ -15,7 +15,7 @@ using these commands:
 .. code-block:: bash
 
     $ php app/console doctrine:generate:entity --entity="AppBundle:Category" --fields="name:string(255)" --no-interaction
-    $ php app/console doctrine:generate:entity --entity="AppBundle:BlogPost" --fields="title:string(255) body:textdraft:boolean" --no-interaction
+    $ php app/console doctrine:generate:entity --entity="AppBundle:BlogPost" --fields="title:string(255) body:text draft:boolean" --no-interaction
 
 After this, you'll need to tweak the entities a bit:
 

+ 1 - 1
Resources/doc/getting_started/the_list_view.rst

@@ -184,7 +184,7 @@ the search field to use the ``name`` property of the Category:
         protected function configureDatagridFilters(DatagridMapper $datagridMapper)
         {
             $datagridMapper
-                ->add('title');
+                ->add('title')
                 ->add('category', null, array(), 'entity', array(
                     'class'    => 'AppBundle\Entity\Category',
                     'property' => 'name',

+ 3 - 6
Tests/Twig/Extension/SonataAdminExtensionTest.php

@@ -16,6 +16,7 @@ use Sonata\AdminBundle\Admin\AdminInterface;
 use Sonata\AdminBundle\Admin\FieldDescriptionInterface;
 use Sonata\AdminBundle\Admin\Pool;
 use Sonata\AdminBundle\Exception\NoValueException;
+use Sonata\AdminBundle\Tests\Fixtures\Entity\FooToString;
 use Sonata\AdminBundle\Twig\Extension\SonataAdminExtension;
 use Symfony\Bridge\Twig\Extension\RoutingExtension;
 use Symfony\Bridge\Twig\Extension\TranslationExtension;
@@ -727,12 +728,8 @@ class SonataAdminExtensionTest extends \PHPUnit_Framework_TestCase
                 }
             }));
 
-        $element = $this->getMock('stdClass', array('__toString'));
-        $element->expects($this->any())
-            ->method('__toString')
-            ->will($this->returnValue('bar'));
-
-        $this->assertSame('bar', $this->twigExtension->renderRelationElement($element, $this->fieldDescription));
+        $element = new FooToString();
+        $this->assertSame('salut', $this->twigExtension->renderRelationElement($element, $this->fieldDescription));
     }
 
     public function testRenderRelationElementCustomToString()