Browse Source

fix tests for symfony2.2

Thomas Rabaix 11 năm trước cách đây
mục cha
commit
e5980a74d0
2 tập tin đã thay đổi với 7 bổ sung5 xóa
  1. 4 2
      Tests/Datagrid/DatagridTest.php
  2. 3 3
      Tests/tests/autoload.php.dist

+ 4 - 2
Tests/Datagrid/DatagridTest.php

@@ -301,10 +301,12 @@ class DatagridTest extends \PHPUnit_Framework_TestCase
         $this->assertInstanceOf('Symfony\Component\Form\FormBuilder', $this->formBuilder->get('_per_page'));
     }
 
+    /**
+     * @expectedException        \Symfony\Component\Form\Exception\UnexpectedTypeException
+     * @expectedExceptionMessage Expected argument of type "FieldDescriptionInterface", "array" given
+     */
     public function testBuildPagerWithException()
     {
-        $this->setExpectedException('InvalidArgumentException', 'Expected argument of type "FieldDescriptionInterface", "array" given');
-
         $filter = $this->getMock('Sonata\AdminBundle\Filter\FilterInterface');
         $filter->expects($this->once())
             ->method('getName')

+ 3 - 3
Tests/tests/autoload.php.dist

@@ -6,10 +6,10 @@ $autoload = __DIR__.'/../../../../../../../app/autoload.php';
 // if the bundle is the project, try to use the composer's autoload for the tests
 $composerAutoload = __DIR__.'/../../vendor/autoload.php';
 
-if (is_file($autoload)) {
-    include $autoload;
-} elseif (is_file($composerAutoload)) {
+if (is_file($composerAutoload)) {
     include $composerAutoload;
+} elseif (is_file($autoload)) {
+    include $autoload;
 } else {
     die('Unable to find autoload.php file, please use composer to load dependencies: