164 $rid_one =
new ResourceIdentification(
'1');
167 $this->machine_factory,
168 $this->resource_builder,
169 $this->storage_handler_factory,
170 $this->stream_access,
175 $flavour_definition = $this->createMock(FlavourDefinition::class);
176 $flavour_definition->expects($this->any())
177 ->method(
'getVariantName')
178 ->willReturn(
'short');
180 $this->flavour_repo->expects($this->once())
182 ->with($rid_one, 0, $flavour_definition)
185 $this->resource_builder->expects($this->exactly(1))
190 $revision = $this->createMock(FileRevision::class);
192 $revision->expects($this->once())
193 ->method(
'getInformation')
194 ->willReturn($this->createMock(FileInformation::class));
198 $resource = $this->createMock(StorableResource::class);
200 $this->resource_builder->expects($this->once())
203 ->willReturn($resource);
205 $resource->expects($this->any())
206 ->method(
'getCurrentRevision')
207 ->willReturn($revision);
210 $this->resource_builder->expects($this->exactly(1))
211 ->method(
'extractStream')
213 ->willReturn($stream);
221 $this->assertInstanceOf(Flavour::class, $flavour);
222 $stream_resolvers = $flavour->getStreamResolvers();
223 $this->assertCount(1, $stream_resolvers);
224 $first_stream_access = $stream_resolvers[0];
225 $this->assertInstanceOf(StreamResolver::class, $first_stream_access);
226 $resolved_stream = $first_stream_access->getStream();
227 $this->assertEquals(
'empty', (
string) $resolved_stream);
get(ResourceIdentification $rid, FlavourDefinition $definition, bool $force_building=false)
static ofString(string $string)
Creates a new stream with an initial value.
FlavourBuilder $flavour_builder