Browse Source

Fix test suite deprecation

Jordi Boggiano 6 years ago
parent
commit
5c426e3f25
3 changed files with 15 additions and 24 deletions
  1. 0 4
      app/autoload.php
  2. 11 16
      phpunit.xml.dist
  3. 4 4
      src/Packagist/WebBundle/Tests/Controller/WebControllerTest.php

+ 0 - 4
app/autoload.php

@@ -2,8 +2,6 @@
 
 ini_set('date.timezone', 'UTC');
 
-use Doctrine\Common\Annotations\AnnotationRegistry;
-
 if (!$loader = @include __DIR__.'/../vendor/autoload.php') {
 
     $message = <<< EOF
@@ -18,6 +16,4 @@ EOF;
     die($message);
 }
 
-AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
-
 return $loader;

+ 11 - 16
phpunit.xml.dist

@@ -1,17 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
-<phpunit
-    backupGlobals               = "false"
-    backupStaticAttributes      = "false"
-    colors                      = "true"
-    convertErrorsToExceptions   = "true"
-    convertNoticesToExceptions  = "true"
-    convertWarningsToExceptions = "true"
-    processIsolation            = "false"
-    stopOnFailure               = "false"
-    syntaxCheck                 = "false"
-    bootstrap                   = "app/autoload.php" >
+<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
+         backupGlobals="false"
+         colors="true"
+         bootstrap="app/autoload.php"
+>
+    <php>
+        <ini name="error_reporting" value="-1" />
+        <server name="KERNEL_CLASS" value="AppKernel" />
+    </php>
 
     <testsuites>
         <testsuite name="Packagist Test Suite">
@@ -20,10 +19,6 @@
         </testsuite>
     </testsuites>
 
-    <php>
-        <server name="KERNEL_DIR" value="app/" />
-    </php>
-
     <filter>
         <whitelist>
             <directory>src</directory>

+ 4 - 4
src/Packagist/WebBundle/Tests/Controller/WebControllerTest.php

@@ -46,10 +46,10 @@ class WebControllerTest extends WebTestCase
     {
         $kernelRootDir = $container->getParameter('kernel.root_dir');
 
-        $this->executeCommand('php '.$kernelRootDir . '/console doctrine:database:drop --env=test --force', false);
-        $this->executeCommand('php '.$kernelRootDir . '/console doctrine:database:create --env=test');
-        $this->executeCommand('php '.$kernelRootDir . '/console doctrine:schema:create --env=test');
-        $this->executeCommand('php '.$kernelRootDir . '/console redis:flushall --env=test -n');
+        $this->executeCommand('php '.$kernelRootDir . '/console doctrine:database:drop --env=test --force -q', false);
+        $this->executeCommand('php '.$kernelRootDir . '/console doctrine:database:create --env=test -q');
+        $this->executeCommand('php '.$kernelRootDir . '/console doctrine:schema:create --env=test -q');
+        $this->executeCommand('php '.$kernelRootDir . '/console redis:flushall --env=test -n -q');
 
         $em = $container->get('doctrine')->getManager();