Skip to content

Conversation

@whytea91
Copy link
Contributor

@whytea91 whytea91 commented Feb 3, 2026

When there are no databases on a domain, the API returns:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.9.1">
    <database>
        <get-db>
            <result>
                <status>ok</status>
                <filter-id>nodatabase.com</filter-id>
            </result>
        </get-db>
    </database>
</packet>

However, the getAll method returns one object with empty values (because if ($xmlResult) is always true, even when there are no DBs).

@sibprogrammer sibprogrammer self-requested a review February 3, 2026 18:12
@whytea91 whytea91 force-pushed the bugfix-correctly-fetch-current-databases-number branch from 619c2b3 to 73c3eeb Compare February 4, 2026 14:24
@whytea91 whytea91 force-pushed the bugfix-correctly-fetch-current-databases-number branch from 73c3eeb to c298f6f Compare February 5, 2026 11:23
@whytea91 whytea91 force-pushed the bugfix-correctly-fetch-current-databases-number branch from c298f6f to 5166bc8 Compare February 6, 2026 09:50

public function testGetAllForWebspaceWithNoDatabases()
{
$webspace = static::$webspace;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for an additional variable if it's used only once on the next line. Just use it: static::$webspace->id

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.49%. Comparing base (a43949f) to head (f57322f).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #188   +/-   ##
=========================================
  Coverage     91.49%   91.49%           
- Complexity      434      436    +2     
=========================================
  Files            83       83           
  Lines          1411     1411           
=========================================
  Hits           1291     1291           
  Misses          120      120           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@whytea91 whytea91 force-pushed the bugfix-correctly-fetch-current-databases-number branch from 5166bc8 to f57322f Compare February 10, 2026 15:51
@sibprogrammer sibprogrammer merged commit 45cd68c into plesk:master Feb 10, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants