示例#1
0
 public function testGetAnyFileWhenHasTwoElements()
 {
     $files = [new File('test.zip', new Format\Zip()), new File('test.phar', new Format\Phar())];
     $preferredFiles = $this->strategy->getPreferredFilesOrdered($files);
     $this->assertInstanceOf('\\Distill\\Format\\FormatInterface', $preferredFiles[0]->getFormat());
 }
 protected function registerStrategies(Container $container)
 {
     $container['distill.strategy.' . Strategy\MinimumSize::getName()] = $container->factory(function ($c) {
         return new Strategy\MinimumSize();
     });
     $container['distill.strategy.' . Strategy\UncompressionSpeed::getName()] = $container->factory(function ($c) {
         return new Strategy\UncompressionSpeed();
     });
     $container['distill.strategy.' . Strategy\Random::getName()] = $container->factory(function ($c) {
         return new Strategy\Random();
     });
 }