Skip to content

Fix PHPUnit tests #943

@edegaudenzi

Description

@edegaudenzi

This issue tries to respond to this, basically to fix unit tests.

I think I have done all the necessary, or at least all the basics to make them run.
I've also added coverage annotations - to avoid risk errors - using the new (PHPUnit 10+) attributes syntax.

Branch I've got at the moment runs PHPUnit v12 (current) on its PHP 8.3+ requirement.
However, I've just tried on previous versions of PHPUnit and I've successfully run the very same tests on PHPUnit version 10 on its PHP 8.1+ requirement as mentioned.

Taking in consideration PHP Supported Versions - long-story-short: 8.1 deprecated, 8.2 about to be - let me know what's the flavour you want. My suggestion would be PHPUnit v12 (requires PHP 8.3+).

Note for @calcinai :
Unit Tests highlighted a legit fail, whereby one of the assertions in XeroPHP\Tests\Remote\ModelTest::testPracticeManagerClientListIsReturned, particularly $this->assertTrue($contact->getIsPrimary());, returns 'Yes' instead of true.
I have a feeling the assertion expecting true is the correct answer, obtainable by simply filter_var('Yes', FILTER_VALIDATE_BOOLEAN) (I love you php!). I can submit another PR to fix either the test or the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions