mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
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:
parent
a62f947b86
commit
6405dee0ac
19 changed files with 19 additions and 37 deletions
15
bin/phpunit
15
bin/phpunit
|
@ -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';
|
|
@ -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 [
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ class BBCodeToMarkdownConverterTest extends TestCase
|
|||
{
|
||||
protected $converter;
|
||||
|
||||
public function setUp()
|
||||
public function setUp() : void
|
||||
{
|
||||
$this->converter = new BBCodeToMarkdownConverter();
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -31,7 +31,7 @@ class UserCheckerTest extends TestCase
|
|||
{
|
||||
protected $service;
|
||||
|
||||
public function setUp()
|
||||
public function setUp() : void
|
||||
{
|
||||
$this->service = new UserChecker();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ class AmountFormatterTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp()
|
||||
public function setUp() : void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -40,7 +40,7 @@ class ElementTypeNameGeneratorTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp()
|
||||
public function setUp() : void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class EntityImporterTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp()
|
||||
public function setUp() : void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class FAIconGeneratorTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp()
|
||||
public function setUp() : void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class PricedetailHelperTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp()
|
||||
public function setUp() : void
|
||||
{
|
||||
parent::setUp();
|
||||
//Get an service instance.
|
||||
|
|
|
@ -31,7 +31,7 @@ class SIFormatterTest extends WebTestCase
|
|||
*/
|
||||
protected $service;
|
||||
|
||||
public function setUp()
|
||||
public function setUp() : void
|
||||
{
|
||||
//Get an service instance.
|
||||
self::bootKernel();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue