@@ -76,6 +76,58 @@ public function copying_without_retaining_visibility(): void
76
76
self ::assertEquals ('private ' , $ visibility );
77
77
}
78
78
79
+ /**
80
+ * @test
81
+ */
82
+ public function extending_without_new_mounts_is_equal_but_not_the_same (): void
83
+ {
84
+ $ mountManager = $ this ->mountManager ->extend ([]);
85
+
86
+ $ this ->assertNotSame ($ this ->mountManager , $ mountManager );
87
+ $ this ->assertEquals ($ this ->mountManager , $ mountManager );
88
+ }
89
+
90
+ /**
91
+ * @test
92
+ */
93
+ public function extending_with_new_mounts_is_not_equal (): void
94
+ {
95
+ $ mountManager = $ this ->mountManager ->extend ([
96
+ 'third ' => new Filesystem (new InMemoryFilesystemAdapter ()),
97
+ ]);
98
+
99
+ $ this ->assertNotEquals ($ this ->mountManager , $ mountManager );
100
+ }
101
+
102
+ /**
103
+ * @test
104
+ */
105
+ public function extending_exposes_a_usable_mount_on_the_extension (): void
106
+ {
107
+ $ mountManager = $ this ->mountManager ->extend ([
108
+ 'third ' => new Filesystem (new InMemoryFilesystemAdapter ()),
109
+ ]);
110
+
111
+ $ mountManager ->write ('third://path.txt ' , 'this ' );
112
+ $ contents = $ mountManager ->read ('third://path.txt ' );
113
+
114
+ $ this ->assertEquals ('this ' , $ contents );
115
+ }
116
+
117
+ /**
118
+ * @test
119
+ */
120
+ public function extending_does_not_mount_on_the_original_mount_manager (): void
121
+ {
122
+ $ this ->mountManager ->extend ([
123
+ 'third ' => new Filesystem (new InMemoryFilesystemAdapter ()),
124
+ ]);
125
+
126
+ $ this ->expectException (UnableToResolveFilesystemMount::class);
127
+
128
+ $ this ->mountManager ->write ('third://path.txt ' , 'this ' );
129
+ }
130
+
79
131
/**
80
132
* @test
81
133
*/
0 commit comments