Skip to content

Commit 408dafb

Browse files
authored
Merge pull request #57 from markwalet/upgrade-laravel
Upgrade laravel
2 parents b1503ce + 0a9df8d commit 408dafb

29 files changed

+165
-132
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,20 @@ jobs:
1717
fail-fast: true
1818
matrix:
1919
php: [ 8.1, 8.2, 8.3, 8.4 ]
20-
illuminate: [ ^10.0, ^11.0 ]
20+
illuminate: [ ^10.0, ^11.0, ^12.0 ]
2121
stability: [ prefer-lowest, prefer-stable ]
2222
include:
2323
- illuminate: ^10.0
2424
testbench: 8.*
2525
- illuminate: ^11.0
2626
testbench: 9.*
27+
- illuminate: ^12.0
28+
testbench: 10.*
2729
exclude:
2830
- php: 8.1
2931
illuminate: ^11.0
30-
- php: 8.4
31-
illuminate: ^10.0
32+
- php: 8.1
33+
illuminate: ^12.0
3234

3335
name: P${{ matrix.php }} - I${{ matrix.illuminate }} - ${{ matrix.stability }}
3436

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [Unreleased](https://github.com/markwalet/laravel-changelog/compare/v1.10.0...master)
44

55
### Added
6+
- Support Laravel 12
67
- Included PHP 8.4 in test matrix
78

89
## [v1.10.0 (2024-03-13)](https://github.com/markwalet/laravel-changelog/compare/v1.9.0...v1.10.0)

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
],
1212
"require": {
1313
"php": "8.*",
14-
"laravel/framework": "^10.0|^11.0",
14+
"laravel/framework": "^10.0|^11.0|^12.0",
1515
"markwalet/laravel-git-state": "~1.0",
1616
"ext-simplexml": "*",
1717
"ext-dom": "*"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^10.5",
20+
"phpunit/phpunit": "^10.5|^11.0",
2121
"mockery/mockery": "~1.4",
22-
"orchestra/testbench": "8.*|9.*"
22+
"orchestra/testbench": "8.*|9.*|10.*"
2323
},
2424
"autoload": {
2525
"psr-4": {
@@ -34,6 +34,8 @@
3434
"config": {
3535
"sort-packages": true
3636
},
37+
"minimum-stability": "dev",
38+
"prefer-stable": true,
3739
"extra": {
3840
"laravel": {
3941
"providers": [

tests/Adapters/FakeFeatureAdapterTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use MarkWalet\Changelog\Change;
88
use MarkWalet\Changelog\Feature;
99
use MarkWalet\Changelog\Tests\LaravelTestCase;
10+
use PHPUnit\Framework\Attributes\Test;
1011

1112
class FakeFeatureAdapterTest extends LaravelTestCase
1213
{
@@ -31,8 +32,8 @@ public function adapter(): FeatureAdapter
3132
return $adapter;
3233
}
3334

34-
/** @test */
35-
public function it_can_write_a_changelog()
35+
#[Test]
36+
public function it_can_write_a_changelog(): void
3637
{
3738
$adapter = $this->adapter();
3839
$feature = new Feature([

tests/Adapters/FakeReleaseAdapterTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use MarkWalet\Changelog\Feature;
99
use MarkWalet\Changelog\Release;
1010
use MarkWalet\Changelog\Tests\LaravelTestCase;
11+
use PHPUnit\Framework\Attributes\Test;
1112

1213
class FakeReleaseAdapterTest extends LaravelTestCase
1314
{
@@ -58,8 +59,10 @@ public function adapter(): ReleaseAdapter
5859
return $adapter;
5960
}
6061

61-
public function it_can_execute_a_release()
62+
#[Test]
63+
public function it_can_execute_a_release(): void
6264
{
65+
$this->markTestSkipped();
6366
$adapter = $this->adapter();
6467
$path = __DIR__.'/../test-data/release-write-test';
6568

tests/Adapters/FeatureAdapterTests.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use MarkWalet\Changelog\Adapters\FeatureAdapter;
66
use MarkWalet\Changelog\Exceptions\FileNotFoundException;
7+
use PHPUnit\Framework\Attributes\Test;
78

89
trait FeatureAdapterTests
910
{
@@ -16,8 +17,8 @@ trait FeatureAdapterTests
1617
*/
1718
abstract public function adapter(): FeatureAdapter;
1819

19-
/** @test */
20-
public function it_can_see_if_a_changelog_exists()
20+
#[Test]
21+
public function it_can_see_if_a_changelog_exists(): void
2122
{
2223
$adapter = $this->adapter();
2324

@@ -28,8 +29,8 @@ public function it_can_see_if_a_changelog_exists()
2829
$this->assertFalse($resultB);
2930
}
3031

31-
/** @test */
32-
public function it_can_read_a_changelog()
32+
#[Test]
33+
public function it_can_read_a_changelog(): void
3334
{
3435
$adapter = $this->adapter();
3536

@@ -47,8 +48,8 @@ public function it_can_read_a_changelog()
4748
$this->assertEquals('Removed a deprecated function.', $changes[3]->message());
4849
}
4950

50-
/** @test */
51-
public function it_throws_an_exception_when_it_tries_to_read_a_non_existing_file()
51+
#[Test]
52+
public function it_throws_an_exception_when_it_tries_to_read_a_non_existing_file(): void
5253
{
5354
$adapter = $this->adapter();
5455
$path = __DIR__.'/../test-data/not-existing.xml';

tests/Adapters/ReleaseAdapterTests.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use MarkWalet\Changelog\Exceptions\DirectoryNotFoundException;
77
use MarkWalet\Changelog\Exceptions\FileNotFoundException;
88
use MarkWalet\Changelog\Exceptions\VersionAlreadyExistsException;
9+
use PHPUnit\Framework\Attributes\Test;
910

1011
trait ReleaseAdapterTests
1112
{
@@ -21,8 +22,8 @@ trait ReleaseAdapterTests
2122
*/
2223
abstract public function adapter(): ReleaseAdapter;
2324

24-
/** @test */
25-
public function it_can_see_if_a_release_exists()
25+
#[Test]
26+
public function it_can_see_if_a_release_exists(): void
2627
{
2728
$adapter = $this->adapter();
2829

@@ -33,8 +34,8 @@ public function it_can_see_if_a_release_exists()
3334
$this->assertFalse($resultB);
3435
}
3536

36-
/** @test */
37-
public function it_can_read_a_release()
37+
#[Test]
38+
public function it_can_read_a_release(): void
3839
{
3940
$adapter = $this->adapter();
4041

@@ -53,8 +54,8 @@ public function it_can_read_a_release()
5354
$this->assertEquals('Removed unused trait.', $changes[3]->message());
5455
}
5556

56-
/** @test */
57-
public function it_can_read_changes_of_a_nested_release()
57+
#[Test]
58+
public function it_can_read_changes_of_a_nested_release(): void
5859
{
5960
$adapter = $this->adapter();
6061

@@ -71,8 +72,8 @@ public function it_can_read_changes_of_a_nested_release()
7172
$this->assertEquals('Removed unused trait.', $changes[2]->message());
7273
}
7374

74-
/** @test */
75-
public function it_can_list_all_releases()
75+
#[Test]
76+
public function it_can_list_all_releases(): void
7677
{
7778
$adapter = $this->adapter();
7879

@@ -87,26 +88,26 @@ public function it_can_list_all_releases()
8788
$this->assertCount(2, $releases[2]->changes());
8889
}
8990

90-
/** @test */
91-
public function it_throws_an_exception_when_the_release_is_not_found()
91+
#[Test]
92+
public function it_throws_an_exception_when_the_release_is_not_found(): void
9293
{
9394
$this->expectException(FileNotFoundException::class);
9495
$adapter = $this->adapter();
9596

9697
$adapter->read('non-existing', 'version');
9798
}
9899

99-
/** @test */
100-
public function it_throws_an_exception_when_the_working_directory_is_not_found()
100+
#[Test]
101+
public function it_throws_an_exception_when_the_working_directory_is_not_found(): void
101102
{
102103
$this->expectException(DirectoryNotFoundException::class);
103104
$adapter = $this->adapter();
104105

105106
$adapter->all('non-existing');
106107
}
107108

108-
/** @test */
109-
public function it_throws_an_exception_when_the_version_already_exists()
109+
#[Test]
110+
public function it_throws_an_exception_when_the_version_already_exists(): void
110111
{
111112
$this->expectException(VersionAlreadyExistsException::class);
112113
$adapter = $this->adapter();

tests/Adapters/XmlFeatureAdapterTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use MarkWalet\Changelog\Exceptions\InvalidXmlException;
99
use MarkWalet\Changelog\Feature;
1010
use MarkWalet\Changelog\Tests\LaravelTestCase;
11+
use PHPUnit\Framework\Attributes\Test;
1112

1213
class XmlFeatureAdapterTest extends LaravelTestCase
1314
{
@@ -23,8 +24,8 @@ public function adapter(): FeatureAdapter
2324
return new XmlFeatureAdapter;
2425
}
2526

26-
/** @test */
27-
public function it_can_write_a_changelog()
27+
#[Test]
28+
public function it_can_write_a_changelog(): void
2829
{
2930
$adapter = $this->adapter();
3031
$feature = new Feature([
@@ -43,8 +44,8 @@ public function it_can_write_a_changelog()
4344
unlink($path);
4445
}
4546

46-
/** @test */
47-
public function it_creates_the_directory_recursively_if_it_does_not_exist()
47+
#[Test]
48+
public function it_creates_the_directory_recursively_if_it_does_not_exist(): void
4849
{
4950
$adapter = $this->adapter();
5051
$feature = new Feature([
@@ -65,8 +66,8 @@ public function it_creates_the_directory_recursively_if_it_does_not_exist()
6566
rmdir($folderA);
6667
}
6768

68-
/** @test */
69-
public function it_throws_an_exception_when_the_file_is_invalid()
69+
#[Test]
70+
public function it_throws_an_exception_when_the_file_is_invalid(): void
7071
{
7172
$adapter = $this->adapter();
7273
$path = __DIR__.'/../test-data/invalid.xml';

tests/Adapters/XmlReleaseAdapterTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use MarkWalet\Changelog\Adapters\XmlReleaseAdapter;
66
use MarkWalet\Changelog\Tests\LaravelTestCase;
7+
use PHPUnit\Framework\Attributes\Test;
78

89
class XmlReleaseAdapterTest extends LaravelTestCase
910
{
@@ -19,8 +20,8 @@ public function adapter(): XmlReleaseAdapter
1920
return new XmlReleaseAdapter();
2021
}
2122

22-
/** @test */
23-
public function it_can_execute_a_release()
23+
#[Test]
24+
public function it_can_execute_a_release(): void
2425
{
2526
$adapter = $this->adapter();
2627
$path = __DIR__.'/../test-data/release-write-test';

tests/ChangeTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
namespace MarkWalet\Changelog\Tests;
44

55
use MarkWalet\Changelog\Change;
6+
use PHPUnit\Framework\Attributes\Test;
67
use PHPUnit\Framework\TestCase;
78

89
class ChangeTest extends TestCase
910
{
10-
/** @test */
11-
public function it_can_set_properties_trough_the_constructor()
11+
#[Test]
12+
public function it_can_set_properties_trough_the_constructor(): void
1213
{
1314
$change = new Change('added', 'Added a new feature');
1415

@@ -19,8 +20,8 @@ public function it_can_set_properties_trough_the_constructor()
1920
$this->assertEquals('Added a new feature', $message);
2021
}
2122

22-
/** @test */
23-
public function change_type_is_converted_to_lowercase()
23+
#[Test]
24+
public function change_type_is_converted_to_lowercase(): void
2425
{
2526
$changeA = new Change('Ucfirst', '');
2627
$changeB = new Change('UPPERCASE', '');

0 commit comments

Comments
 (0)