Example #1
0
 public function testGetThirdPartyBlocks()
 {
     $embeddedComposer = $this->getMockBuilder('Dflydev\\EmbeddedComposer\\Core\\EmbeddedComposer')->disableOriginalConstructor()->getMock();
     $config = $this->getMockBuilder('Composer\\Config')->disableOriginalConstructor()->getMock();
     $config->expects($this->once())->method('has')->with('block-loader')->willReturn(true);
     $config->expects($this->once())->method('get')->with('block-loader')->willReturn('build/blocks.yml');
     $embeddedComposer->expects($this->once())->method('getExternalComposerConfig')->willReturn($config);
     $embeddedComposer->expects($this->once())->method('getExternalRootDirectory')->willReturn(vfsStream::url('root'));
     $this->application->expects($this->once())->method('getEmbeddedComposer')->willReturn($embeddedComposer);
     $bldrFolder = vfsStream::newDirectory('build')->at($this->root);
     vfsStream::newFile('blocks.yml')->withContent('[ \\stdClass, \\stdClass ]')->at($bldrFolder);
     $this->containerBuilder = new ContainerBuilder($this->application, $this->input, $this->output);
     $this->assertCount(2, $this->containerBuilder->getThirdPartyBlocks());
 }