Skip to content

Commit c93421c

Browse files
committed
Modernize test examples and simplify CI workflow
- Update artist example from The Beatles to Billie Eilish - Streamline integration test execution in CI to use composer scripts - Improve documentation for running integration tests locally
1 parent 6f06795 commit c93421c

File tree

4 files changed

+10
-20
lines changed

4 files changed

+10
-20
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,15 @@ jobs:
9090
- name: Run tests (Unit Tests only)
9191
run: composer test
9292

93-
- name: Run integration tests (public API only - manual trigger)
94-
if: github.event_name == 'workflow_dispatch'
95-
run: vendor/bin/phpunit tests/Integration/PublicApiIntegrationTest.php --testdox
96-
97-
- name: Run integration tests (with authentication - manual trigger)
93+
- name: Run integration tests (manual trigger)
9894
if: github.event_name == 'workflow_dispatch'
9995
env:
10096
DISCOGS_CONSUMER_KEY: ${{ secrets.DISCOGS_CONSUMER_KEY }}
10197
DISCOGS_CONSUMER_SECRET: ${{ secrets.DISCOGS_CONSUMER_SECRET }}
10298
DISCOGS_PERSONAL_ACCESS_TOKEN: ${{ secrets.DISCOGS_PERSONAL_ACCESS_TOKEN }}
10399
run: |
104-
if [ -n "$DISCOGS_CONSUMER_KEY" ] && [ -n "$DISCOGS_CONSUMER_SECRET" ] && [ -n "$DISCOGS_PERSONAL_ACCESS_TOKEN" ]; then
105-
vendor/bin/phpunit tests/Integration/AuthenticationLevelsTest.php --testdox
106-
else
107-
echo "Skipping authenticated integration tests - secrets not available"
108-
fi
100+
# Public tests run without credentials, auth tests skip if credentials missing
101+
composer test-integration -- --testdox
109102
110103
code-quality:
111104
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [4.0.0-beta](https://github.com/calliostro/php-discogs-api/releases/tag/v4.0.0-beta.2) – 2025-09-13
8+
## [4.0.0](https://github.com/calliostro/php-discogs-api/releases/tag/v4.0.0) – 2025-12-01
99

1010
### 🚀 Complete Library Redesign – v4.0 is a Fresh Start
1111

DEVELOPMENT.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,11 @@ export DISCOGS_CONSUMER_KEY="your-consumer-key"
8989
export DISCOGS_CONSUMER_SECRET="your-consumer-secret"
9090
export DISCOGS_PERSONAL_ACCESS_TOKEN="your-personal-access-token"
9191

92-
# Run public tests only
93-
vendor/bin/phpunit tests/Integration/PublicApiIntegrationTest.php
94-
95-
# Run authentication tests (requires env vars)
96-
vendor/bin/phpunit tests/Integration/AuthenticationLevelsTest.php
92+
# Run integration tests (public tests run without credentials, auth tests skip if no credentials)
93+
composer test-integration
9794

98-
# Run all integration tests
99-
vendor/bin/phpunit tests/Integration/ --testdox
95+
# Run all tests (unit + integration) with detailed output
96+
composer test-all -- --testdox
10097
```
10198

10299
### Safety Notes

tests/Integration/AuthenticationLevelsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public function testLevel1NoAuthentication(): void
2020
{
2121
$discogs = DiscogsClientFactory::create();
2222

23-
$artist = $discogs->getArtist('1');
23+
$artist = $discogs->getArtist('5590213');
2424
$this->assertValidArtistResponse($artist);
25-
$this->assertEquals('The Persuader', $artist['name']);
25+
$this->assertEquals('Billie Eilish', $artist['name']);
2626
}
2727

2828
public function testLevel2ConsumerCredentials(): void

0 commit comments

Comments
 (0)