/** @test */ public function itShouldNotCreateAndThrowAnException() { $filename = 'file'; $fileToAdd = 'file1'; $recursive = true; $adapter = $this->getSupportedAdapter(); $adapter->expects($this->never())->method('create'); $adapters = array($adapter); $strategy = $this->getStrategy('zippo', $adapters); $zippy = new Zippy($this->getContainer()); $zippy->addStrategy($strategy); try { $zippy->create($filename, $fileToAdd, $recursive, 'zippotte'); $this->fail('Should have raised an exception'); } catch (RuntimeException $e) { } }