2
2
3
3
namespace Spatie \Snapshots \Test \Integration ;
4
4
5
+ use PHPUnit \Framework \Attributes \Test ;
5
6
use PHPUnit \Framework \TestCase ;
6
7
use Spatie \Snapshots \MatchesSnapshots ;
7
8
@@ -17,63 +18,63 @@ public function setUp(): void
17
18
$ this ->setUpComparesSnapshotFiles ();
18
19
}
19
20
20
- /** @test */
21
+ #[Test]
21
22
public function can_match_a_string_snapshot ()
22
23
{
23
24
$ data = 'Foo ' ;
24
25
25
26
$ this ->assertMatchesSnapshot ($ data );
26
27
}
27
28
28
- /** @test */
29
+ #[Test]
29
30
public function can_match_an_html_snapshot ()
30
31
{
31
32
$ data = '<!doctype html><html lang="en"><head></head><body><h1>Hello, world!</h1></body></html> ' ;
32
33
33
34
$ this ->assertMatchesHtmlSnapshot ($ data );
34
35
}
35
36
36
- /** @test */
37
+ #[Test]
37
38
public function can_match_an_xml_snapshot ()
38
39
{
39
40
$ data = '<foo><bar>Baz</bar></foo> ' ;
40
41
41
42
$ this ->assertMatchesXmlSnapshot ($ data );
42
43
}
43
44
44
- /** @test */
45
+ #[Test]
45
46
public function can_match_a_json_snapshot ()
46
47
{
47
48
$ data = '{"foo":"foo","bar":"bar","baz":"baz"} ' ;
48
49
49
50
$ this ->assertMatchesJsonSnapshot ($ data );
50
51
}
51
52
52
- /** @test */
53
+ #[Test]
53
54
public function can_match_an_array_snapshot ()
54
55
{
55
56
$ data = ['foo ' => 'foo ' , 'bar ' => 'bar ' , 'baz ' => 'baz ' ];
56
57
57
58
$ this ->assertMatchesJsonSnapshot ($ data );
58
59
}
59
60
60
- /** @test */
61
+ #[Test]
61
62
public function can_match_a_file_hash_snapshot ()
62
63
{
63
64
$ filePath = __DIR__ .'/stubs/example_snapshots/snapshot.json ' ;
64
65
65
66
$ this ->assertMatchesFileHashSnapshot ($ filePath );
66
67
}
67
68
68
- /** @test */
69
+ #[Test]
69
70
public function can_match_a_file_snapshot ()
70
71
{
71
72
$ filePath = __DIR__ .'/stubs/test_files/friendly_man.jpg ' ;
72
73
73
74
$ this ->assertMatchesFileSnapshot ($ filePath );
74
75
}
75
76
76
- /** @test */
77
+ #[Test]
77
78
public function can_do_multiple_snapshot_assertions ()
78
79
{
79
80
$ this ->assertMatchesSnapshot ('Foo ' );
0 commit comments