154 $rid_one =
new ResourceIdentification(
'1');
157 $this->machine_factory,
158 $this->resource_builder,
159 $this->storage_handler_factory,
160 $this->stream_access,
165 $flavour_definition = $this->createMock(FlavourDefinition::class);
166 $flavour_definition->expects($this->any())
167 ->method(
'getVariantName')
168 ->willReturn(
'short');
170 $this->flavour_repo->expects($this->once())
172 ->with($rid_one, 0, $flavour_definition)
175 $this->resource_builder->expects($this->exactly(1))
180 $revision = $this->createMock(FileRevision::class);
182 $revision->expects($this->once())
183 ->method(
'getInformation')
184 ->willReturn($this->createMock(FileInformation::class));
188 $resource = $this->createMock(StorableResource::class);
190 $this->resource_builder->expects($this->once())
193 ->willReturn($resource);
195 $resource->expects($this->any())
196 ->method(
'getCurrentRevision')
197 ->willReturn($revision);
200 $this->resource_builder->expects($this->exactly(1))
201 ->method(
'extractStream')
203 ->willReturn($stream);
211 $this->assertInstanceOf(Flavour::class, $flavour);
212 $stream_resolvers = $flavour->getStreamResolvers();
213 $this->assertCount(1, $stream_resolvers);
214 $first_stream_access = $stream_resolvers[0];
215 $this->assertInstanceOf(StreamResolver::class, $first_stream_access);
216 $resolved_stream = $first_stream_access->getStream();
217 $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