Jelajahi Sumber

update unit test

Thomas Rabaix 10 tahun lalu
induk
melakukan
e450e05359

+ 7 - 0
Tests/Form/FormMapperTest.php

@@ -88,6 +88,7 @@ class FormMapperTest extends \PHPUnit_Framework_TestCase
             'auto_created' => true,
             'groups' => array('foobar'),
             'tab' => true,
+            'name' => 'default'
         )), $this->admin->getFormTabs());
 
         $this->assertEquals(array('foobar' => array(
@@ -96,6 +97,7 @@ class FormMapperTest extends \PHPUnit_Framework_TestCase
             'description' => false,
             'translation_domain' => null,
             'fields' => array (),
+            'name' => 'foobar'
         )), $this->admin->getFormGroups());
     }
 
@@ -111,6 +113,7 @@ class FormMapperTest extends \PHPUnit_Framework_TestCase
             'description' => false,
             'translation_domain' => 'Foobar',
             'fields' => array (),
+            'name' => 'foobar'
         )), $this->admin->getFormGroups());
 
         $this->assertEquals(array('default' => array (
@@ -121,6 +124,7 @@ class FormMapperTest extends \PHPUnit_Framework_TestCase
             'auto_created' => true,
             'groups' => array('foobar'),
             'tab' => true,
+            'name' => 'default'
         )), $this->admin->getFormTabs());
     }
 
@@ -133,6 +137,7 @@ class FormMapperTest extends \PHPUnit_Framework_TestCase
                 'description' => false,
                 'translation_domain' => 'Foobar',
                 'class' => false,
+                'name' => 'foobar'
             )
         );
 
@@ -170,6 +175,7 @@ class FormMapperTest extends \PHPUnit_Framework_TestCase
             'auto_created' => true,
             'groups' => array ('foobar'),
             'tab' => true,
+            'name' => 'default'
         )), $this->admin->getFormTabs());
 
         $this->assertEquals(array('foobar' => array(
@@ -180,6 +186,7 @@ class FormMapperTest extends \PHPUnit_Framework_TestCase
             'fields' => array(
                 'foo' => 'foo'
             ),
+            'name' => 'foobar'
         )), $this->admin->getFormGroups());
     }
 

+ 1 - 0
Tests/Mapper/BaseGroupedMapperTest.php

@@ -32,6 +32,7 @@ class BaseGroupedMapperTest extends \PHPUnit_Framework_TestCase
         $builder = $this->getMock('Sonata\AdminBundle\Builder\BuilderInterface');
 
         $this->baseGroupedMapper = $this->getMockForAbstractClass('Sonata\AdminBundle\Mapper\BaseGroupedMapper', array($builder, $admin));
+        $this->baseGroupedMapper->expects($this->any())->method('getTabs')->will($this->returnValue(array()));
     }
 
     public function testWith()

+ 2 - 0
Tests/Show/ShowMapperTest.php

@@ -209,6 +209,7 @@ class ShowMapperTest extends \PHPUnit_Framework_TestCase
                 'description' => false,
                 'translation_domain' => null,
                 'class' => false,
+                'name' => 'Group1'
             )), $this->admin->getShowGroups());
 
         $this->showMapper->reorder(array('fooName3', 'fooName2', 'fooName1', 'fooName4'));
@@ -220,6 +221,7 @@ class ShowMapperTest extends \PHPUnit_Framework_TestCase
                 'class' => false,
                 'description' => false,
                 'translation_domain' => null,
+                'name' => 'Group1',
                 'fields' => array('fooName3'=>'fooName3', 'fooName2'=>'fooName2', 'fooName1'=>'fooName1', 'fooName4'=>'fooName4'),
             )), true), print_r($this->admin->getShowGroups(), true));
     }