lesstif / php-jira-rest-client

PHP classes interact Jira with the REST API.
Other
510 stars 263 forks source link

PHPUnit tests are failing #532

Open jepster opened 6 months ago

jepster commented 6 months ago

I wanted to run the PHPUnit tests, after installing the dependencies via Composer. Then I saw an error, that Dotenv is missing. Therefor I installed it: composer require vlucas/phpdotenv:* --dev.

vendor/bin/phpunit

With PHP 8.3.

Afterwards I got a ton of errors, due to failing tests. E.g.:

5478826ab591:/var/www/application/vendor/lesstif/php-jira-rest-client$ vendor/bin/phpunit 
PHPUnit 10.5.17 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.4
Configuration: /var/www/application/vendor/lesstif/php-jira-rest-client/phpunit.xml

....ESESSFSIESEFSESSESSIFSSSSSSSSSSS..EFESFSSSSSSSESSFSSSSEEEF.  63 / 156 ( 40%)
..........EEEEE.EEFFFFF........................................ 126 / 156 ( 80%)
...........EEEEESSSSESSEEESSEE                                  156 / 156 (100%)

Time: 00:00.431, Memory: 14.00 MB

There was 1 PHPUnit test runner deprecation:

1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!

--

There were 30 errors:

1) JiraRestApi\Test\AttachmentTest::testGetAttachment
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/AttachmentTest.php:16

2) JiraRestApi\Test\BoardTest::get_all_boards
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Board/BoardService.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/BoardTest.php:25

3) JiraRestApi\Test\CustomFieldsTest::testGetFields
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/CustomFieldsTest.php:48

4) JiraRestApi\Test\CustomFieldsTest::testCreateFields
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/CustomFieldsTest.php:103

5) JiraRestApi\Test\GroupTest::testCreateGroup
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/GroupTest.php:21

6) JiraRestApi\Test\IssueSecuritySechemTest::testGetAllSecuritySchemes
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/IssueSecuritySechemTest.php:21

7) JiraRestApi\Test\MapperTest::testIssue
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/MapperTest.php:67

8) JiraRestApi\Test\PriorityTest::testAllPriority
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/PriorityTest.php:16

9) JiraRestApi\Test\RemoteIssueLinkTest::testCreateRemoteIssueLink
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/RemoteIssueLinkTest.php:18

10) JiraRestApi\Test\SearchTest::testGetIssue
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/SearchTest.php:35

11) JiraRestApi\Test\SerializeTest::testDefaultAssignee
TypeError: Cannot assign string to property JiraRestApi\Issue\Reporter::$avatarUrls of type array

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/SerializeTest.php:20

12) JiraRestApi\Test\SerializeTest::testSerialize
TypeError: Cannot assign string to property JiraRestApi\Issue\Reporter::$avatarUrls of type array

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/SerializeTest.php:35

13) JiraRestApi\Test\ServiceDesk\Customer\CustomerServiceTest::testGet
TypeError: Cannot assign true to property JiraRestApi\Issue\Reporter::$active of type string

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Customer/CustomerServiceTest.php:170
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Customer/CustomerServiceTest.php:79

14) JiraRestApi\Test\ServiceDesk\Customer\CustomerServiceTest::testFindCustomers
TypeError: Cannot assign true to property JiraRestApi\Issue\Reporter::$active of type string

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Customer/CustomerServiceTest.php:170
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Customer/CustomerServiceTest.php:95

15) JiraRestApi\Test\ServiceDesk\Customer\CustomerServiceTest::testFindCustomersByQuery
TypeError: Cannot assign true to property JiraRestApi\Issue\Reporter::$active of type string

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Customer/CustomerServiceTest.php:170
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Customer/CustomerServiceTest.php:115

16) JiraRestApi\Test\ServiceDesk\Customer\CustomerServiceTest::testGetCustomers
TypeError: Cannot assign true to property JiraRestApi\Issue\Reporter::$active of type string

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Customer/CustomerServiceTest.php:170
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Customer/CustomerServiceTest.php:135

17) JiraRestApi\Test\ServiceDesk\Customer\CustomerTest::testSetLinksArray
Error: Typed property JiraRestApi\ServiceDesk\Customer\CustomerLinks::$jiraRest must not be accessed before initialization

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Customer/CustomerTest.php:24

18) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testCreate
TypeError: JiraRestApi\ServiceDesk\Organisation\OrganisationService::create(): Argument #1 ($orgName) must be of type string, array given, called in /var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php on line 39

/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Organisation/OrganisationService.php:35
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:39

19) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testCreateFromOrganisation
InvalidArgumentException: JsonMapper::map() requires first argument to be an object, array given.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/netresearch/jsonmapper/src/JsonMapper.php:150
/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Organisation/OrganisationService.php:182
/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Organisation/OrganisationService.php:43
/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Organisation/OrganisationService.php:55
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:62

20) JiraRestApi\Test\StatusTest::testStatus
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/StatusTest.php:13

21) JiraRestApi\Test\SubTaskTest::testCreateSubTask
Error: Call to undefined method JiraRestApi\Issue\IssueField::setAssigneeName()

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/SubTaskTest.php:21

22) JiraRestApi\Test\TimeTrackingTest::testGetTimeTracking
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/TimeTrackingTest.php:17

23) JiraRestApi\Test\TimeTrackingTest::testPostTimeTracking
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/TimeTrackingTest.php:34

24) JiraRestApi\Test\UserTest::create_user
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/UserTest.php:20

25) JiraRestApi\Test\VersionTest::create_version
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/VersionTest.php:24

26) JiraRestApi\Test\WatcherLogTest::testAddWatcherLog
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/WatcherLogTest.php:17

27) JiraRestApi\Test\WatcherLogTest::testRemoveWatcherLog
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/WatcherLogTest.php:31

28) JiraRestApi\Test\WorkLogTest::testGetWorkLog
Dotenv\Exception\ValidationException: One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:175
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Validator.php:53
/var/www/application/vendor/lesstif/php-jira-rest-client/vendor/vlucas/phpdotenv/src/Dotenv.php:253
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:129
/var/www/application/vendor/lesstif/php-jira-rest-client/src/Configuration/DotEnvConfiguration.php:19
/var/www/application/vendor/lesstif/php-jira-rest-client/src/JiraClient.php:69
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/WorkLogTest.php:18

29) JiraRestApi\Test\WorkLogTest::testGetWorkLogById
This test depends on "JiraRestApi\Test\WorkLogTest::testUpdateWorkLogInIssue" which does not exist

30) JiraRestApi\Test\WorkLogTest::testDeleteWorkLogById
This test depends on "JiraRestApi\Test\WorkLogTest::testUpdateWorkLogInIssue" which does not exist

--

There were 12 failures:

1) JiraRestApi\Test\ComponentTest::create_component_on_project
create_component_on_project failedOne or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ComponentTest.php:39

2) JiraRestApi\Test\EpicTest::create_new_epic
create_new_epic : One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/EpicTest.php:54

3) JiraRestApi\Test\IssueTest::create_issue
Create Failed : One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/IssueTest.php:77

4) JiraRestApi\Test\MapperTest::testReporterField
Failed asserting that null matches expected 'lesstif@gmail.com'.

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/MapperTest.php:102

5) JiraRestApi\Test\ProjectTest::get_project_lists
get_project_lists One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ProjectTest.php:36

6) JiraRestApi\Test\SPrintTest::create_sprint
testSearch Failed : One or more environment variables failed assertions: JIRA_HOST is missing, TOKEN_BASED_AUTH is missing.

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/SPrintTest.php:42

7) JiraRestApi\Test\ServiceDesk\Attachment\AttachmentServiceTest::testCreateTemporaryFiles
Expectation failed for method name is "createUrl" when invoked zero or more times
Parameter 0 for invocation JiraRestApi\ServiceDesk\ServiceDeskClient::createUrl('/servicedesk/%s/attachTemporaryFile', [...], []): string does not match expected value.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/servicedesk/%d/attachTemporaryFile'
+'/servicedesk/%s/attachTemporaryFile'

/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Attachment/AttachmentService.php:37
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Attachment/AttachmentServiceTest.php:45

8) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testGet
Expectation failed for method name is "createUrl" when invoked zero or more times
Parameter 1 for invocation JiraRestApi\ServiceDesk\ServiceDeskClient::createUrl('%s/%s', [...], []): string does not match expected value.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '/servicedeskapi/organization'
+    0 => '/organization'
     1 => '623'
 )

/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Organisation/OrganisationService.php:64
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:88

9) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testGetOrganisations
Expectation failed for method name is "exec" when invoked zero or more times
Parameter 0 for invocation JiraRestApi\JiraClient::exec('/organization', null, null, null): bool|string does not match expected value.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'https://example.com/organisation/get'
+'/organization'

/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Organisation/OrganisationService.php:86
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:117

10) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testGetCustomersForOrganisation
Expectation failed for method name is "createUrl" when invoked zero or more times
Parameter 1 for invocation JiraRestApi\ServiceDesk\ServiceDeskClient::createUrl('%s/%s/user?%s', [...], [...]): string does not match expected value.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '/servicedeskapi/organization'
+    0 => '/organization'
     1 => 120
 )

/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Organisation/OrganisationService.php:170
/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Organisation/OrganisationService.php:110
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:152

11) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testAddCustomersToOrganisation
Expectation failed for method name is "createUrl" when invoked zero or more times
Parameter 1 for invocation JiraRestApi\ServiceDesk\ServiceDeskClient::createUrl('%s/%s', [...], []): string does not match expected value.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '/servicedeskapi/organization'
+    0 => '/organization'
     1 => 120
 )

/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Organisation/OrganisationService.php:140
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:180

12) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testDeleteOrganisation
Expectation failed for method name is "createUrl" when invoked zero or more times
Parameter 1 for invocation JiraRestApi\ServiceDesk\ServiceDeskClient::createUrl('%s/%s', [...], []): string does not match expected value.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '/servicedeskapi/organization'
+    0 => '/organization'
     1 => 120
 )

/var/www/application/vendor/lesstif/php-jira-rest-client/src/ServiceDesk/Organisation/OrganisationService.php:152
/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:199

--

There were 6 risky tests:

1) JiraRestApi\Test\ServiceDesk\Attachment\AttachmentServiceTest::testCreateTemporaryFiles
This test did not perform any assertions

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Attachment/AttachmentServiceTest.php:16

2) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testGet
This test did not perform any assertions

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:69

3) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testGetOrganisations
This test did not perform any assertions

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:94

4) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testGetCustomersForOrganisation
This test did not perform any assertions

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:126

5) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testAddCustomersToOrganisation
This test did not perform any assertions

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:161

6) JiraRestApi\Test\ServiceDesk\Organisation\OrganisationServiceTest::testDeleteOrganisation
This test did not perform any assertions

/var/www/application/vendor/lesstif/php-jira-rest-client/tests/ServiceDesk/Organisation/OrganisationServiceTest.php:183

ERRORS!
Tests: 156, Assertions: 149, Errors: 30, Failures: 12, Deprecations: 2, Skipped: 43, Incomplete: 2, Risky: 6.

Is it already known, that tests are screwed or is there any magic? I assume that all PHPUnit configuration is contained in phpunit.xml file and the tests should just succeed via starting PHPUnit from the projects root folder.

lesstif commented 6 months ago

Hi @jepster thank you for your contribution. actually, I left the PHP industry a few years ago, so I didn't know PHP8.3 launched. could you install/run PHP 8.2 on your laptop and share the result with me if you still face the errors, please?

jepster commented 6 months ago

@lesstif This issue appears from PHP 8.3.