public function testExceptionWhenNoStrategyIsDefined() { $this->setExpectedException('Distill\\Exception\\StrategyRequiredException'); $formatGuesser = m::mock('Distill\\FormatGuesserInterface'); $formatGuesser->shouldReceive('guess')->andReturn(new Format\FormatChain([new Format\Composed\TarGz()]), new Format\FormatChain([new Format\Simple\Zip()]))->getMock(); $this->chooser->setFormatGuesser($formatGuesser)->setFiles(['test.tgz', 'test.zip'])->getPreferredFile(); }