Skip to content

Commit 2dfc3cf

Browse files
committed
Refactor CI configuration and update test annotations for improved clarity
1 parent 104c06e commit 2dfc3cf

File tree

10 files changed

+41
-24
lines changed

10 files changed

+41
-24
lines changed

.gitattributes

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Normalize line endings
2+
* text=auto
3+
4+
# PHP files
5+
*.php text eol=lf diff=php
6+
7+
# Config files
8+
*.json text eol=lf
9+
*.xml text eol=lf
10+
*.md text eol=lf
11+
12+
# Exclude from releases
13+
.gitattributes export-ignore
14+
.gitignore export-ignore
15+
tests/ export-ignore
16+
phpunit.xml* export-ignore
17+
.phpunit.* export-ignore
18+
codecov.yml export-ignore

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,8 @@ jobs:
7878
composer config minimum-stability ${{ matrix.stability }}
7979
composer config prefer-stable true
8080
81-
- name: Remove composer.lock
82-
run: rm -f composer.lock
83-
8481
- name: Install dependencies
85-
run: composer update --prefer-dist --no-interaction --no-progress
82+
run: composer install --prefer-dist --no-interaction --no-progress
8683

8784
- name: Validate composer.json and composer.lock
8885
run: composer validate --strict

DEVELOPMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Integration tests are **separated from the CI pipeline** to prevent:
4444

4545
### Test Strategy
4646

47-
- **Unit Tests (101)**: Fast, reliable, no external dependencies → **CI default**
48-
- **Integration Tests (31)**: Real API calls, rate-limited → **Manual execution**
47+
- **Unit Tests**: Fast, reliable, no external dependencies → **CI default**
48+
- **Integration Tests**: Real API calls, rate-limited → **Manual execution**
4949
- **Total Coverage**: 100% lines, methods, and classes covered
5050

5151
### GitHub Secrets Required

UPGRADE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $search = $discogs->search('Billie Eilish', 'artist');
3636
- **Developer Experience**: ~750 lines of focused code with comprehensive type safety
3737
- **Type Safety**: Automatic parameter validation and conversion
3838

39-
## Migration Steps
39+
## 🔄 Migration Steps
4040

4141
### Step 1: Update Dependencies
4242

@@ -89,7 +89,7 @@ Parameters follow the order defined in the [service configuration](resources/ser
8989

9090
**💡 Tip**: Use `null` for optional parameters you want to skip.
9191

92-
## Migration Examples
92+
## 📚 Migration Examples
9393

9494
### Database Methods
9595

phpunit.xml.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,12 @@
2929
<php>
3030
<ini name="error_reporting" value="E_ALL"/>
3131
<ini name="memory_limit" value="-1"/>
32+
<!-- Discogs API credentials for integration tests -->
33+
<!-- Set these environment variables before running integration tests -->
34+
<env name="DISCOGS_CONSUMER_KEY" value=""/>
35+
<env name="DISCOGS_CONSUMER_SECRET" value=""/>
36+
<env name="DISCOGS_PERSONAL_ACCESS_TOKEN" value=""/>
37+
<env name="DISCOGS_OAUTH_TOKEN" value=""/>
38+
<env name="DISCOGS_OAUTH_TOKEN_SECRET" value=""/>
3239
</php>
3340
</phpunit>

tests/Integration/AuthenticatedIntegrationTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
/**
1111
* Integration tests that require authentication credentials
12-
*
13-
* @group integration
14-
* @group authenticated
1512
*/
1613
final class AuthenticatedIntegrationTest extends IntegrationTestCase
1714
{

tests/Integration/ClientWorkflowTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
use GuzzleHttp\Handler\MockHandler;
1212
use GuzzleHttp\HandlerStack;
1313
use GuzzleHttp\Psr7\Response;
14+
use PHPUnit\Framework\Attributes\CoversClass;
1415
use ReflectionClass;
1516
use ReflectionException;
1617
use RuntimeException;
1718

1819
/**
1920
* Integration tests for the complete client workflow
20-
*
21-
* @covers \Calliostro\Discogs\DiscogsClientFactory
22-
* @covers \Calliostro\Discogs\DiscogsClient
2321
*/
22+
#[CoversClass(DiscogsClientFactory::class)]
23+
#[CoversClass(DiscogsClient::class)]
2424
final class ClientWorkflowTest extends IntegrationTestCase
2525
{
2626
/**

tests/Unit/DiscogsClientFactoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
use GuzzleHttp\HandlerStack;
1414
use GuzzleHttp\Middleware;
1515
use GuzzleHttp\Psr7\Response;
16+
use PHPUnit\Framework\Attributes\CoversClass;
17+
use PHPUnit\Framework\Attributes\UsesClass;
1618

17-
/**
18-
* @covers \Calliostro\Discogs\DiscogsClientFactory
19-
* @uses \Calliostro\Discogs\DiscogsClient
20-
*/
19+
#[CoversClass(DiscogsClientFactory::class)]
20+
#[UsesClass(DiscogsClient::class)]
2121
final class DiscogsClientFactoryTest extends UnitTestCase
2222
{
2323
/**

tests/Unit/DiscogsClientTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@
1616
use GuzzleHttp\Psr7\Request;
1717
use GuzzleHttp\Psr7\Response;
1818
use InvalidArgumentException;
19+
use PHPUnit\Framework\Attributes\CoversClass;
1920
use PHPUnit\Framework\MockObject\MockObject;
2021
use Psr\Http\Message\ResponseInterface;
2122
use Psr\Http\Message\StreamInterface;
2223
use ReflectionClass;
2324
use ReflectionException;
2425
use RuntimeException;
2526

26-
/**
27-
* @covers \Calliostro\Discogs\DiscogsClient
28-
*/
27+
#[CoversClass(DiscogsClient::class)]
2928
final class DiscogsClientTest extends UnitTestCase
3029
{
3130
private DiscogsClient $client;

tests/Unit/OAuthHelperTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
use GuzzleHttp\HandlerStack;
1313
use GuzzleHttp\Psr7\Request;
1414
use GuzzleHttp\Psr7\Response;
15+
use PHPUnit\Framework\Attributes\CoversClass;
1516
use RuntimeException;
1617

17-
/**
18-
* @covers \Calliostro\Discogs\OAuthHelper
19-
*/
18+
#[CoversClass(OAuthHelper::class)]
2019
final class OAuthHelperTest extends UnitTestCase
2120
{
2221
public function testGetAuthorizationUrl(): void

0 commit comments

Comments
 (0)