Commit 5247956
committed
test: conform Azure adapter tests to phpbu's mock pattern
Replace the in-file Testable* subclass doubles with phpbu's standard
PHPUnit mock pattern (createPartialMock / getMockBuilder->onlyMethods),
matching the sibling AmazonS3v3 tests. The azure-oss client is final, so
the mocks target the adapter's own protected seams rather than the SDK
client; coverage of the orchestration is preserved.
Assert the values passed to the SDK seams via with() matchers instead of
capturing internal state: the upload path, the list prefix and the
deleted blob path are now verified, and the File fixture uses a nested
blob name so pathname and filename are distinguishable.
Also align the adapters with the AmazonS3v3 sibling: $client is now
protected (Sync and File), and File\AzureBlob::deleteBlob() takes the
blob path as an argument.
Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>1 parent f98f01d commit 5247956
5 files changed
Lines changed: 108 additions & 173 deletions
File tree
- src/Backup
- File
- Sync
- tests/phpbu/Backup
- Collector
- File
- Sync
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
60 | 62 | | |
61 | | - | |
| 63 | + | |
62 | 64 | | |
63 | | - | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 13 | | |
33 | 14 | | |
34 | 15 | | |
| |||
54 | 35 | | |
55 | 36 | | |
56 | 37 | | |
57 | | - | |
58 | | - | |
| 38 | + | |
59 | 39 | | |
60 | 40 | | |
61 | 41 | | |
62 | 42 | | |
63 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
64 | 53 | | |
65 | 54 | | |
66 | | - | |
67 | 55 | | |
68 | 56 | | |
69 | 57 | | |
| |||
83 | 71 | | |
84 | 72 | | |
85 | 73 | | |
86 | | - | |
87 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
88 | 81 | | |
89 | 82 | | |
90 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 11 | | |
37 | 12 | | |
38 | 13 | | |
| |||
52 | 27 | | |
53 | 28 | | |
54 | 29 | | |
55 | | - | |
56 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
57 | 39 | | |
58 | 40 | | |
59 | | - | |
| 41 | + | |
60 | 42 | | |
61 | 43 | | |
62 | 44 | | |
63 | 45 | | |
64 | | - | |
65 | | - | |
66 | 46 | | |
67 | 47 | | |
68 | 48 | | |
| |||
72 | 52 | | |
73 | 53 | | |
74 | 54 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
78 | 62 | | |
79 | 63 | | |
80 | 64 | | |
| |||
0 commit comments