public function createStubs(StubbingContextInterface $context) { $filesystem = $context->getFilesystem(); $phpWriter = new PhpBundleWriter(); $filesystem->remove($context->getStubDir()); $filesystem->mkdir($context->getStubDir()); foreach ($this->rules as $rule) { $filesystem->mkdir($context->getStubDir() . '/' . $rule->getBundleName()); $data = $rule->beforeCreateStub($context); $phpWriter->write($context->getStubDir() . '/' . $rule->getBundleName(), 'en', $data); $rule->afterCreateStub($context); } }
public function testWrite() { $this->writer->write($this->directory, 'en', array('Entry1' => array('Array' => array('foo', 'bar'), 'Integer' => 5, 'Boolean' => false, 'Float' => 1.23), 'Entry2' => 'String')); $this->assertFileEquals(__DIR__ . '/Fixtures/en.php', $this->directory . '/en.php'); }