mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +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
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
|
||||||
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
|
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
|
||||||
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
|
|
||||||
exit(1);
|
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')) {
|
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
|
||||||
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
|
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
|
||||||
}
|
}
|
||||||
|
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
|
||||||
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
|
|
|
@ -32,11 +32,6 @@ abstract class AbstractAdminControllerTest extends WebTestCase
|
||||||
protected static $base_path = 'not_valid';
|
protected static $base_path = 'not_valid';
|
||||||
protected static $entity_class = 'not valid';
|
protected static $entity_class = 'not valid';
|
||||||
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function readDataProvider()
|
public function readDataProvider()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -34,7 +34,7 @@ class RedirectControllerTest extends WebTestCase
|
||||||
protected $userRepo;
|
protected $userRepo;
|
||||||
protected $client;
|
protected $client;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
$this->client = static::createClient([], [
|
$this->client = static::createClient([], [
|
||||||
'PHP_AUTH_USER' => 'user',
|
'PHP_AUTH_USER' => 'user',
|
||||||
|
|
|
@ -39,7 +39,7 @@ class StructuralDBElementTest extends TestCase
|
||||||
protected $child1_1;
|
protected $child1_1;
|
||||||
protected $child1_2;
|
protected $child1_2;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
parent::setUp(); // TODO: Change the autogenerated stub
|
parent::setUp(); // TODO: Change the autogenerated stub
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,6 @@ use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
class PermissionsEmbedTest extends TestCase
|
class PermissionsEmbedTest extends TestCase
|
||||||
{
|
{
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
parent::setUp(); // TODO: Change the autogenerated stub
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetPermissionValue()
|
public function testGetPermissionValue()
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@ class BBCodeToMarkdownConverterTest extends TestCase
|
||||||
{
|
{
|
||||||
protected $converter;
|
protected $converter;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
$this->converter = new BBCodeToMarkdownConverter();
|
$this->converter = new BBCodeToMarkdownConverter();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class TreeViewNodeTest extends TestCase
|
||||||
*/
|
*/
|
||||||
protected $node2;
|
protected $node2;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
$sub_nodes = [];
|
$sub_nodes = [];
|
||||||
$sub_nodes[] = new TreeViewNode('Subnode 1');
|
$sub_nodes[] = new TreeViewNode('Subnode 1');
|
||||||
|
|
|
@ -31,7 +31,7 @@ class UserCheckerTest extends TestCase
|
||||||
{
|
{
|
||||||
protected $service;
|
protected $service;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
$this->service = new UserChecker();
|
$this->service = new UserChecker();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ class AmountFormatterTest extends WebTestCase
|
||||||
*/
|
*/
|
||||||
protected $service;
|
protected $service;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
parent::setUp(); // TODO: Change the autogenerated stub
|
parent::setUp(); // TODO: Change the autogenerated stub
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ class AttachmentPathResolverTest extends WebTestCase
|
||||||
self::$footprint_path = self::$projectDir.'/public/img/footprints';
|
self::$footprint_path = self::$projectDir.'/public/img/footprints';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass() : void
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ class AttachmentURLGeneratorTest extends WebTestCase
|
||||||
|
|
||||||
protected static $service;
|
protected static $service;
|
||||||
|
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass() : void
|
||||||
{
|
{
|
||||||
//Get an service instance.
|
//Get an service instance.
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
|
@ -34,7 +34,7 @@ class BuiltinAttachmentsFinderTest extends WebTestCase
|
||||||
'%FOOTPRINTS_3D%/test.jpg', '%FOOTPRINTS_3D%/hallo.txt',
|
'%FOOTPRINTS_3D%/test.jpg', '%FOOTPRINTS_3D%/hallo.txt',
|
||||||
];
|
];
|
||||||
|
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass() : void
|
||||||
{
|
{
|
||||||
//Get an service instance.
|
//Get an service instance.
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
|
@ -28,7 +28,7 @@ class FileTypeFilterToolsTest extends WebTestCase
|
||||||
{
|
{
|
||||||
protected static $service;
|
protected static $service;
|
||||||
|
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass() : void
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
self::$service = self::$container->get(FileTypeFilterTools::class);
|
self::$service = self::$container->get(FileTypeFilterTools::class);
|
||||||
|
|
|
@ -40,7 +40,7 @@ class ElementTypeNameGeneratorTest extends WebTestCase
|
||||||
*/
|
*/
|
||||||
protected $service;
|
protected $service;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class EntityImporterTest extends WebTestCase
|
||||||
*/
|
*/
|
||||||
protected $service;
|
protected $service;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ class FAIconGeneratorTest extends WebTestCase
|
||||||
*/
|
*/
|
||||||
protected $service;
|
protected $service;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
parent::setUp(); // TODO: Change the autogenerated stub
|
parent::setUp(); // TODO: Change the autogenerated stub
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class PermissionResolverTest extends WebTestCase
|
||||||
protected $user_withoutGroup;
|
protected $user_withoutGroup;
|
||||||
protected $group;
|
protected $group;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
parent::setUp(); // TODO: Change the autogenerated stub
|
parent::setUp(); // TODO: Change the autogenerated stub
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class PricedetailHelperTest extends WebTestCase
|
||||||
*/
|
*/
|
||||||
protected $service;
|
protected $service;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
//Get an service instance.
|
//Get an service instance.
|
||||||
|
|
|
@ -31,7 +31,7 @@ class SIFormatterTest extends WebTestCase
|
||||||
*/
|
*/
|
||||||
protected $service;
|
protected $service;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
//Get an service instance.
|
//Get an service instance.
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue