Made tests compatible with phpunit 8

The new simple-phpunit wrapper is selects the best phpunit version automatically and removes all the void return types if needed.
This commit is contained in:
Jan Böhmer 2019-11-23 19:12:49 +01:00
parent a62f947b86
commit 6405dee0ac
19 changed files with 19 additions and 37 deletions

View file

@ -1,19 +1,10 @@
#!/usr/bin/env php
<?php
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}
if (false === getenv('SYMFONY_PHPUNIT_VERSION')) {
putenv('SYMFONY_PHPUNIT_VERSION=7.5');
}
if (false === getenv('SYMFONY_PHPUNIT_REMOVE')) {
putenv('SYMFONY_PHPUNIT_REMOVE=');
}
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';

View file

@ -32,11 +32,6 @@ abstract class AbstractAdminControllerTest extends WebTestCase
protected static $base_path = 'not_valid';
protected static $entity_class = 'not valid';
public function setUp()
{
parent::setUp();
}
public function readDataProvider()
{
return [

View file

@ -34,7 +34,7 @@ class RedirectControllerTest extends WebTestCase
protected $userRepo;
protected $client;
public function setUp()
public function setUp() : void
{
$this->client = static::createClient([], [
'PHP_AUTH_USER' => 'user',

View file

@ -39,7 +39,7 @@ class StructuralDBElementTest extends TestCase
protected $child1_1;
protected $child1_2;
public function setUp()
public function setUp() : void
{
parent::setUp(); // TODO: Change the autogenerated stub

View file

@ -27,10 +27,6 @@ use PHPUnit\Framework\TestCase;
class PermissionsEmbedTest extends TestCase
{
public function setUp()
{
parent::setUp(); // TODO: Change the autogenerated stub
}
public function testGetPermissionValue()
{

View file

@ -28,7 +28,7 @@ class BBCodeToMarkdownConverterTest extends TestCase
{
protected $converter;
public function setUp()
public function setUp() : void
{
$this->converter = new BBCodeToMarkdownConverter();
}

View file

@ -35,7 +35,7 @@ class TreeViewNodeTest extends TestCase
*/
protected $node2;
public function setUp()
public function setUp() : void
{
$sub_nodes = [];
$sub_nodes[] = new TreeViewNode('Subnode 1');

View file

@ -31,7 +31,7 @@ class UserCheckerTest extends TestCase
{
protected $service;
public function setUp()
public function setUp() : void
{
$this->service = new UserChecker();
}

View file

@ -32,7 +32,7 @@ class AmountFormatterTest extends WebTestCase
*/
protected $service;
public function setUp()
public function setUp() : void
{
parent::setUp(); // TODO: Change the autogenerated stub

View file

@ -48,7 +48,7 @@ class AttachmentPathResolverTest extends WebTestCase
self::$footprint_path = self::$projectDir.'/public/img/footprints';
}
public static function setUpBeforeClass()
public static function setUpBeforeClass() : void
{
parent::setUpBeforeClass();

View file

@ -30,7 +30,7 @@ class AttachmentURLGeneratorTest extends WebTestCase
protected static $service;
public static function setUpBeforeClass()
public static function setUpBeforeClass() : void
{
//Get an service instance.
self::bootKernel();

View file

@ -34,7 +34,7 @@ class BuiltinAttachmentsFinderTest extends WebTestCase
'%FOOTPRINTS_3D%/test.jpg', '%FOOTPRINTS_3D%/hallo.txt',
];
public static function setUpBeforeClass()
public static function setUpBeforeClass() : void
{
//Get an service instance.
self::bootKernel();

View file

@ -28,7 +28,7 @@ class FileTypeFilterToolsTest extends WebTestCase
{
protected static $service;
public static function setUpBeforeClass()
public static function setUpBeforeClass() : void
{
self::bootKernel();
self::$service = self::$container->get(FileTypeFilterTools::class);

View file

@ -40,7 +40,7 @@ class ElementTypeNameGeneratorTest extends WebTestCase
*/
protected $service;
public function setUp()
public function setUp() : void
{
parent::setUp();

View file

@ -35,7 +35,7 @@ class EntityImporterTest extends WebTestCase
*/
protected $service;
public function setUp()
public function setUp() : void
{
parent::setUp();

View file

@ -32,7 +32,7 @@ class FAIconGeneratorTest extends WebTestCase
*/
protected $service;
public function setUp()
public function setUp() : void
{
parent::setUp(); // TODO: Change the autogenerated stub

View file

@ -38,7 +38,7 @@ class PermissionResolverTest extends WebTestCase
protected $user_withoutGroup;
protected $group;
public function setUp()
public function setUp() : void
{
parent::setUp(); // TODO: Change the autogenerated stub

View file

@ -35,7 +35,7 @@ class PricedetailHelperTest extends WebTestCase
*/
protected $service;
public function setUp()
public function setUp() : void
{
parent::setUp();
//Get an service instance.

View file

@ -31,7 +31,7 @@ class SIFormatterTest extends WebTestCase
*/
protected $service;
public function setUp()
public function setUp() : void
{
//Get an service instance.
self::bootKernel();