167 $rid_one =
new ResourceIdentification(
'1');
168 $flavour_builder =
new FlavourBuilder(
170 $this->machine_factory,
171 $this->resource_builder,
172 $this->storage_handler_factory,
173 $this->stream_access,
178 $flavour_definition = $this->createMock(FlavourDefinition::class);
179 $flavour_definition->expects($this->any())
180 ->method(
'getVariantName')
181 ->willReturn(
'short');
183 $this->flavour_repo->expects($this->once())
185 ->with($rid_one, 0, $flavour_definition)
188 $this->resource_builder->expects($this->exactly(1))
193 $revision = $this->createMock(FileRevision::class);
195 $revision->expects($this->once())
196 ->method(
'getInformation')
197 ->willReturn($this->createMock(FileInformation::class));
201 $resource = $this->createMock(StorableResource::class);
203 $this->resource_builder->expects($this->once())
206 ->willReturn($resource);
208 $resource->expects($this->any())
209 ->method(
'getCurrentRevision')
210 ->willReturn($revision);
213 $this->resource_builder->expects($this->exactly(1))
214 ->method(
'extractStream')
216 ->willReturn($stream);
220 $flavour = $flavour_builder->get(
224 $this->assertInstanceOf(Flavour::class, $flavour);
225 $stream_resolvers = $flavour->getStreamResolvers();
226 $this->assertCount(1, $stream_resolvers);
227 $first_stream_access = $stream_resolvers[0];
228 $this->assertInstanceOf(StreamResolver::class, $first_stream_access);
229 $resolved_stream = $first_stream_access->getStream();
230 $this->assertEquals(
'empty', (
string) $resolved_stream);
static ofString(string $string)
Creates a new stream with an initial value.